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
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
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
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
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
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
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
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
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
37 /// only reachable from the [`SocketState::Connecting`] state.
38 Connected(TcpStream),
39▶ /// The SO_ERROR socket option has been set after calling
40 /// the `connect` syscall, indicating that the connection
41 /// attempt failed. By the POSIX specification, a socket is
· · ·
57 /// The current blocking I/O readiness of the file description.
58 io_readiness: RefCell<Readiness>,
59▶ /// [`Some`] when the socket had an async error which has not yet been fetched via `SO_ERROR`.
60 error: RefCell<Option<io::Error>>,
61 /// Read timeout of the socket. [`None`] means that reads can block indefinitely.
· · ·
60▶ error: RefCell<Option<io::Error>>,
61 /// Read timeout of the socket. [`None`] means that reads can block indefinitely.
62 /// The timeout is applied to the monotonic clock (the Unix specification doesn't
· · ·
82 is_non_block: Cell::new(is_non_block),
83 io_readiness: RefCell::new(Readiness::EMPTY),
84▶ error: RefCell::new(None),
85 read_timeout: Cell::new(None),
86 write_timeout: Cell::new(None),
· · ·
101 len: usize,
102 ecx: &mut MiriInterpCx<'tcx>,
103▶ finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
104 ) -> InterpResult<'tcx> {
105 self.recv(
+ 110 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
4use crate::borrow::Cow;
5use crate::ffi::{OsStr, OsString, c_void};
6▶use crate::fs::TryLockError;
7use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom};
8use crate::mem::{self, MaybeUninit, offset_of};
· · ·
7▶use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom};
8use crate::mem::{self, MaybeUninit, offset_of};
9use crate::os::windows::io::{AsHandle, BorrowedHandle};
· · ·
12use crate::sync::Arc;
13use crate::sys::handle::Handle;
14▶use crate::sys::pal::api::{self, WinError, set_file_information_by_handle};
15use crate::sys::pal::{IoResult, fill_utf16_buf, to_u16s, truncate_utf16_at_nul};
16use crate::sys::path::{WCStr, maybe_verbatim};
· · ·
123 // This iterator was initialized with an `INVALID_HANDLE_VALUE` as its handle.
124 // Simply return `None` because this is only the case when `FindFirstFileExW` in
125▶ // the construction of this iterator returns `ERROR_FILE_NOT_FOUND` which means
126 // no matchhing files can be found.
127 return None;
· · ·
137 if c::FindNextFileW(handle.0, &mut wfd) == 0 {
138 self.handle = None;
139▶ match api::get_last_error() {
140 WinError::NO_MORE_FILES => return None,
141 WinError { code } => {
+ 86 more matches in this file
46use rustc_middle::query::LocalCrate;
47use rustc_middle::ty::TyCtxt;
48▶use rustc_session::config::{ErrorOutputType, OptLevel};
49use rustc_session::{EarlyDiagCtxt, Session};
50use rustc_structures::CrateType;
· · ·
86 eprintln!("FAILING SEED: {seed}");
87 if !many_seeds.keep_going {
88▶ // `abort_if_errors` would unwind but would not actually stop miri, since
89 // `par_for_each` waits for the rest of the threads to finish.
90 exit(return_code.get());
· · ·
111/// target features.
112fn make_miri_codegen_backend(sess: &Session, dep: bool) -> Box<dyn CodegenBackend> {
113▶ let early_dcx = EarlyDiagCtxt::new(sess.opts.error_format);
114
115 // Use the target_config method of the default codegen backend (eg LLVM) to ensure the
· · ·
143 // Compilation is done, interpretation is starting. Deal with diagnostics from the
144 // compilation part. We cannot call `sess.finish_diagnostics()` as then "aborting due to
145▶ // previous errors" gets printed twice.
146 tcx.dcx().emit_stashed_diagnostics();
147 tcx.dcx().abort_if_errors();
· · ·
147▶ tcx.dcx().abort_if_errors();
148 tcx.dcx().flush_delayed();
149
+ 43 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
30
31use rustc_data_structures::fx::FxHashSet;
32▶use rustc_errors::codes::*;
33use rustc_errors::{Applicability, Diag, ErrorGuaranteed};
34use rustc_hir::def_id::{DefId, LocalDefId};
· · ·
33▶use rustc_errors::{Applicability, Diag, ErrorGuaranteed};
34use rustc_hir::def_id::{DefId, LocalDefId};
35use rustc_hir::{self as hir, ExprKind};
· · ·
41use rustc_middle::ty::adjustment::AllowTwoPhase;
42use rustc_middle::ty::cast::{CastKind, CastTy};
43▶use rustc_middle::ty::error::TypeError;
44use rustc_middle::ty::{
45 self, Ty, TyCtxt, TypeAndMut, TypeVisitableExt, Unnormalized, VariantDef, elaborate,
· · ·
52
53use super::FnCtxt;
54▶use crate::{diagnostics, type_error_struct};
55
56/// Reifies a cast check to be checked once we have full type information for
· · ·
94 t: Ty<'tcx>,
95 span: Span,
96▶ ) -> Result<Option<PointerKind<'tcx>>, ErrorGuaranteed> {
97 debug!("pointer_kind({:?}, {:?})", t, span);
98
+ 105 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
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
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
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
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
30use crate::{
31 Adjust, Adjustment, AutoBorrow, CallableDefId, InferBodyId, ParamEnvAndCrate,
32▶ consteval::ConstEvalError,
33 db::{GeneralConstId, HirDatabase, InternedClosure, InternedClosureId},
34 display::{DisplayTarget, HirDisplay, hir_display_with_store},
· · ·
42 },
43 inhabitedness::is_ty_uninhabited_from,
44▶ layout::LayoutError,
45 method_resolution::CandidateId,
46 mir::{
· · ·
99// FIXME: Make this smaller, its stored in database queries
100#[derive(Debug, Clone, PartialEq, Eq, SalsaValue)]
101▶pub enum MirLowerError<'db> {
102 ConstEvalError(Box<str>, Box<ConstEvalError<'db>>),
103 LayoutError(LayoutError),
· · ·
102▶ ConstEvalError(Box<str>, Box<ConstEvalError<'db>>),
103 LayoutError(LayoutError),
104 IncompleteExpr,
· · ·
103▶ LayoutError(LayoutError),
104 IncompleteExpr,
105 IncompletePattern,
+ 83 more matches in this file
70
71use crate::{
72▶ ExpandError, ExpandErrorKind, MetaTemplate, ValueResult,
73 expander::{Binding, Bindings, ExpandResult, Fragment, TokensOrigin},
74 expect_fragment,
· · ·
93pub(super) struct Match<'a> {
94 pub(super) bindings: Bindings<'a>,
95▶ /// We currently just keep the first error and count the rest to compare matches.
96 pub(super) err: Option<ExpandError>,
97 pub(super) err_count: usize,
· · ·
96▶ pub(super) err: Option<ExpandError>,
97 pub(super) err_count: usize,
98 /// How many top-level token trees were left to match.
· · ·
103
104impl Match<'_> {
105▶ fn add_err(&mut self, err: ExpandError) {
106 let prev_err = self.err.take();
107 self.err = prev_err.or(Some(err));
· · ·
110}
111
112▶/// Matching errors are added to the `Match`.
113pub(super) fn match_<'t>(
114 db: &dyn salsa::Database,
+ 52 more matches in this file