9use rustc_data_structures::fx::{FxHashMap, FxHashSet};
10use rustc_data_structures::unord::UnordSet;
11▶use rustc_errors::codes::*;
12use rustc_errors::{
13 Applicability, Diag, ErrorGuaranteed, Level, MultiSpan, StashKey, StringPart, Suggestions, msg,
· · ·
12▶use rustc_errors::{
13 Applicability, Diag, ErrorGuaranteed, Level, MultiSpan, StashKey, StringPart, Suggestions, msg,
14 pluralize, struct_span_code_err,
· · ·
13▶ Applicability, Diag, ErrorGuaranteed, Level, MultiSpan, StashKey, StringPart, Suggestions, msg,
14 pluralize, struct_span_code_err,
15};
· · ·
21use rustc_infer::infer::{InferOk, TypeTrace};
22use rustc_infer::traits::solve::Goal;
23▶use rustc_infer::traits::{ImplSource, TraitErrors};
24use rustc_middle::traits::SignatureMismatchData;
25use rustc_middle::traits::select::OverflowError;
· · ·
25▶use rustc_middle::traits::select::OverflowError;
26use rustc_middle::ty::abstract_const::NotConstEvaluatable;
27use rustc_middle::ty::error::{ExpectedFound, TypeError};
+ 161 more matches in this file
2
3use rustc_data_structures::intern::Interned;
4▶use rustc_errors::{Applicability, Diag, IntoDiagArg};
5use rustc_hir as hir;
6use rustc_hir::def::Namespace;
· · ·
7use rustc_hir::def_id::{CRATE_DEF_ID, DefId};
8use rustc_middle::bug;
9▶use rustc_middle::ty::error::ExpectedFound;
10use rustc_middle::ty::print::{FmtPrinter, Print, PrintTraitRefExt as _, RegionHighlightMode};
11use rustc_middle::ty::{
· · ·
19 TraitPlaceholderMismatch, TyOrSig,
20};
21▶use crate::error_reporting::infer::nice_region_error::NiceRegionError;
22use crate::infer::{RegionResolutionError, SubregionOrigin, TypeTrace, ValuePairs};
23use crate::traits::{ObligationCause, ObligationCauseCode};
· · ·
22▶use crate::infer::{RegionResolutionError, SubregionOrigin, TypeTrace, ValuePairs};
23use crate::traits::{ObligationCause, ObligationCauseCode};
24
· · ·
35 T: for<'a> Print<FmtPrinter<'a, 'tcx>> + Copy,
36{
37▶ fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> rustc_errors::DiagArgValue {
38 rustc_errors::DiagArgValue::Str(self.to_string().into())
39 }
+ 16 more matches in this file
13use rustc_data_structures::fx::{FxHashMap, FxHashSet};
14use rustc_data_structures::unord::{UnordMap, UnordSet};
15▶use rustc_errors::codes::*;
16use rustc_errors::{
17 Applicability, Diag, DiagCtxtHandle, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle,
· · ·
16▶use rustc_errors::{
17 Applicability, Diag, DiagCtxtHandle, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle,
18 pluralize, struct_span_code_err,
· · ·
17▶ Applicability, Diag, DiagCtxtHandle, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle,
18 pluralize, struct_span_code_err,
19};
· · ·
50};
51use crate::hygiene::Macros20NormalizedSyntaxContext;
52▶use crate::imports::{Import, ImportKind, UnresolvedImportError, import_path_to_string};
53use crate::late::{DiagMetadata, PatternSource, Rib};
54use crate::{
· · ·
55▶ AmbiguityError, AmbiguityKind, AmbiguityWarning, BindingError, BindingKey, Decl, DeclKind,
56 DelayedVisResolutionError, Finalize, ForwardGenericParamBanReason, HasGenericParams, IdentKey,
57 LateDecl, MacroRulesScope, Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult,
+ 111 more matches in this file
6use rustc_data_structures::fx::FxIndexSet;
7use rustc_data_structures::thin_vec::ThinVec;
8▶use rustc_errors::codes::*;
9use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, a_or_an, listify, pluralize};
10use rustc_hir as hir;
· · ·
9▶use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, a_or_an, listify, pluralize};
10use rustc_hir as hir;
11use rustc_hir::attrs::DivergingBlockBehavior;
· · ·
22};
23use rustc_middle::ty::adjustment::AllowTwoPhase;
24▶use rustc_middle::ty::error::{ExpectedFound, TypeError};
25use rustc_middle::ty::print::with_forced_trimmed_paths;
26use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation};
· · ·
29use rustc_session::Session;
30use rustc_span::{DUMMY_SP, Ident, Span, kw, sym};
31▶use rustc_trait_selection::error_reporting::infer::{FailureCode, ObligationCauseExt};
32use rustc_trait_selection::infer::InferCtxtExt;
33use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt, SelectionContext};
· · ·
40use crate::coercion::CoerceMany;
41use crate::diagnostics::{ExprParenthesesNeeded, SuggestPtrNullMut};
42▶use crate::fn_ctxt::arg_matrix::{ArgMatrix, Compatibility, Error, ExpectedIdx, ProvidedIdx};
43use crate::gather_locals::Declaration;
44use crate::inline_asm::InlineAsmCtxt;
+ 187 more matches in this file
1// ignore-tidy-file-filelength
2▶// FIXME: we should move the field error reporting code somewhere else.
3
4//! Type checking expressions.
· · ·
12use rustc_data_structures::thin_vec::ThinVec;
13use rustc_data_structures::unord::UnordMap;
14▶use rustc_errors::codes::*;
15use rustc_errors::{
16 Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, Subdiagnostic, listify, pluralize,
· · ·
15▶use rustc_errors::{
16 Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, Subdiagnostic, listify, pluralize,
17 struct_span_code_err,
· · ·
16▶ Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, Subdiagnostic, listify, pluralize,
17 struct_span_code_err,
18};
· · ·
27use rustc_infer::traits::query::NoSolution;
28use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase};
29▶use rustc_middle::ty::error::{ExpectedFound, TypeError};
30use rustc_middle::ty::{self, AdtKind, GenericArgsRef, Ty, TypeVisitableExt, Unnormalized};
31use rustc_middle::{bug, span_bug};
+ 176 more matches in this file
20use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
21use rustc_data_structures::unord::{UnordMap, UnordSet};
22▶use rustc_errors::codes::*;
23use rustc_errors::{
24 Applicability, Diag, DiagArgValue, Diagnostic, ErrorGuaranteed, IntoDiagArg, MultiSpan,
· · ·
23▶use rustc_errors::{
24 Applicability, Diag, DiagArgValue, Diagnostic, ErrorGuaranteed, IntoDiagArg, MultiSpan,
25 StashKey, Suggestions, elided_lifetime_in_path_suggestion, pluralize,
· · ·
24▶ Applicability, Diag, DiagArgValue, Diagnostic, ErrorGuaranteed, IntoDiagArg, MultiSpan,
25 StashKey, Suggestions, elided_lifetime_in_path_suggestion, pluralize,
26};
· · ·
42
43use crate::{
44▶ BindingError, BindingKey, Decl, DelegationFnSig, Finalize, IdentKey, LateDecl, LocalModule,
45 Module, ModuleOrUniformRoot, ParentScope, PathResult, Res, ResolutionError, Resolver, Segment,
46 Stage, TyCtxt, UseError, Used, path_names_to_string, rustdoc, with_owner,
· · ·
45▶ Module, ModuleOrUniformRoot, ParentScope, PathResult, Res, ResolutionError, Resolver, Segment,
46 Stage, TyCtxt, UseError, Used, path_names_to_string, rustdoc, with_owner,
47};
+ 164 more matches in this file
7use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
8use rustc_data_structures::intern::Interned;
9▶use rustc_errors::{Applicability, BufferedEarlyLint, Diagnostic};
10use rustc_expand::base::SyntaxExtensionKind;
11use rustc_hir::def::{self, DefKind, PartialRes};
· · ·
35use crate::ref_mut::{CmCell, CmRefCell};
36use crate::{
37▶ AmbiguityError, BindingKey, Decl, DeclData, DeclKind, Determinacy, Finalize, IdentKey,
38 ImportSuggestion, ImportSummary, LocalModule, ModuleOrUniformRoot, ParentScope, PathResult,
39 PerNS, Res, ResolutionError, Resolver, ScopeSet, Segment, Used, module_to_string,
· · ·
39▶ PerNS, Res, ResolutionError, Resolver, ScopeSet, Segment, Used, module_to_string,
40 names_to_string,
41};
· · ·
98 Glob {
99 // The visibility of the greatest re-export.
100▶ // n.b. `max_vis` is only used in `finalize_import` to check for re-export errors.
101 max_vis: CmCell<Option<Visibility>>,
102 id: NodeId,
· · ·
206 /// A `#[diagnostic::on_unknown]` attribute applied
207 /// to the given import. This allows crates to specify
208▶ /// custom error messages for a specific import
209 ///
210 /// This is `None` if the feature flag for `diagnostic::on_unknown` is disabled.
+ 63 more matches in this file
4use Namespace::*;
5use rustc_ast::{self as ast, NodeId};
6▶use rustc_errors::ErrorGuaranteed;
7use rustc_hir::def::{DefKind, MacroKinds, Namespace, NonMacroAttrKind, PartialRes, PerNS};
8use rustc_lint_defs::builtin::PROC_MACRO_DERIVE_RESOLUTION_FALLBACK;
· · ·
23use crate::macros::{MacroRulesScope, sub_namespace_match};
24use crate::{
25▶ AmbiguityError, AmbiguityKind, AmbiguityWarning, BindingKey, CmResolver, Decl, DeclKind,
26 Determinacy, ExternModule, Finalize, IdentKey, ImportKind, ImportSummary, LateDecl,
27 LocalModule, Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PrivacyError,
· · ·
27▶ LocalModule, Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PrivacyError,
28 Res, ResolutionError, Resolver, Scope, ScopeSet, Segment, Stage, Symbol, Used, diagnostics,
29 module_to_string,
· · ·
28▶ Res, ResolutionError, Resolver, Scope, ScopeSet, Segment, Stage, Symbol, Used, diagnostics,
29 module_to_string,
30};
· · ·
89 // (Macro NS)
90 // 1-3. Derive helpers (open, not controlled). All ambiguities with other names
91▶ // are currently reported as errors. They should be higher in priority than preludes
92 // and probably even names in modules according to the "general principles" above. They
93 // also should be subject to restricted shadowing because are effectively produced by
+ 67 more matches in this file
14use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
15use rustc_data_structures::unord::UnordItems;
16▶use rustc_errors::codes::*;
17use rustc_errors::{
18 Applicability, Diag, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle, pluralize,
· · ·
17▶use rustc_errors::{
18 Applicability, Diag, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle, pluralize,
19 struct_span_code_err,
· · ·
18▶ Applicability, Diag, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle, pluralize,
19 struct_span_code_err,
20};
· · ·
116#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
117pub(super) struct MissingLifetime {
118▶ /// Used to overwrite the resolution with the suggestion, to avoid cascading errors.
119 pub id: NodeId,
120 /// As we cannot yet emit lints in this crate and have to buffer them instead,
· · ·
158/// Only used for diagnostics.
159#[derive(Debug)]
160▶struct BaseError {
161 msg: String,
162 fallback_label: String,
+ 65 more matches in this file
5use rustc_ast as ast;
6use rustc_data_structures::fx::FxHashMap;
7▶use rustc_errors::codes::*;
8use rustc_errors::{
9 Applicability, Diag, DiagCtxtHandle, Diagnostic, ErrorGuaranteed, Level, MultiSpan, pluralize,
· · ·
8▶use rustc_errors::{
9 Applicability, Diag, DiagCtxtHandle, Diagnostic, ErrorGuaranteed, Level, MultiSpan, pluralize,
10 struct_span_code_err,
· · ·
9▶ Applicability, Diag, DiagCtxtHandle, Diagnostic, ErrorGuaranteed, Level, MultiSpan, pluralize,
10 struct_span_code_err,
11};
· · ·
18 PatKind, expr_needs_parens,
19};
20▶use rustc_hir_analysis::autoderef::report_autoderef_recursion_limit_error;
21use rustc_infer::infer::RegionVariableOrigin;
22use rustc_lint_defs::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
· · ·
39
40const CANNOT_IMPLICITLY_DEREF_POINTER_TRAIT_OBJ: &str = "\
41▶This error indicates that a pointer to a trait type cannot be implicitly dereferenced by a \
42pattern. Every trait defines a type, but because the size of trait implementors isn't fixed, \
43this type has no compile-time size. Therefore, all accesses to trait types must be through \
+ 122 more matches in this file
98 /// Force us to name impls with just the filename/line number. We
99 /// normally try to use types. But at some points, notably while printing
100▶ /// cycle errors, this can result in extra or suboptimal error output,
101 /// so this variable disables that check.
102 fn with_forced_impl_filename_line(ForcedImplGuard, FORCE_IMPL_FILENAME_LINE);
· · ·
180
181/// The "region highlights" are used to control region printing during
182▶/// specific error messages. When a "region highlight" is enabled, it
183/// gives an alternate way to print specific regions. For now, we
184/// always print those regions using a number, so something like "`'0`".
· · ·
267 def_id: DefId,
268 args: &'tcx [GenericArg<'tcx>],
269▶ ) -> Result<(), PrintError> {
270 self.print_def_path(def_id, args)
271 }
· · ·
272
273▶ fn pretty_print_in_binder<T>(&mut self, value: &ty::Binder<'tcx, T>) -> Result<(), PrintError>
274 where
275 T: Print<Self> + TypeFoldable<TyCtxt<'tcx>>,
· · ·
278 }
279
280▶ fn wrap_binder<T, F: FnOnce(&T, &mut Self) -> Result<(), fmt::Error>>(
281 &mut self,
282 value: &ty::Binder<'tcx, T>,
+ 80 more matches in this file
3use std::{borrow::Cow, cell::RefCell, fmt::Write, iter, mem, ops::Range};
4
5▶use base_db::{Crate, target::TargetLoadError};
6use either::Either;
7use hir_def::{
· · ·
40use crate::{
41 CallableDefId, ComplexMemoryMap, InferBodyId, InferenceResult, MemoryMap, ParamEnvAndCrate,
42▶ consteval::{self, ConstEvalError, try_const_usize},
43 db::{GeneralConstId, HirDatabase, InternedClosureId},
44 display::{ClosureStyle, DisplayTarget, HirDisplay},
· · ·
45 infer::PointerCast,
46▶ layout::{Layout, LayoutError, RustcEnumVariantIdx},
47 method_resolution::{is_dyn_method, lookup_impl_const},
48 next_solver::{
· · ·
49▶ AliasTy, Allocation, AllocationData, Const, ConstKind, DbInterner, ErrorGuaranteed,
50 GenericArgs, Region, StoredTy, Ty, TyKind, TypingMode, UnevaluatedConst, ValTree,
51 infer::{DbInternerInferExt, InferCtxt, traits::ObligationCause},
· · ·
57
58use super::{
59▶ AggregateKind, BasicBlockId, BinOp, CastKind, LocalId, MirBody, MirLowerError, MirSpan,
60 Operand, OperandKind, Place, PlaceElem, PlaceRef, PlaceTy, ProjectionElem, Rvalue,
61 StatementKind, TerminatorKind, UnOp, return_slot,
+ 118 more matches in this file
12use rustc_ast_pretty::pprust;
13use rustc_data_structures::fx::FxHashSet;
14▶use rustc_errors::{
15 Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, PResult, Subdiagnostic, Suggestions, msg,
16 pluralize,
· · ·
15▶ Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, PResult, Subdiagnostic, Suggestions, msg,
16 pluralize,
17};
· · ·
18use rustc_span::symbol::used_keywords;
19▶use rustc_span::{BytePos, DUMMY_SP, Ident, Span, SpanSnippetError, Spanned, Symbol, kw, sym};
20use thin_vec::{ThinVec, thin_vec};
21use tracing::{debug, trace};
· · ·
47
48/// Creates a placeholder argument.
49▶pub(super) fn dummy_arg(ident: Ident, guar: ErrorGuaranteed) -> Param {
50 let pat = Box::new(Pat {
51 id: ast::DUMMY_NODE_ID,
· · ·
203/// Checks if the given `lookup` identifier is similar to any keyword symbol in `candidates`.
204///
205▶/// This is a specialized version of [`Symbol::find_similar`] that constructs an error when a
206/// candidate is found.
207fn find_similar_kw(lookup: Ident, candidates: &[Symbol]) -> Option<MisspelledKw> {
+ 61 more matches in this file
19mod cmse;
20mod dyn_trait;
21▶pub mod errors;
22pub mod generics;
23
· · ·
29use rustc_data_structures::sso::SsoHashSet;
30use rustc_data_structures::thin_vec::ThinVec;
31▶use rustc_errors::codes::*;
32use rustc_errors::{
33 Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, StashKey,
· · ·
32▶use rustc_errors::{
33 Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, StashKey,
34 struct_span_code_err,
· · ·
33▶ Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, StashKey,
34 struct_span_code_err,
35};
· · ·
53use rustc_span::{DUMMY_SP, Ident, Span, kw, sym};
54use rustc_trait_selection::infer::InferCtxtExt;
55▶use rustc_trait_selection::traits::{self, FulfillmentError};
56use tracing::{debug, instrument};
57
+ 118 more matches in this file
19};
20use rustc_ast_pretty::pprust;
21▶use rustc_errors::{Applicability, Diag, PResult, StashKey, Subdiagnostic};
22use rustc_lint_defs::builtin::BREAK_WITH_LABEL_AND_LOOP;
23use rustc_literal_escaper::unescape_char;
· · ·
24▶use rustc_session::diagnostics::report_lit_error;
25use rustc_span::edition::Edition;
26use rustc_span::{BytePos, ErrorGuaranteed, Ident, Pos, Span, Spanned, Symbol, kw, respan, sym};
· · ·
26▶use rustc_span::{BytePos, ErrorGuaranteed, Ident, Pos, Span, Spanned, Symbol, kw, respan, sym};
27use thin_vec::{ThinVec, thin_vec};
28use tracing::instrument;
· · ·
47 MiddleDot(Symbol, Span, Span, Symbol, Span),
48 /// Invalid
49▶ Error,
50}
51
· · ·
349 (true, Some(op)) if !op.can_continue_expr_unambiguously() => false,
350 (true, Some(_)) => {
351▶ self.error_found_expr_would_be_stmt(lhs);
352 true
353 }
+ 63 more matches in this file
4use rustc_abi::{ExternAbi, FieldIdx, MAX_SIMD_LANES, ScalableElt};
5use rustc_data_structures::unord::{UnordMap, UnordSet};
6▶use rustc_errors::codes::*;
7use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, MultiSpan};
8use rustc_hir as hir;
· · ·
7▶use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, MultiSpan};
8use rustc_hir as hir;
9use rustc_hir::attrs::ReprAttr::ReprPacked;
· · ·
12use rustc_hir::{Node, find_attr, intravisit};
13use rustc_infer::infer::{RegionVariableOrigin, TyCtxtInferExt};
14▶use rustc_infer::traits::{Obligation, ObligationCauseCode, TraitErrors, WellFormedLoc};
15use rustc_lint_defs::builtin::{DEAD_CODE, UNINHABITED_STATIC, UNSUPPORTED_CALLING_CONVENTIONS};
16use rustc_macros::Diagnostic;
· · ·
18use rustc_middle::middle::resolve_bound_vars::ResolvedArg;
19use rustc_middle::middle::stability::EvalResult;
20▶use rustc_middle::ty::error::TypeErrorToStringExt;
21use rustc_middle::ty::layout::LayoutError;
22use rustc_middle::ty::util::Discr;
· · ·
21▶use rustc_middle::ty::layout::LayoutError;
22use rustc_middle::ty::util::Discr;
23use rustc_middle::ty::{
+ 53 more matches in this file
6use rustc_ast as ast;
7use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
8▶use rustc_errors::codes::*;
9use rustc_errors::{Applicability, ErrorGuaranteed, msg, pluralize, struct_span_code_err};
10use rustc_hir as hir;
· · ·
9▶use rustc_errors::{Applicability, ErrorGuaranteed, msg, pluralize, struct_span_code_err};
10use rustc_hir as hir;
11use rustc_hir::attrs::lang_items::LangItem;
· · ·
16use rustc_infer::infer::TyCtxtInferExt;
17use rustc_infer::infer::outlives::env::OutlivesEnvironment;
18▶use rustc_infer::traits::{PredicateObligations, TraitErrors};
19use rustc_lint_defs::builtin::{REDUNDANT_LIFETIMES, SHADOWING_SUPERTRAIT_ITEMS};
20use rustc_macros::Diagnostic;
· · ·
21▶use rustc_middle::mir::interpret::ErrorHandled;
22use rustc_middle::traits::solve::NoSolution;
23use rustc_middle::ty::trait_def::TraitSpecializationKind;
· · ·
30use rustc_session::diagnostics::feature_err;
31use rustc_span::{DUMMY_SP, Span, sym};
32▶use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
33use rustc_trait_selection::regions::{
34 OutlivesEnvironmentBuildExt, region_known_to_outlive, ty_known_to_outlive,
+ 96 more matches in this file
100}
101
102▶pub type Result<T = (), E = HirDisplayError> = std::result::Result<T, E>;
103
104pub trait HirWrite: fmt::Write {
· · ·
189 } else {
190 if self.display_kind.is_source_code() {
191▶ Err(HirDisplayError::DisplaySourceCodeError(DisplaySourceCodeError::Cycle))
192 } else {
193 match target.kind {
· · ·
253 assert!(
254 !matches!(display_kind, DisplayKind::SourceCode { .. }),
255▶ "HirDisplayWrapper cannot fail with DisplaySourceCodeError, use HirDisplay::hir_fmt directly instead"
256 );
257 HirDisplayWrapper {
· · ·
354 module_id: ModuleId,
355 allow_opaque: bool,
356▶ ) -> Result<String, DisplaySourceCodeError> {
357 let mut result = String::new();
358 let interner = DbInterner::new_with(db, module_id.krate(db));
· · ·
376 }) {
377 Ok(()) => {}
378▶ Err(HirDisplayError::FmtError) => panic!("Writing to String can't fail!"),
379 Err(HirDisplayError::DisplaySourceCodeError(e)) => return Err(e),
380 };
+ 46 more matches in this file
3use std::borrow::Cow;
4use std::ffi::OsString;
5▶use std::fs::{self, DirBuilder, File, FileTimes, FileType, OpenOptions, TryLockError};
6use std::io::{self, ErrorKind, Read, Seek, SeekFrom, Write};
7use std::path::{self, Path};
· · ·
6▶use std::io::{self, ErrorKind, Read, Seek, SeekFrom, Write};
7use std::path::{self, Path};
8use std::time::SystemTime;
· · ·
69 len: usize,
70 ecx: &mut MiriInterpCx<'tcx>,
71▶ finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
72 ) -> InterpResult<'tcx> {
73 assert!(communicate_allowed, "isolation should have prevented even opening a file");
· · ·
74 if !self.readable {
75▶ return finish.call(ecx, Err(LibcError("EBADF")));
76 }
77
· · ·
79 // Emulates pread using seek + read + seek to restore cursor position.
80 // Correctness of this emulation relies on sequential nature of Miri execution.
81▶ // The closure is used to emulate `try` block, since we "bubble" `io::Error` using `?`.
82 let file = &mut &self.file;
83 let mut f = || {
+ 95 more matches in this file
6use hir::def_id::{DefId, DefIdMap, LocalDefId};
7use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
8▶use rustc_errors::codes::*;
9use rustc_errors::{Applicability, ErrorGuaranteed, MultiSpan, pluralize, struct_span_code_err};
10use rustc_hir::def::{DefKind, Res};
· · ·
9▶use rustc_errors::{Applicability, ErrorGuaranteed, MultiSpan, pluralize, struct_span_code_err};
10use rustc_hir::def::{DefKind, Res};
11use rustc_hir::intravisit::VisitorExt;
· · ·
12use rustc_hir::{self as hir, AmbigArg, GenericParamKind, ImplItemKind, intravisit};
13use rustc_infer::infer::{self, BoundRegionConversionTime, InferCtxt, TyCtxtInferExt};
14▶use rustc_infer::traits::{TraitErrors, util};
15use rustc_middle::ty::error::{ExpectedFound, TypeError};
16use rustc_middle::ty::{
· · ·
15▶use rustc_middle::ty::error::{ExpectedFound, TypeError};
16use rustc_middle::ty::{
17 self, BottomUpFolder, GenericArgs, GenericParamDefKind, Generics, RegionExt, Ty, TyCtxt,
· · ·
21use rustc_middle::{bug, span_bug};
22use rustc_span::{BytePos, DUMMY_SP, Span};
23▶use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
24use rustc_trait_selection::infer::InferCtxtExt;
25use rustc_trait_selection::regions::InferCtxtRegionExt;
+ 116 more matches in this file
38use std::ops::{ControlFlow, Deref};
39
40▶use rustc_errors::codes::*;
41use rustc_errors::{Applicability, Diag, struct_span_code_err};
42use rustc_hir as hir;
· · ·
41▶use rustc_errors::{Applicability, Diag, struct_span_code_err};
42use rustc_hir as hir;
43use rustc_hir::attrs::InlineAttr;
· · ·
48use rustc_infer::infer::{DefineOpaqueTypes, InferOk, InferResult, RegionVariableOrigin};
49use rustc_infer::traits::{
50▶ MatchExpressionArmCause, Obligation, PredicateObligation, PredicateObligations, SelectionError,
51};
52use rustc_middle::span_bug;
· · ·
55 PointerCoercion,
56};
57▶use rustc_middle::ty::error::TypeError;
58use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, Unnormalized};
59use rustc_span::{BytePos, DUMMY_SP, Span};
· · ·
104 to_mutbl: hir::Mutability,
105) -> RelateResult<'tcx, ()> {
106▶ if from_mutbl >= to_mutbl { Ok(()) } else { Err(TypeError::Mutability) }
107}
108
+ 99 more matches in this file
15 Address, AdtId, Arc, Evaluator, FunctionId, GenericArgs, HasModule, HirDisplay, Interval,
16 IntervalAndTy, IntervalOrOwned, IsSigned, ItemContainerId, Layout, Locals, Lookup,
17▶ MirEvalError, MirSpan, Mutability, Result, Ty, TyKind, from_bytes, not_supported, pad16,
18 },
19 next_solver::Region,
· · ·
203 ty: Ty::new_ref(
204 self.interner(),
205▶ Region::error(self.interner()),
206 ty,
207 Mutability::Not,
· · ·
233 {
234 let [size, align] = args else {
235▶ return Err(MirEvalError::InternalError(
236 "rustc_allocator args are not provided".into(),
237 ));
· · ·
245 _ if alloc_fn.contains(AttrFlags::RUSTC_REALLOCATOR) => {
246 let [ptr, old_size, align, new_size] = args else {
247▶ return Err(MirEvalError::InternalError(
248 "rustc_allocator args are not provided".into(),
249 ));
· · ·
307 let mut arg = args
308 .next()
309▶ .ok_or(MirEvalError::InternalError(
310 "argument of BeginPanic is not provided".into(),
311 ))?
+ 88 more matches in this file
5use rustc_abi::{FieldIdx, VariantIdx};
6use rustc_data_structures::fx::FxIndexMap;
7▶use rustc_errors::formatting::DiagMessageAddArg;
8use rustc_errors::{Applicability, Diag, DiagMessage, EmissionGuarantee, MultiSpan, listify, msg};
9use rustc_hir::attrs::lang_items::LangItem;
· · ·
8▶use rustc_errors::{Applicability, Diag, DiagMessage, EmissionGuarantee, MultiSpan, listify, msg};
9use rustc_hir::attrs::lang_items::LangItem;
10use rustc_hir::def::{CtorKind, Namespace};
· · ·
14use rustc_index::{IndexSlice, IndexVec};
15use rustc_infer::infer::{BoundRegionConversionTime, NllRegionVariableOrigin};
16▶use rustc_infer::traits::SelectionError;
17use rustc_middle::mir::{
18 AggregateKind, CallSource, ConstOperand, ConstraintCategory, FakeReadCause, Local, LocalInfo,
· · ·
26use rustc_span::def_id::LocalDefId;
27use rustc_span::{DUMMY_SP, Span, Spanned, Symbol, sym};
28▶use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
29use rustc_trait_selection::error_reporting::traits::call_kind::{CallDesugaringKind, call_kind};
30use rustc_trait_selection::infer::InferCtxtExt;
· · ·
29▶use rustc_trait_selection::error_reporting::traits::call_kind::{CallDesugaringKind, call_kind};
30use rustc_trait_selection::infer::InferCtxtExt;
31use rustc_trait_selection::traits::{
+ 71 more matches in this file
18try:
19 import lzma
20▶except ImportError:
21 lzma = None
22
· · ·
41 try:
42 return cpu_count()
43▶ except NotImplementedError:
44 return 1
45
· · ·
56 try:
57 if url not in checksums:
58▶ raise RuntimeError(
59 (
60 "src/stage0 doesn't contain a checksum for {}. "
· · ·
80 download(temp_path, "{}/{}".format(base, url), True, verbose)
81 if not verify(temp_path, sha256, verbose):
82▶ raise RuntimeError("failed verification")
83 if verbose > 0:
84 eprint("moving {} to {}".format(temp_path, path))
· · ·
103 _download(path, url, probably_big, verbose, True)
104 return
105▶ except RuntimeError:
106 eprint("\nspurious failure, trying again")
107 _download(path, url, probably_big, verbose, False)
+ 38 more matches in this file
18 Array.prototype.toSpliced = function() {
19 const me = this.slice();
20▶ // @ts-expect-error
21 Array.prototype.splice.apply(me, arguments);
22 return me;
· · ·
84 reject = rej;
85 });
86▶ // @ts-expect-error
87 return {promise, resolve, reject};
88 };
· · ·
414 checkExtraTypeFilterCharacters(start, parserState);
415 // typeFilterElem is not undefined. If it was, the elems.length check would have fired.
416▶ // @ts-expect-error
417 parserState.typeFilter = typeFilterElem.normalizedPathLast;
418 parserState.pos += 1;
· · ·
428 *
429 * If there is no `endChar`, this function will implicitly stop at the end
430▶ * without raising an error.
431 *
432 * @param {rustdoc.ParsedQuery<rustdoc.ParserQueryElement>} query
· · ·
920 * from it until we find another `"`.
921 *
922▶ * This function will throw an error in the following cases:
923 * * There is already another string element.
924 * * We are parsing a generic argument.
+ 55 more matches in this file