35,227 matches across 25 files for error lang:Rust
snippet_mode: auto · sorted by relevance
compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs RUST 152 matches · showing 5 view file →
9use rustc_data_structures::fx::{FxHashMap, FxHashSet};
10use rustc_data_structures::unord::UnordSet;
11use rustc_errors::codes::*;
12use rustc_errors::{
13 Applicability, Diag, ErrorGuaranteed, Level, MultiSpan, StashKey, StringPart, Suggestions, msg,
· · ·
12use 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};
· · ·
22use rustc_infer::traits::solve::Goal;
23use rustc_middle::traits::SignatureMismatchData;
24use rustc_middle::traits::select::OverflowError;
25use rustc_middle::ty::abstract_const::NotConstEvaluatable;
26use rustc_middle::ty::error::{ExpectedFound, TypeError};
· · ·
26use rustc_middle::ty::error::{ExpectedFound, TypeError};
27use rustc_middle::ty::print::{
28 PrintPolyTraitPredicateExt, PrintPolyTraitRefExt as _, PrintTraitPredicateExt as _,
+ 147 more matches in this file
compiler/rustc_parse/src/parser/expr.rs RUST 187 matches · showing 5 view file →
21use rustc_ast_pretty::pprust;
22use rustc_data_structures::stack::ensure_sufficient_stack;
23use rustc_errors::{Applicability, Diag, PResult, StashKey, Subdiagnostic};
24use rustc_literal_escaper::unescape_char;
25use rustc_session::errors::{ExprParenthesesNeeded, report_lit_error};
· · ·
25use rustc_session::errors::{ExprParenthesesNeeded, report_lit_error};
26use rustc_session::lint::builtin::BREAK_WITH_LABEL_AND_LOOP;
27use rustc_span::edition::Edition;
· · ·
28use rustc_span::{BytePos, ErrorGuaranteed, Ident, Pos, Span, Spanned, Symbol, kw, respan, sym};
29use thin_vec::{ThinVec, thin_vec};
30use tracing::instrument;
· · ·
37 Restrictions, SemiColonMode, SeqSep, TokenType, Trailing, UsePreAttrPos,
38};
39use crate::{errors, exp, maybe_recover_from_interpolated_ty_qpath};
40
41#[derive(Debug)]
· · ·
48 MiddleDot(Symbol, Span, Span, Symbol, Span),
49 /// Invalid
50 Error,
51}
52
+ 182 more matches in this file
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/placeholder_error.rs RUST 20 matches · showing 5 view file →
2
3use rustc_data_structures::intern::Interned;
4use rustc_errors::{Diag, IntoDiagArg};
5use rustc_hir::def::Namespace;
6use rustc_hir::def_id::{CRATE_DEF_ID, DefId};
· · ·
7use rustc_middle::bug;
8use rustc_middle::ty::error::ExpectedFound;
9use rustc_middle::ty::print::{FmtPrinter, Print, PrintTraitRefExt as _, RegionHighlightMode};
10use rustc_middle::ty::{self, GenericArgsRef, RePlaceholder, Region, TyCtxt};
· · ·
15 TraitPlaceholderMismatch, TyOrSig,
16};
17use crate::error_reporting::infer::nice_region_error::NiceRegionError;
18use crate::infer::{RegionResolutionError, SubregionOrigin, TypeTrace, ValuePairs};
19use crate::traits::{ObligationCause, ObligationCauseCode};
· · ·
18use crate::infer::{RegionResolutionError, SubregionOrigin, TypeTrace, ValuePairs};
19use crate::traits::{ObligationCause, ObligationCauseCode};
20
· · ·
31 T: for<'a> Print<FmtPrinter<'a, 'tcx>>,
32{
33 fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> rustc_errors::DiagArgValue {
34 rustc_errors::DiagArgValue::Str(self.to_string().into())
35 }
+ 15 more matches in this file
compiler/rustc_parse/src/parser/item.rs RUST 112 matches · showing 5 view file →
9use rustc_ast::util::case::Case;
10use rustc_ast_pretty::pprust;
11use rustc_errors::codes::*;
12use rustc_errors::{Applicability, PResult, StashKey, msg, struct_span_code_err};
13use rustc_session::lint::builtin::VARARGS_WITHOUT_PATTERN;
· · ·
12use rustc_errors::{Applicability, PResult, StashKey, msg, struct_span_code_err};
13use rustc_session::lint::builtin::VARARGS_WITHOUT_PATTERN;
14use rustc_span::edit_distance::edit_distance;
· · ·
15use rustc_span::edition::Edition;
16use rustc_span::{DUMMY_SP, ErrorGuaranteed, Ident, Span, Symbol, kw, respan, sym};
17use thin_vec::{ThinVec, thin_vec};
18use tracing::debug;
· · ·
24 Parser, PathStyle, Recovered, Trailing, UsePreAttrPos,
25};
26use crate::errors::{
27 self, FnPointerCannotBeAsync, FnPointerCannotBeConst, MacroExpandsToAdtField,
28 UseDoubleColonSuggestion, UseRegularStructSuggestion,
· · ·
68
69 // There shouldn't be any stray semicolons before or after items.
70 // `parse_item` consumes the appropriate semicolons so any leftover is an error.
71 loop {
72 while self.maybe_consume_incorrect_semicolon(items.last().map(|x| &**x)) {} // Eat all bad semicolons
+ 107 more matches in this file
compiler/rustc_hir_typeck/src/expr.rs RUST 181 matches · showing 5 view file →
1// ignore-tidy-filelength
2// FIXME: we should move the field error reporting code somewhere else.
3
4//! Type checking expressions.
· · ·
12use rustc_data_structures::stack::ensure_sufficient_stack;
13use rustc_data_structures::unord::UnordMap;
14use rustc_errors::codes::*;
15use rustc_errors::{
16 Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, Subdiagnostic, listify, pluralize,
· · ·
15use 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};
· · ·
28use rustc_infer::traits::query::NoSolution;
29use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase};
30use rustc_middle::ty::error::{ExpectedFound, TypeError};
31use rustc_middle::ty::{self, AdtKind, GenericArgsRef, Ty, TypeVisitableExt, Unnormalized};
32use rustc_middle::{bug, span_bug};
+ 176 more matches in this file
compiler/rustc_resolve/src/late.rs RUST 159 matches · showing 5 view file →
20use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
21use rustc_data_structures::unord::{UnordMap, UnordSet};
22use rustc_errors::codes::*;
23use rustc_errors::{
24 Applicability, Diag, DiagArgValue, Diagnostic, ErrorGuaranteed, IntoDiagArg, MultiSpan,
· · ·
23use 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};
· · ·
33use rustc_middle::{bug, span_bug};
34use rustc_session::config::{CrateType, ResolveDocLinks};
35use rustc_session::errors::feature_err;
36use rustc_session::lint;
37use rustc_span::{BytePos, DUMMY_SP, Ident, Span, Spanned, Symbol, kw, respan, sym};
· · ·
41
42use crate::{
43 BindingError, BindingKey, Decl, DelegationFnSig, Finalize, IdentKey, LateDecl, LocalModule,
44 Module, ModuleOrUniformRoot, ParentScope, PathResult, Res, ResolutionError, Resolver, Segment,
45 Stage, TyCtxt, UseError, Used, path_names_to_string, rustdoc, with_owner,
+ 154 more matches in this file
compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs RUST 174 matches · showing 5 view file →
5use rustc_ast as ast;
6use rustc_data_structures::fx::FxIndexSet;
7use rustc_errors::codes::*;
8use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, a_or_an, listify, pluralize};
9use rustc_hir as hir;
· · ·
8use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, a_or_an, listify, pluralize};
9use rustc_hir as hir;
10use rustc_hir::attrs::DivergingBlockBehavior;
· · ·
18use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferOk, TypeTrace};
19use rustc_middle::ty::adjustment::AllowTwoPhase;
20use rustc_middle::ty::error::TypeError;
21use rustc_middle::ty::{self, IsSuggestable, Ty, TyCtxt, TypeVisitableExt, Unnormalized};
22use rustc_middle::{bug, span_bug};
· · ·
23use rustc_session::Session;
24use rustc_session::errors::ExprParenthesesNeeded;
25use rustc_span::{DUMMY_SP, Ident, Span, kw, sym};
26use rustc_trait_selection::error_reporting::infer::{FailureCode, ObligationCauseExt};
· · ·
26use rustc_trait_selection::error_reporting::infer::{FailureCode, ObligationCauseExt};
27use rustc_trait_selection::infer::InferCtxtExt;
28use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt, SelectionContext};
+ 169 more matches in this file
compiler/rustc_resolve/src/late/diagnostics.rs RUST 70 matches · showing 5 view file →
14use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
15use rustc_data_structures::unord::UnordItems;
16use rustc_errors::codes::*;
17use rustc_errors::{
18 Applicability, Diag, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle, pluralize,
· · ·
17use 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};
· · ·
33
34use super::NoConstantGenericsReason;
35use crate::error_helper::{ImportSuggestion, LabelSuggestion, TypoSuggestion};
36use crate::late::{
37 AliasPossibility, LateResolutionVisitor, LifetimeBinderKind, LifetimeRes, LifetimeRibKind,
· · ·
115#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
116pub(super) struct MissingLifetime {
117 /// Used to overwrite the resolution with the suggestion, to avoid cascading errors.
118 pub id: NodeId,
119 /// As we cannot yet emit lints in this crate and have to buffer them instead,
+ 65 more matches in this file
compiler/rustc_resolve/src/ident.rs RUST 72 matches · showing 5 view file →
4use Namespace::*;
5use rustc_ast::{self as ast, NodeId};
6use rustc_errors::ErrorGuaranteed;
7use rustc_hir::def::{DefKind, MacroKinds, Namespace, NonMacroAttrKind, PartialRes, PerNS};
8use rustc_middle::{bug, span_bug};
· · ·
9use rustc_session::errors::feature_err;
10use rustc_session::lint::builtin::PROC_MACRO_DERIVE_RESOLUTION_FALLBACK;
11use rustc_span::edition::Edition;
· · ·
23use crate::macros::{MacroRulesScope, sub_namespace_match};
24use crate::{
25 AmbiguityError, AmbiguityKind, AmbiguityWarning, BindingKey, CmResolver, Decl, DeclKind,
26 Determinacy, Finalize, IdentKey, ImportKind, ImportSummary, LateDecl, LocalModule, Module,
27 ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PrivacyError, Res, ResolutionError,
· · ·
27 ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PrivacyError, Res, ResolutionError,
28 Resolver, Scope, ScopeSet, Segment, Stage, Symbol, Used, diagnostics,
29};
· · ·
88 // (Macro NS)
89 // 1-3. Derive helpers (open, not controlled). All ambiguities with other names
90 // are currently reported as errors. They should be higher in priority than preludes
91 // and probably even names in modules according to the "general principles" above. They
92 // also should be subject to restricted shadowing because are effectively produced by
+ 67 more matches in this file
compiler/rustc_resolve/src/imports.rs RUST 70 matches · showing 5 view file →
7use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
8use rustc_data_structures::intern::Interned;
9use rustc_errors::{Applicability, BufferedEarlyLint, Diagnostic};
10use rustc_expand::base::SyntaxExtensionKind;
11use rustc_hir::def::{self, DefKind, PartialRes};
· · ·
14use rustc_middle::span_bug;
15use rustc_middle::ty::Visibility;
16use rustc_session::errors::feature_err;
17use rustc_session::lint::LintId;
18use rustc_session::lint::builtin::{
· · ·
32 ConsiderMarkingAsPubCrate,
33};
34use crate::error_helper::{OnUnknownData, Suggestion};
35use crate::ref_mut::CmCell;
36use crate::{
· · ·
37 AmbiguityError, BindingKey, CmResolver, Decl, DeclData, DeclKind, Determinacy, Finalize,
38 IdentKey, ImportSuggestion, ImportSummary, LocalModule, ModuleOrUniformRoot, ParentScope,
39 PathResult, PerNS, Res, ResolutionError, Resolver, ScopeSet, Segment, Used, module_to_string,
· · ·
39 PathResult, PerNS, Res, ResolutionError, Resolver, ScopeSet, Segment, Used, module_to_string,
40 names_to_string,
41};
+ 65 more matches in this file
compiler/rustc_hir_typeck/src/pat.rs RUST 128 matches · showing 5 view file →
5use rustc_ast as ast;
6use rustc_data_structures::fx::FxHashMap;
7use rustc_errors::codes::*;
8use rustc_errors::{
9 Applicability, Diag, DiagCtxtHandle, Diagnostic, ErrorGuaranteed, Level, MultiSpan, pluralize,
· · ·
8use 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};
· · ·
17 PatExprKind, PatKind, expr_needs_parens,
18};
19use rustc_hir_analysis::autoderef::report_autoderef_recursion_limit_error;
20use rustc_infer::infer::RegionVariableOrigin;
21use rustc_middle::traits::PatternOriginExpr;
· · ·
22use rustc_middle::ty::{self, Pinnedness, Ty, TypeVisitableExt, Unnormalized};
23use rustc_middle::{bug, span_bug};
24use rustc_session::errors::feature_err;
25use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
26use rustc_span::edit_distance::find_best_match_for_name;
+ 123 more matches in this file
compiler/rustc_middle/src/ty/print/pretty.rs RUST 84 matches · showing 5 view file →
97 /// Force us to name impls with just the filename/line number. We
98 /// normally try to use types. But at some points, notably while printing
99 /// cycle errors, this can result in extra or suboptimal error output,
100 /// so this variable disables that check.
101 fn with_forced_impl_filename_line(ForcedImplGuard, FORCE_IMPL_FILENAME_LINE);
· · ·
179
180/// The "region highlights" are used to control region printing during
181/// specific error messages. When a "region highlight" is enabled, it
182/// gives an alternate way to print specific regions. For now, we
183/// always print those regions using a number, so something like "`'0`".
· · ·
260 def_id: DefId,
261 args: &'tcx [GenericArg<'tcx>],
262 ) -> Result<(), PrintError> {
263 self.print_def_path(def_id, args)
264 }
· · ·
265
266 fn pretty_print_in_binder<T>(&mut self, value: &ty::Binder<'tcx, T>) -> Result<(), PrintError>
267 where
268 T: Print<Self> + TypeFoldable<TyCtxt<'tcx>>,
· · ·
271 }
272
273 fn wrap_binder<T, F: FnOnce(&T, &mut Self) -> Result<(), fmt::Error>>(
274 &mut self,
275 value: &ty::Binder<'tcx, T>,
+ 79 more matches in this file
compiler/rustc_parse/src/parser/diagnostics.rs RUST 58 matches · showing 5 view file →
12use rustc_ast_pretty::pprust;
13use rustc_data_structures::fx::FxHashSet;
14use 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_session::errors::ExprParenthesesNeeded;
19use rustc_span::symbol::used_keywords;
20use rustc_span::{BytePos, DUMMY_SP, Ident, Span, SpanSnippetError, Spanned, Symbol, kw, sym};
· · ·
20use rustc_span::{BytePos, DUMMY_SP, Ident, Span, SpanSnippetError, Spanned, Symbol, kw, sym};
21use thin_vec::{ThinVec, thin_vec};
22use tracing::{debug, trace};
· · ·
27 SeqSep, TokenType,
28};
29use crate::errors::{
30 AddParen, AmbiguousPlus, AsyncMoveBlockIn2015, AsyncUseBlockIn2015, AttributeOnParamType,
31 AwaitSuggestion, BadQPathStage2, BadTypePlus, BadTypePlusSub, ColonAsSemi,
+ 53 more matches in this file
compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs RUST 47 matches · showing 5 view file →
6use rustc_ast::util::parser::ExprPrecedence;
7use rustc_data_structures::packed::Pu128;
8use rustc_errors::{Applicability, Diag, MultiSpan, listify, msg};
9use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
10use rustc_hir::intravisit::Visitor;
· · ·
24 suggest_constraining_type_params,
25};
26use rustc_session::errors::ExprParenthesesNeeded;
27use rustc_span::{ExpnKind, Ident, MacroKind, Span, Spanned, Symbol, sym};
28use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
· · ·
28use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
29use rustc_trait_selection::error_reporting::traits::DefIdOrName;
30use rustc_trait_selection::error_reporting::traits::suggestions::ReturnsVisitor;
· · ·
29use rustc_trait_selection::error_reporting::traits::DefIdOrName;
30use rustc_trait_selection::error_reporting::traits::suggestions::ReturnsVisitor;
31use rustc_trait_selection::infer::InferCtxtExt;
· · ·
30use rustc_trait_selection::error_reporting::traits::suggestions::ReturnsVisitor;
31use rustc_trait_selection::infer::InferCtxtExt;
32use rustc_trait_selection::traits;
+ 42 more matches in this file
compiler/rustc_hir_typeck/src/method/suggest.rs RUST 52 matches · showing 5 view file →
1//! Give useful errors and suggestions to users when an item can't be
2//! found or is otherwise invalid.
3
· · ·
13use rustc_data_structures::sorted_map::SortedMap;
14use rustc_data_structures::unord::UnordSet;
15use rustc_errors::codes::*;
16use rustc_errors::{
17 Applicability, Diag, MultiSpan, StashKey, StringPart, listify, pluralize, struct_span_code_err,
· · ·
16use rustc_errors::{
17 Applicability, Diag, MultiSpan, StashKey, StringPart, listify, pluralize, struct_span_code_err,
18};
· · ·
35use rustc_span::def_id::DefIdSet;
36use rustc_span::{
37 DUMMY_SP, ErrorGuaranteed, ExpnKind, FileName, Ident, MacroKind, Span, Symbol, edit_distance,
38 kw, sym,
39};
· · ·
40use rustc_trait_selection::error_reporting::traits::DefIdOrName;
41use rustc_trait_selection::infer::InferCtxtExt;
42use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
+ 47 more matches in this file
src/tools/rust-analyzer/crates/hir-ty/src/mir/eval.rs RUST 123 matches · showing 5 view file →
3use std::{borrow::Cow, cell::RefCell, fmt::Write, iter, mem, ops::Range};
4
5use base_db::{Crate, target::TargetLoadError};
6use either::Either;
7use hir_def::{
· · ·
39use crate::{
40 CallableDefId, ComplexMemoryMap, InferBodyId, InferenceResult, MemoryMap, ParamEnvAndCrate,
41 consteval::{self, ConstEvalError, try_const_usize},
42 db::{GeneralConstId, HirDatabase, InternedClosureId},
43 display::{ClosureStyle, DisplayTarget, HirDisplay},
· · ·
44 infer::PointerCast,
45 layout::{Layout, LayoutError, RustcEnumVariantIdx},
46 method_resolution::{is_dyn_method, lookup_impl_const},
47 next_solver::{
· · ·
48 AliasTy, Allocation, AllocationData, Const, ConstKind, DbInterner, ErrorGuaranteed,
49 GenericArgs, Region, StoredTy, Ty, TyKind, TypingMode, UnevaluatedConst, ValTree,
50 infer::{DbInternerInferExt, InferCtxt, traits::ObligationCause},
· · ·
56
57use super::{
58 AggregateKind, BasicBlockId, BinOp, CastKind, LocalId, MirBody, MirLowerError, MirSpan,
59 Operand, OperandKind, Place, PlaceElem, PlaceRef, PlaceTy, ProjectionElem, Rvalue,
60 StatementKind, TerminatorKind, UnOp, return_slot,
+ 118 more matches in this file
compiler/rustc_codegen_ssa/src/back/link.rs RUST 88 matches · showing 5 view file →
19use rustc_data_structures::memmap::Mmap;
20use rustc_data_structures::temp_dir::MaybeTempDir;
21use rustc_errors::DiagCtxtHandle;
22use rustc_fs_util::{TempDirBuilder, fix_windows_verbatim_for_gcc, try_canonicalize};
23use rustc_hir::attrs::NativeLibKind;
· · ·
63use super::{apple, rmeta_link, versioned_llvm_target};
64use crate::base::needs_allocator_shim_for_linking;
65use crate::{CodegenLintLevelSpecs, CompiledModule, CompiledModules, CrateInfo, NativeLib, errors};
66
67pub fn ensure_removed(dcx: DiagCtxtHandle<'_>, path: &Path) {
· · ·
68 if let Err(e) = fs::remove_file(path) {
69 if e.kind() != io::ErrorKind::NotFound {
70 dcx.err(format!("failed to remove {}: {}", path.display(), e));
71 }
· · ·
88 let mut tempfiles_for_stdout_output: Vec<PathBuf> = Vec::new();
89 for &crate_type in &crate_info.crate_types {
90 // Ignore executable crates if we have -Z no-codegen, as they will error.
91 if (sess.opts.unstable_opts.no_codegen || !sess.opts.output_types.should_codegen())
92 && !output_metadata
· · ·
116 .prefix("rustc")
117 .tempdir_in(output.parent().unwrap_or_else(|| Path::new(".")))
118 .unwrap_or_else(|error| sess.dcx().emit_fatal(errors::CreateTempDir { error }));
119 let path = MaybeTempDir::new(tmpdir, sess.opts.cg.save_temps);
120
+ 83 more matches in this file
src/tools/miri/src/shims/unix/socket.rs RUST 118 matches · showing 5 view file →
47 /// only reachable from the [`SocketState::Connecting`] state.
48 Connected(TcpStream),
49 /// The SO_ERROR socket option has been set after calling
50 /// the `connect` syscall, indicating that the connection
51 /// attempt failed. By the POSIX specification, a socket is
· · ·
67 /// The current blocking I/O readiness of the file description.
68 io_readiness: RefCell<BlockingIoSourceReadiness>,
69 /// [`Some`] when the socket had an async error which has not yet been fetched via `SO_ERROR`.
70 error: RefCell<Option<io::Error>>,
71 /// Read timeout of the socket. [`None`] means that reads can block indefinitely.
· · ·
70 error: RefCell<Option<io::Error>>,
71 /// Read timeout of the socket. [`None`] means that reads can block indefinitely.
72 /// The timeout is applied to the monotonic clock (the Unix specification doesn't
· · ·
117 len: usize,
118 ecx: &mut MiriInterpCx<'tcx>,
119 finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
120 ) -> InterpResult<'tcx> {
121 assert!(communicate_allowed, "cannot have `Socket` with isolation enabled!");
· · ·
134 ptr: Pointer,
135 len: usize,
136 finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
137 } |this, result: Result<(), ()>| {
138 if result.is_err() {
+ 113 more matches in this file
src/tools/rust-analyzer/crates/hir-ty/src/display.rs RUST 51 matches · showing 5 view file →
100}
101
102pub type Result<T = (), E = HirDisplayError> = std::result::Result<T, E>;
103
104pub trait HirWrite: fmt::Write {
· · ·
188 } else {
189 if self.display_kind.is_source_code() {
190 Err(HirDisplayError::DisplaySourceCodeError(DisplaySourceCodeError::Cycle))
191 } else {
192 match target.kind {
· · ·
252 assert!(
253 !matches!(display_kind, DisplayKind::SourceCode { .. }),
254 "HirDisplayWrapper cannot fail with DisplaySourceCodeError, use HirDisplay::hir_fmt directly instead"
255 );
256 HirDisplayWrapper {
· · ·
349 module_id: ModuleId,
350 allow_opaque: bool,
351 ) -> Result<String, DisplaySourceCodeError> {
352 let mut result = String::new();
353 let interner = DbInterner::new_with(db, module_id.krate(db));
· · ·
370 }) {
371 Ok(()) => {}
372 Err(HirDisplayError::FmtError) => panic!("Writing to String can't fail!"),
373 Err(HirDisplayError::DisplaySourceCodeError(e)) => return Err(e),
374 };
+ 46 more matches in this file
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs RUST 110 matches · showing 5 view file →
17mod cmse;
18mod dyn_trait;
19pub mod errors;
20pub mod generics;
21
· · ·
25use rustc_ast::LitKind;
26use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
27use rustc_errors::codes::*;
28use rustc_errors::{
29 Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, StashKey,
· · ·
28use rustc_errors::{
29 Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, StashKey,
30 struct_span_code_err,
· · ·
29 Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, StashKey,
30 struct_span_code_err,
31};
· · ·
43};
44use rustc_middle::{bug, span_bug};
45use rustc_session::errors::feature_err;
46use rustc_session::lint::builtin::AMBIGUOUS_ASSOCIATED_ITEMS;
47use rustc_span::{DUMMY_SP, Ident, Span, kw, sym};
+ 105 more matches in this file
compiler/rustc_hir_analysis/src/check/check.rs RUST 56 matches · showing 5 view file →
4use rustc_abi::{ExternAbi, FieldIdx, ScalableElt};
5use rustc_data_structures::unord::{UnordMap, UnordSet};
6use rustc_errors::codes::*;
7use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, MultiSpan};
8use rustc_hir as hir;
· · ·
7use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, MultiSpan};
8use rustc_hir as hir;
9use rustc_hir::attrs::ReprAttr::ReprPacked;
· · ·
17use rustc_middle::middle::resolve_bound_vars::ResolvedArg;
18use rustc_middle::middle::stability::EvalResult;
19use rustc_middle::ty::error::TypeErrorToStringExt;
20use rustc_middle::ty::layout::{LayoutError, MAX_SIMD_LANES};
21use rustc_middle::ty::util::Discr;
· · ·
20use rustc_middle::ty::layout::{LayoutError, MAX_SIMD_LANES};
21use rustc_middle::ty::util::Discr;
22use rustc_middle::ty::{
· · ·
27use rustc_span::sym;
28use rustc_target::spec::{AbiMap, AbiMapping};
29use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
30use rustc_trait_selection::traits;
31use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
+ 51 more matches in this file
src/librustdoc/passes/collect_intra_doc_links.rs RUST 54 matches · showing 5 view file →
11use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
12use rustc_data_structures::intern::Interned;
13use rustc_errors::{Applicability, Diag, DiagMessage};
14use rustc_hir::attrs::AttributeKind;
15use rustc_hir::def::Namespace::*;
· · ·
107 }
108
109 /// Used for error reporting.
110 fn disambiguator_suggestion(self) -> Suggestion {
111 let kind = match self {
· · ·
150
151impl TryFrom<ResolveRes> for Res {
152 type Error = ();
153
154 fn try_from(res: ResolveRes) -> Result<Self, ()> {
· · ·
165
166/// The link failed to resolve. [`resolution_failure`] should look to see if there's
167/// a more helpful error that can be given.
168#[derive(Debug)]
169struct UnresolvedPath<'a> {
· · ·
174 /// If part of the link resolved, this has the `Res`.
175 ///
176 /// In `[std::io::Error::x]`, `std::io::Error` would be a partial resolution.
177 partial_res: Option<Res>,
178 /// The remaining unresolved path segments.
+ 49 more matches in this file
compiler/rustc_hir_analysis/src/check/wfcheck.rs RUST 106 matches · showing 5 view file →
6use rustc_ast as ast;
7use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
8use rustc_errors::codes::*;
9use rustc_errors::{Applicability, ErrorGuaranteed, msg, pluralize, struct_span_code_err};
10use rustc_hir as hir;
· · ·
9use rustc_errors::{Applicability, ErrorGuaranteed, msg, pluralize, struct_span_code_err};
10use rustc_hir as hir;
11use rustc_hir::attrs::{EiiDecl, EiiImpl, EiiImplResolution};
· · ·
19use rustc_lint_defs::builtin::SHADOWING_SUPERTRAIT_ITEMS;
20use rustc_macros::Diagnostic;
21use rustc_middle::mir::interpret::ErrorHandled;
22use rustc_middle::traits::solve::NoSolution;
23use rustc_middle::ty::trait_def::TraitSpecializationKind;
· · ·
28};
29use rustc_middle::{bug, span_bug};
30use rustc_session::errors::feature_err;
31use rustc_span::{DUMMY_SP, Span, sym};
32use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
· · ·
32use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
33use rustc_trait_selection::regions::{InferCtxtRegionExt, OutlivesEnvironmentBuildExt};
34use rustc_trait_selection::traits::misc::{
+ 101 more matches in this file
compiler/rustc_trait_selection/src/traits/select/mod.rs RUST 76 matches · showing 5 view file →
11use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
12use rustc_data_structures::stack::ensure_sufficient_stack;
13use rustc_errors::{Diag, EmissionGuarantee};
14use rustc_hir::def_id::DefId;
15use rustc_hir::{self as hir, LangItem, find_attr};
· · ·
24pub use rustc_middle::traits::select::*;
25use rustc_middle::ty::abstract_const::NotConstEvaluatable;
26use rustc_middle::ty::error::TypeErrorToStringExt;
27use rustc_middle::ty::print::{PrintTraitRefExt as _, with_no_trimmed_paths};
28use rustc_middle::ty::{
· · ·
42use super::{
43 ImplDerivedCause, Normalized, Obligation, ObligationCause, ObligationCauseCode,
44 PolyTraitObligation, PredicateObligation, Selection, SelectionError, SelectionResult,
45 TraitQueryMode, const_evaluatable, project, util, wf,
46};
· · ·
47use crate::error_reporting::InferCtxtErrorExt;
48use crate::infer::{InferCtxt, InferOk, TypeFreshener};
49use crate::solve::InferCtxtSelectExt as _;
· · ·
113 /// considered ambiguous because of impls potentially added in other crates.
114 /// This is used in coherence to give improved diagnostics.
115 /// We don't do his until we detect a coherence error because it can
116 /// lead to false overflow results (#47139) and because always
117 /// computing it may negatively impact performance.
+ 71 more matches in this file
compiler/rustc_hir_typeck/src/coercion.rs RUST 100 matches · showing 5 view file →
38use std::ops::{ControlFlow, Deref};
39
40use rustc_errors::codes::*;
41use rustc_errors::{Applicability, Diag, struct_span_code_err};
42use rustc_hir::attrs::InlineAttr;
· · ·
41use rustc_errors::{Applicability, Diag, struct_span_code_err};
42use rustc_hir::attrs::InlineAttr;
43use rustc_hir::def_id::{DefId, LocalDefId};
· · ·
47use rustc_infer::infer::{DefineOpaqueTypes, InferOk, InferResult, RegionVariableOrigin};
48use rustc_infer::traits::{
49 MatchExpressionArmCause, Obligation, PredicateObligation, PredicateObligations, SelectionError,
50};
51use rustc_middle::span_bug;
· · ·
54 PointerCoercion,
55};
56use rustc_middle::ty::error::TypeError;
57use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, Unnormalized};
58use rustc_span::{BytePos, DUMMY_SP, Span};
· · ·
103 to_mutbl: hir::Mutability,
104) -> RelateResult<'tcx, ()> {
105 if from_mutbl >= to_mutbl { Ok(()) } else { Err(TypeError::Mutability) }
106}
107
+ 95 more matches in this file
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.