diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index d75ae850ca33b..29b22c64a2fd3 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -119,6 +119,7 @@ pub(crate) struct ImportSuggestion { /// An extra note that should be issued if this item is suggested pub note: Option, pub is_stable: bool, + pub is_exact_match: bool, } /// Adjust the impl span so that just the `impl` keyword is taken by removing @@ -1360,16 +1361,18 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } } - fn lookup_import_candidates_from_module( + fn lookup_import_candidates_from_module( &self, lookup_ident: Ident, namespace: Namespace, parent_scope: &ParentScope<'ra>, start_module: Module<'ra>, crate_path: ThinVec, + ident_filter_fn: IdentFilterFn, filter_fn: FilterFn, ) -> Vec where + IdentFilterFn: Fn(Ident, Ident) -> bool, FilterFn: Fn(Res) -> bool, { let mut candidates = Vec::new(); @@ -1441,7 +1444,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { // collect results based on the filter function // avoid suggesting anything from the same module in which we are resolving // avoid suggesting anything with a hygienic name - if ident.name == lookup_ident.name + if ident_filter_fn(ident.orig(orig_ident_span), lookup_ident) && ns == namespace && in_module != parent_scope.module && ident.ctxt.is_root() @@ -1521,6 +1524,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { note, via_import, is_stable, + is_exact_match: ident.name == lookup_ident.name, }); } } @@ -1597,6 +1601,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { /// /// N.B., the method does not look into imports, but this is not a problem, /// since we report the definitions (thus, the de-aliased imports). + /// + /// The method is implemented in `lookup_import_candidates_impl`. The `_impl` method allows applying a different filter function on the ident than the exact match function used by default here. pub(crate) fn lookup_import_candidates( &mut self, lookup_ident: Ident, @@ -1606,6 +1612,28 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ) -> Vec where FilterFn: Fn(Res) -> bool, + { + self.lookup_import_candidates_impl( + lookup_ident, + namespace, + parent_scope, + |ident: Ident, lookup_ident: Ident| ident.name == lookup_ident.name, + filter_fn, + ) + } + + /// The actual impl of the `lookup_import_candidates function`. + pub(crate) fn lookup_import_candidates_impl( + &mut self, + lookup_ident: Ident, + namespace: Namespace, + parent_scope: &ParentScope<'ra>, + ident_filter_fn: IdentFilterFn, + filter_fn: FilterFn, + ) -> Vec + where + IdentFilterFn: Fn(Ident, Ident) -> bool, + FilterFn: Fn(Res) -> bool, { let crate_path = thin_vec![ast::PathSegment::from_ident(Ident::with_dummy_span(kw::Crate))]; let mut suggestions = self.lookup_import_candidates_from_module( @@ -1614,6 +1642,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { parent_scope, self.graph_root.to_module(), crate_path, + &ident_filter_fn, &filter_fn, ); @@ -1670,6 +1699,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { parent_scope, crate_root, crate_path, + &ident_filter_fn, &filter_fn, )); } @@ -3552,7 +3582,7 @@ pub(crate) fn import_candidates( ); } -type PathString<'a> = (String, &'a str, Option, &'a Option, bool); +type PathString<'a> = (String, &'a str, Option, &'a Option, bool, bool); /// When an entity with a given name is not available in scope, we search for /// entities with that name in all crates. This method allows outputting the @@ -3588,6 +3618,7 @@ fn show_candidates( c.did.and_then(|did| Some(tcx.source_span(did.as_local()?))), &c.note, c.via_import, + c.is_exact_match, )) } } else { @@ -3597,6 +3628,7 @@ fn show_candidates( c.did.and_then(|did| Some(tcx.source_span(did.as_local()?))), &c.note, c.via_import, + c.is_exact_match, )) } }); @@ -3628,9 +3660,10 @@ fn show_candidates( if !accessible_path_strings.is_empty() { let (determiner, kind, s, name, through) = - if let [(name, descr, _, _, via_import)] = &accessible_path_strings[..] { + if let [(name, descr, _, _, via_import, is_exact_match)] = &accessible_path_strings[..] + { ( - "this", + if *is_exact_match { "this" } else { "this similarly named" }, *descr, "", format!(" `{name}`"), @@ -3641,12 +3674,24 @@ fn show_candidates( // instead of the more generic "items". let kinds = accessible_path_strings .iter() - .map(|(_, descr, _, _, _)| *descr) + .map(|(_, descr, _, _, _, _)| *descr) .collect::>(); let kind = if let Some(kind) = kinds.get_only() { kind } else { "item" }; let s = if kind.ends_with('s') { "es" } else { "s" }; + // we should only suggest case insensitive suggestion if no case sensitive match was found, + // so all the suggestion should have the same is_exact_match value. - ("one of these", kind, s, String::new(), "") + ( + if accessible_path_strings[0].5 { + "one of these" + } else { + "one of these similarly named" + }, + kind, + s, + String::new(), + "", + ) }; let instead = if let Instead::Yes = instead { " instead" } else { "" }; @@ -3740,9 +3785,12 @@ fn show_candidates( { let prefix = if let DiagMode::Pattern = mode { "you might have meant to match on " } else { "" }; - if let [(name, descr, source_span, note, _)] = &inaccessible_path_strings[..] { + if let [(name, descr, source_span, note, _, is_exact_match)] = + &inaccessible_path_strings[..] + { let msg = format!( - "{prefix}{descr} `{name}`{} exists but is inaccessible", + "{prefix}{}{descr} `{name}`{} exists but is inaccessible", + if *is_exact_match { "" } else { "similarly named " }, if let DiagMode::Pattern = mode { ", which" } else { "" } ); @@ -3760,17 +3808,20 @@ fn show_candidates( } else { let descr = inaccessible_path_strings .iter() - .map(|&(_, descr, _, _, _)| descr) + .map(|&(_, descr, _, _, _, _)| descr) .all_equal_value() .unwrap_or("item"); let plural_descr = if descr.ends_with('s') { format!("{descr}es") } else { format!("{descr}s") }; - - let mut msg = format!("{prefix}these {plural_descr} exist but are inaccessible"); + let are_exact_matches = inaccessible_path_strings[0].5; + let mut msg = format!( + "{prefix}these {}{plural_descr} exist but are inaccessible", + if are_exact_matches { "" } else { "similarly named " }, + ); let mut has_colon = false; let mut spans = Vec::new(); - for (name, _, source_span, _, _) in &inaccessible_path_strings { + for (name, _, source_span, _, _, _) in &inaccessible_path_strings { if let Some(source_span) = source_span { let span = tcx.sess.source_map().guess_head_span(*source_span); spans.push((name, span)); diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 58899ffd53ab9..fb48a4fb4fdbd 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -286,7 +286,8 @@ impl RibKind<'_> { #[derive(Debug)] pub(crate) struct Rib<'ra, R = Res> { pub bindings: FxIndexMap, - pub patterns_with_skipped_bindings: UnordMap)>>, + pub patterns_with_skipped_bindings: + UnordMap, Result<(), ErrorGuaranteed>)>>, pub kind: RibKind<'ra>, } @@ -4322,6 +4323,10 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { .or_default() .push(( pat.span, + match rest { + ast::PatFieldsRest::Rest(span) => Some(*span), + _ => None, + }, match rest { ast::PatFieldsRest::Recovered(guar) => Err(*guar), _ => Ok(()), @@ -5631,6 +5636,18 @@ impl<'ast> Visitor<'ast> for ItemInfoCollector<'_, '_, '_> { .filter(|param| matches!(param.kind, ast::GenericParamKind::Lifetime { .. })) .count(); self.r.item_generics_num_lifetimes.insert(def_id, count); + let type_or_const_count = generics + .params + .iter() + .filter(|param| { + matches!( + param.kind, + ast::GenericParamKind::Type { .. } + | ast::GenericParamKind::Const { .. } + ) + }) + .count(); + self.r.item_generics_num_type_or_const_params.insert(def_id, type_or_const_count); } ItemKind::ForeignMod(ForeignMod { items, .. }) => { diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 423c13ff87d37..8906594ea99b1 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -15,8 +15,8 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; use rustc_data_structures::unord::UnordItems; use rustc_errors::codes::*; use rustc_errors::{ - Applicability, Diag, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle, pluralize, - struct_span_code_err, + Applicability, Diag, Diagnostic, ErrorGuaranteed, MultiSpan, SuggestionStyle, Suggestions, + pluralize, struct_span_code_err, }; use rustc_hir as hir; use rustc_hir::def::Namespace::{self, *}; @@ -732,11 +732,25 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { suggested_candidates, ); + self.err_code_special_cases(&mut err, source, path, span); + + let no_suggestion = match &err.suggestions { + Suggestions::Enabled(suggestions) => suggestions.is_empty(), + Suggestions::Sealed(suggestions) => suggestions.is_empty(), + Suggestions::Disabled => false, + }; + if let Some(errcode) = err.code + && errcode.index() == 425 + && candidates.is_empty() + && no_suggestion + { + candidates = self.try_lookup_import_case_insensitive(source, path, following_seg, res); + } + if fallback { // Fallback label. err.span_label(base_error.span, base_error.fallback_label); } - self.err_code_special_cases(&mut err, source, path, span); let module = base_error.module.unwrap_or_else(|| CRATE_DEF_ID.to_def_id()); self.r.find_cfg_stripped(&mut err, &path.last().unwrap().ident.name, module); @@ -879,6 +893,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { let mut suggested_candidates = FxHashSet::default(); // Try to lookup name in more relaxed fashion for better error reporting. let ident = path.last().unwrap().ident; + let ident_filter = &|ident: Ident, ident_lookup: Ident| ident.name == ident_lookup.name; let is_expected = &|res| source.is_expected(res); let ns = source.namespace(); let is_enum_variant = &|res| matches!(res, Res::Def(DefKind::Variant, _)); @@ -886,7 +901,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { let ident_span = path.last().map_or(span, |ident| ident.ident.span); let mut candidates = self .r - .lookup_import_candidates(ident, ns, &self.parent_scope, is_expected) + .lookup_import_candidates_impl(ident, ns, &self.parent_scope, ident_filter, is_expected) .into_iter() .filter(|ImportSuggestion { did, .. }| { match (did, res.and_then(|res| res.opt_def_id())) { @@ -1097,13 +1112,99 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { } } } - if candidates.is_empty() { candidates = self.smart_resolve_partial_mod_path_errors(path, following_seg); } (false, suggested_candidates, candidates) } + /// Based on a subset of try_lookup_relaxed, this looks for import candidates in a case insensitive manner. + /// We do not suggest alternative capitalizations if only one letter long, too many constants can match and it becomes noisy. + fn try_lookup_import_case_insensitive( + &mut self, + source: PathSource<'_, '_, '_>, + path: &[Segment], + following_seg: Option<&Segment>, + res: Option, + ) -> Vec { + let ident = path.last().unwrap().ident; + // we do not suggest alternative capitalizations if only one letter, too many constants can match and it become noisy. + if ident.as_str().len() < 2 { + return Vec::new(); + } + let is_expected = &|res| source.is_expected(res); + let ns = source.namespace(); + + let case_insensitive_filter = |ident: Ident, lookup_ident: Ident| { + ident.as_str().to_lowercase() == lookup_ident.as_str().to_lowercase() + }; + let filter_function = |res: Res| { + if following_seg.is_none() { + is_expected(res) + } else { + matches!(res, Res::Def(DefKind::Mod, _)) + } + }; + let mut case_agnostic_candidates = self + .r + .lookup_import_candidates_impl( + ident, + ns, + &self.parent_scope, + case_insensitive_filter, + filter_function, + ) + .into_iter() + .filter(|ImportSuggestion { did, .. }| { + // If there's a following segment, only keep modules that contain it + if let Some(following) = following_seg { + let Some(did) = did else { return false }; + let Some(module) = self.r.get_module(*did) else { return false }; + let mut found = false; + module.for_each_child(self.r, |_, ident, _, _, _| { + if ident.name == following.ident.name { + found = true; + } + }); + if !found { + return false; + } + } + + // Filter out items that are in the prelude + if let Some(prelude) = self.r.prelude { + if let Some(suggestion_did) = did { + let mut is_in_prelude = false; + prelude.for_each_child(self.r, |_, _, _, _, decl| { + if decl.res().opt_def_id() == Some(*suggestion_did) { + is_in_prelude = true; + } + }); + if is_in_prelude { + return false; + } + } + } + match (did, res.and_then(|res| res.opt_def_id())) { + (Some(suggestion_did), Some(actual_did)) => *suggestion_did != actual_did, + _ => true, + } + }) + .collect::>(); + // Try to filter out intrinsics candidates, as long as we have + // some other candidates to suggest. + let intrinsic_candidates: Vec<_> = case_agnostic_candidates + .extract_if(.., |sugg| { + let path = path_names_to_string(&sugg.path); + path.starts_with("core::intrinsics::") || path.starts_with("std::intrinsics::") + }) + .collect(); + if case_agnostic_candidates.is_empty() { + // Put them back if we have no more candidates to suggest... + case_agnostic_candidates = intrinsic_candidates; + } + return case_agnostic_candidates; + } fn lookup_doc_alias_name(&mut self, path: &[Segment], ns: Namespace) -> Option<(DefId, Ident)> { let find_doc_alias_name = |r: &mut Resolver<'ra, '_>, m: Module<'ra>, item_name: Symbol| { @@ -1266,7 +1367,17 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { let mut fallback = false; let typo_sugg = typo_sugg .to_opt_suggestion() - .filter(|sugg| !suggested_candidates.contains(sugg.candidate.as_str())); + .filter(|sugg| !suggested_candidates.contains(sugg.candidate.as_str())) + // this filters out suggestions that require parameters when no parameter is present + .filter(|sugg| { + if !path.last().is_some_and(|s| s.has_generic_args) { + return true; + } + let Some(def_id) = sugg.res.opt_def_id() else { + return true; + }; + self.r.item_generics_num_type_or_const_params(def_id) > 0 + }); if !self.r.add_typo_suggestion(err, typo_sugg, ident_span) { fallback = true; match self.diag_metadata.current_let_binding { @@ -1546,11 +1657,11 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { { for field in fields { if field.name == segment.ident.name { - if spans.iter().all(|(_, had_error)| had_error.is_err()) { + if spans.iter().all(|(_, _, had_error)| had_error.is_err()) { // This resolution error will likely be fixed by fixing a // syntax error in a pattern, so it is irrelevant to the user. let multispan: MultiSpan = - spans.iter().map(|(s, _)| *s).collect::>().into(); + spans.iter().map(|(s, _, _)| *s).collect::>().into(); err.span_note( multispan, "this pattern had a recovered parse error which likely lost \ @@ -1559,7 +1670,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { err.downgrade_to_delayed_bug(); } let ty = self.r.tcx.item_name(*def_id); - for (span, _) in spans { + for (span, dotdot_span, _) in spans { err.span_label( *span, format!( @@ -1567,6 +1678,14 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { available in `{ty}`", ), ); + if let Some(dotdot_span) = dotdot_span { + err.tool_only_span_suggestion( + *dotdot_span, + format!("include `{field}` in the pattern"), + format!("{field}, .."), + Applicability::MaybeIncorrect, + ); + } } } } @@ -3035,7 +3154,8 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { path_segments.push(ast::PathSegment::from_ident(ident.orig(orig_ident_span))); let doc_visible = doc_visible && (module_def_id.is_local() || !r.tcx.is_doc_hidden(module_def_id)); - if module_def_id == def_id { + let is_exact_match = module_def_id == def_id; + if is_exact_match { let path = Path { span: name_binding.span, segments: path_segments, tokens: None }; result = Some(( @@ -3049,6 +3169,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { note: None, via_import: false, is_stable: true, + is_exact_match, }, )); } else { diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index ffb2181bae3a9..f4593684024dc 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1506,6 +1506,8 @@ pub struct Resolver<'ra, 'tcx> { /// Amount of lifetime parameters for each item in the crate. item_generics_num_lifetimes: FxHashMap = default::fx_hash_map(), + /// Amount of type or const parameters for each item in the crate. + item_generics_num_type_or_const_params: FxHashMap = default::fx_hash_map(), /// Generic args to suggest for required params (e.g. `<'_>`, `<_, _>`), if any. item_required_generic_args_suggestions: FxHashMap = default::fx_hash_map(), delegation_fn_sigs: LocalDefIdMap = Default::default(), @@ -1712,6 +1714,17 @@ impl<'tcx> Resolver<'_, 'tcx> { self.tcx.generics_of(def_id).own_counts().lifetimes } } + // Get count of expected parameters + fn item_generics_num_type_or_const_params(&self, def_id: DefId) -> usize { + if let Some(def_id) = def_id.as_local() { + self.item_generics_num_type_or_const_params.get(&def_id).copied().unwrap_or(0) + } else { + let generics = self.tcx.generics_of(def_id); + let counts = generics.own_counts(); + // saturating_sub may not be strictly necessary, better safe than sorry + counts.types.saturating_sub(generics.has_own_self() as usize) + counts.consts + } + } fn item_required_generic_args_suggestion(&self, def_id: DefId) -> String { if let Some(def_id) = def_id.as_local() { diff --git a/tests/ui/README.md b/tests/ui/README.md index f76cd507056fe..1c162c3c58578 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -814,6 +814,9 @@ Exercises let-else constructs. Exercises of the lexer. +## `tests/ui/libstd-case-typo/` +Tests for import suggestions with typo tolerance. + ## `tests/ui/lifetimes/` Broad directory on lifetimes, including proper specifiers, lifetimes not living long enough, or undeclared lifetime names. diff --git a/tests/ui/cast/cast-errors-issue-43825.stderr b/tests/ui/cast/cast-errors-issue-43825.stderr index 658d5ddbb611c..d0dea3a776371 100644 --- a/tests/ui/cast/cast-errors-issue-43825.stderr +++ b/tests/ui/cast/cast-errors-issue-43825.stderr @@ -3,6 +3,13 @@ error[E0425]: cannot find value `error` in this scope | LL | let error = error; | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named items + | +LL + use std::fmt::Error; + | +LL + use std::fs::TryLockError::Error; + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr index c2df999dc7647..b88ad67145831 100644 --- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr +++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr @@ -10,6 +10,19 @@ LL - pub use v20::{v13, v17}; LL + pub use v20::{v11, v17}; | +error[E0425]: cannot find function `v6` in this scope + --> $DIR/unevaluated-const-ice-119731.rs:13:35 + | +LL | const v0: [[usize; v4]; v4] = v6(v8); + | ^^ not found in this scope + | +help: consider importing one of these similarly named tuple variants + | +LL + use std::net::IpAddr::V6; + | +LL + use std::net::SocketAddr::V6; + | + error[E0425]: cannot find value `v8` in this scope --> $DIR/unevaluated-const-ice-119731.rs:13:38 | @@ -87,12 +100,6 @@ help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable LL + #![feature(min_adt_const_params)] | -error[E0425]: cannot find function `v6` in this scope - --> $DIR/unevaluated-const-ice-119731.rs:13:35 - | -LL | const v0: [[usize; v4]; v4] = v6(v8); - | ^^ not found in this scope - error: maximum number of nodes exceeded in constant v20::v17::::{constant#0} --> $DIR/unevaluated-const-ice-119731.rs:28:37 | diff --git a/tests/ui/const-generics/mgca/unused_speculative_def_id.stderr b/tests/ui/const-generics/mgca/unused_speculative_def_id.stderr index e087e046ec35d..14f80b6b1d71a 100644 --- a/tests/ui/const-generics/mgca/unused_speculative_def_id.stderr +++ b/tests/ui/const-generics/mgca/unused_speculative_def_id.stderr @@ -2,16 +2,7 @@ error[E0425]: cannot find value `ERR` in this scope --> $DIR/unused_speculative_def_id.rs:20:16 | LL | field: A<{ ERR:: }>, - | ^^^ - | - --> $SRC_DIR/core/src/result.rs:LL:COL - | - = note: similarly named tuple variant `Err` defined here -help: a tuple variant with a similar name exists - | -LL - field: A<{ ERR:: }>, -LL + field: A<{ Err:: }>, - | + | ^^^ not found in this scope error: aborting due to 1 previous error diff --git a/tests/ui/coroutine/layout-error.stderr b/tests/ui/coroutine/layout-error.stderr index f3b3843de898c..63ce820f3027c 100644 --- a/tests/ui/coroutine/layout-error.stderr +++ b/tests/ui/coroutine/layout-error.stderr @@ -3,6 +3,11 @@ error[E0425]: cannot find value `Foo` in this scope | LL | let a = Foo; | ^^^ not found in this scope + | +help: consider importing this similarly named function + | +LL + use crate::foo; + | error: aborting due to 1 previous error diff --git a/tests/ui/libstd-case-typo/libstd.rs b/tests/ui/libstd-case-typo/libstd.rs new file mode 100644 index 0000000000000..45463a5467cd9 --- /dev/null +++ b/tests/ui/libstd-case-typo/libstd.rs @@ -0,0 +1,439 @@ +// checks case typos with libstd::alloc structs + +fn test_layout(_x: LayOut){} +//~^ ERROR: cannot find type `LayOut` in this scope +fn test_system(_x: system){} +//~^ ERROR: cannot find type `system` in this scope + +// checks case typos with libstd::any structs + +fn test_typeid(_x: Typeid){} +//~^ ERROR: cannot find type `Typeid` in this scope + +// checks case typos with libstd::ascii structs + +fn test_escapedefault(_x: Escapedefault){} +//~^ ERROR: cannot find type `Escapedefault` in this scope + +// checks case typos with libstd::cell structs + +fn test_cell(_x: cell<()>){} +//~^ ERROR: cannot find type `cell` in this scope + +// checks case typos with libstd::char structs + +fn test_decodeutf16(_x: DecodeUTF16<()>){} +//~^ ERROR: cannot find type `DecodeUTF16` in this scope + +fn test_escapeunicode(_x: Escapeunicode){} +//~^ ERROR: cannot find type `Escapeunicode` in this scope + +fn test_tolowercase(_x: Tolowercase){} +//~^ ERROR: cannot find type `Tolowercase` in this scope + +fn test_touppercase(_x: Touppercase){} +//~^ ERROR: cannot find type `Touppercase` in this scope + +// checks case typos with libstd::cmp structs + +fn test_reverse(_x: reverse<()>){} +//~^ ERROR: cannot find type `reverse` in this scope + +// checks case typos with libstd::collections structs + +fn test_btreemap(_x: BtreeMap<(), ()>){} +//~^ ERROR: cannot find type `BtreeMap` in this scope +fn test_btreeset(_x: BtreeSet<()>){} +//~^ ERROR: cannot find type `BtreeSet` in this scope +fn test_binaryheap(_x: Binaryheap<()>){} +//~^ ERROR: cannot find type `Binaryheap` in this scope +fn test_hashmap(_x: Hashmap){} +//~^ ERROR: cannot find type `Hashmap` in this scope +fn test_hashset(_x: Hashset<()>){} +//~^ ERROR: cannot find type `Hashset` in this scope +fn test_linkedlist(_x: Linkedlist<()>){} +//~^ ERROR: cannot find type `Linkedlist` in this scope +fn test_vecdeque(_x: Vecdeque<()>){} +//~^ ERROR: cannot find type `Vecdeque` in this scope + +// checks case typos with libstd::env structs + +fn test_args(_x: args){} +//~^ ERROR: cannot find type `args` in this scope +fn test_argsos(_x: Argsos){} +//~^ ERROR: cannot find type `Argsos` in this scope +fn test_splitpaths(_x: Splitpaths<'_>){} +//~^ ERROR: cannot find type `Splitpaths` in this scope +fn test_vars(_x: vars){} +//~^ ERROR: cannot find type `vars` in this scope +fn test_varsos(_x: Varsos){} +//~^ ERROR: cannot find type `Varsos` in this scope + +// checks case typos with libstd::ffi structs + +fn test_cstr(_x: cStr){} +//~^ ERROR: cannot find type `cStr` in this scope +fn test_osstr(_x: Osstr){} +//~^ ERROR: cannot find type `Osstr` in this scope +fn test_osstring(_x: Osstring){} +//~^ ERROR: cannot find type `Osstring` in this scope + +// checks case typos with libstd::fmt structs + +fn test_debuglist(_x: Debuglist){} +//~^ ERROR: cannot find type `Debuglist` in this scope +fn test_debugmap(_x: Debugmap){} +//~^ ERROR: cannot find type `Debugmap` in this scope +fn test_debugset(_x: Debugset){} +//~^ ERROR: cannot find type `Debugset` in this scope +fn test_debugstruct(_x: Debugstruct){} +//~^ ERROR: cannot find type `Debugstruct` in this scope +fn test_debugtuple(_x: Debugtuple){} +//~^ ERROR: cannot find type `Debugtuple` in this scope +fn test_fmter(mut _x: formatter){} +//~^ ERROR: cannot find type `formatter` in this scope + +// checks case typos with libstd::fs structs + +fn test_dirbuilder(_x: Dirbuilder){} +//~^ ERROR: cannot find type `Dirbuilder` in this scope +fn test_direntry(_x: Direntry){} +//~^ ERROR: cannot find type `Direntry` in this scope +fn test_filetype(_x: Filetype){} +//~^ ERROR: cannot find type `Filetype` in this scope +fn test_metadata(_x: MetaData){} +//~^ ERROR: cannot find type `MetaData` in this scope +fn test_openoptions(_x: Openoptions){} +//~^ ERROR: cannot find type `Openoptions` in this scope +fn test_permissions(_x: permissions){} +//~^ ERROR: cannot find type `permissions` in this scope +fn test_readdir(_x: Readdir){} +//~^ ERROR: cannot find type `Readdir` in this scope + +// checks case typos with libstd::hash structs + +fn test_buildhasherdefault(_x: BuildhasherDefault){} +//~^ ERROR: cannot find type `BuildhasherDefault` in this scope + +// checks case typos with libstd::io structs + +fn test_bufreader(_x: Bufreader<()>){} +//~^ ERROR: cannot find type `Bufreader` in this scope +fn test_bufwriter(_x: Bufwriter<()>){} +//~^ ERROR: cannot find type `Bufwriter` in this scope +fn test_bytes(_x: bytes<()>){} +//~^ ERROR: cannot find type `bytes` in this scope +fn test_chain(_x: chain<(), ()>){} +//~^ ERROR: cannot find type `chain` in this scope +fn test_cursor(_x: cursor<()>){} +//~^ ERROR: cannot find type `cursor` in this scope +fn test_empty(_x: empty){} +//~^ ERROR: cannot find type `empty` in this scope +fn test_ioslice(_x: Ioslice){} +//~^ ERROR: cannot find type `Ioslice` in this scope +fn test_ioslicemut(_x: IosliceMut){} +//~^ ERROR: cannot find type `IosliceMut` in this scope +fn test_linewriter(_x: Linewriter<()>){} +//~^ ERROR: cannot find type `Linewriter` in this scope +fn test_lines(_x: lines<()>){} +//~^ ERROR: cannot find type `lines` in this scope +fn test_repeat(_x: repeat){} +//~^ ERROR: cannot find type `repeat` in this scope +fn test_sink(_x: sink){} +//~^ ERROR: cannot find type `sink` in this scope +fn test_split(_x: split<()>){} +//~^ ERROR: cannot find type `split` in this scope +fn test_stderr(_x: StdErr){} +//~^ ERROR: cannot find type `StdErr` in this scope +fn test_stderrlock(_x: StdErrLock){} +//~^ ERROR: cannot find type `StdErrLock` in this scope +fn test_stdin(_x: StdIn){} +//~^ ERROR: cannot find type `StdIn` in this scope +fn test_stdinlock(_x: StdInLock){} +//~^ ERROR: cannot find type `StdInLock` in this scope +fn test_stdout(_x: StdOut){} +//~^ ERROR: cannot find type `StdOut` in this scope +fn test_stdoutlock(_x: StdOutLock){} +//~^ ERROR: cannot find type `StdOutLock` in this scope +fn test_take(_x: take){} +//~^ ERROR: cannot find type `take` in this scope + +// checks case typos with libstd::iter structs + +fn test_cloned(_x: cloned<(), ()>){} +//~^ ERROR: cannot find type `cloned` in this scope +fn test_copied(_x: copied<(), ()>){} +//~^ ERROR: cannot find type `copied` in this scope +fn test_cycle(_x: cycle<(), ()>){} +//~^ ERROR: cannot find type `cycle` in this scope +fn test_enumerate(_x: enumerate<(), ()>){} +//~^ ERROR: cannot find type `enumerate` in this scope +fn test_filter(_x: filter<(), ()>){} +//~^ ERROR: cannot find type `filter` in this scope +fn test_filtermap(_x: Filtermap<(), ()>){} +//~^ ERROR: cannot find type `Filtermap` in this scope +fn test_flatten(_x: flatten<()>){} +//~^ ERROR: cannot find type `flatten` in this scope +fn test_fromfn(_x: Fromfn<()>){} +//~^ ERROR: cannot find type `Fromfn` in this scope +fn test_fuse(_x: fuse<()>){} +//~^ ERROR: cannot find type `fuse` in this scope +fn test_inspect(_x: inspect<(), ()>){} +//~^ ERROR: cannot find type `inspect` in this scope +fn test_map(_x: map<(), ()>){} +//~^ ERROR: cannot find type `map` in this scope +fn test_once(_x: once<()>){} +//~^ ERROR: cannot find type `once` in this scope +fn test_oncewith(_x: Oncewith<()>){} +//~^ ERROR: cannot find type `Oncewith` in this scope +fn test_peekable(_x: peekable<()>){} +//~^ ERROR: cannot find type `peekable` in this scope +fn test_repeatwith(_x: Repeatwith<()>){} +//~^ ERROR: cannot find type `Repeatwith` in this scope +fn test_rev(_x: rev<()>){} +//~^ ERROR: cannot find type `rev` in this scope +fn test_scan(_x: scan<(), (), ()>){} +//~^ ERROR: cannot find type `scan` in this scope +fn test_skip(_x: skip<()>){} +//~^ ERROR: cannot find type `skip` in this scope +fn test_skipwhile(_x: Skipwhile<(), ()>){} +//~^ ERROR: cannot find type `Skipwhile` in this scope +fn test_stepby(_x: Stepby<()>){} +//~^ ERROR: cannot find type `Stepby` in this scope +fn test_successors(_x: successors<()>){} +//~^ ERROR: cannot find type `successors` in this scope +fn test_takewhile(_x: Takewhile<(), ()>){} +//~^ ERROR: cannot find type `Takewhile` in this scope +fn test_zip(_x: zip<(), ()>){} +//~^ ERROR: cannot find type `zip` in this scope + +// checks case typos with libstd::marker structs + +fn test_phantomdata(_x: Phantomdata){} +//~^ ERROR: cannot find type `Phantomdata` in this scope +fn test_phantompinned(_x: Phantompinned){} +//~^ ERROR: cannot find type `Phantompinned` in this scope + +// checks case typos with libstd::mem structs + +fn test_discriminant(_x: discriminant<()>){} +//~^ ERROR: cannot find type `discriminant` in this scope +fn test_manuallydrop(_x: Manuallydrop<()>){} +//~^ ERROR: cannot find type `Manuallydrop` in this scope + +// checks case typos with libstd::net structs + +fn test_incoming(_x: incoming){} +//~^ ERROR: cannot find type `incoming` in this scope +fn test_ipv4addr(_x: IPv4Addr){} +//~^ ERROR: cannot find type `IPv4Addr` in this scope +fn test_ipv6addr(_x: IPv6Addr){} +//~^ ERROR: cannot find type `IPv6Addr` in this scope +fn test_socketaddrv4(_x: SocketAddrv4){} +//~^ ERROR: cannot find type `SocketAddrv4` in this scope +fn test_socketaddrv6(_x: SocketAddrv6){} +//~^ ERROR: cannot find type `SocketAddrv6` in this scope +fn test_tcplistener(_x: TCPListener){} +//~^ ERROR: cannot find type `TCPListener` in this scope +fn test_tcpstream(_x: TCPStream){} +//~^ ERROR: cannot find type `TCPStream` in this scope +fn test_udpsocket(_x: UDPSocket){} +//~^ ERROR: cannot find type `UDPSocket` in this scope + +// checks case typos with libstd::num structs + +fn test_nonzeroi8(_x: NonZeroi8){} +//~^ ERROR: cannot find type `NonZeroi8` in this scope +fn test_nonzeroi16(_x: NonZeroi16){} +//~^ ERROR: cannot find type `NonZeroi16` in this scope +fn test_nonzeroi32(_x: NonZeroi32){} +//~^ ERROR: cannot find type `NonZeroi32` in this scope +fn test_nonzeroi64(_x: NonZeroi64){} +//~^ ERROR: cannot find type `NonZeroi64` in this scope +fn test_nonzeroi128(_x: NonZeroi128){} +//~^ ERROR: cannot find type `NonZeroi128` in this scope +fn test_nonzerou8(_x: NonZerou8){} +//~^ ERROR: cannot find type `NonZerou8` in this scope +fn test_nonzerou16(_x: NonZerou16){} +//~^ ERROR: cannot find type `NonZerou16` in this scope +fn test_nonzerou32(_x: NonZerou32){} +//~^ ERROR: cannot find type `NonZerou32` in this scope +fn test_nonzerou64(_x: NonZerou64){} +//~^ ERROR: cannot find type `NonZerou64` in this scope +fn test_nonzerou128(_x: NonZerou128){} +//~^ ERROR: cannot find type `NonZerou128` in this scope +fn test_nonzerousize(_x: NonzeroUsize){} +//~^ ERROR: cannot find type `NonzeroUsize` in this scope +fn test_wrapping(_x: wrapping){} +//~^ ERROR: cannot find type `wrapping` in this scope + +// checks case typos with libstd::ops structs + +fn test_range(_x: range<()>){} +//~^ ERROR: cannot find type `range` in this scope +fn test_rangefrom(_x: Rangefrom<()>){} +//~^ ERROR: cannot find type `Rangefrom` in this scope +fn test_rangefull(_x: Rangefull<()>){} +//~^ ERROR: cannot find type `Rangefull` in this scope +fn test_rangeinclusive(_x: Rangeinclusive<()>){} +//~^ ERROR: cannot find type `Rangeinclusive` in this scope +fn test_rangeto(_x: Rangeto<()>){} +//~^ ERROR: cannot find type `Rangeto` in this scope +fn test_rangetoinclusive(_x: RangetoInclusive<()>){} +//~^ ERROR: cannot find type `RangetoInclusive` in this scope + +// checks case typos with libstd::panic structs + +fn test_assertunwindsafe(_x: AssertUnwindsafe<()>){} +//~^ ERROR: cannot find type `AssertUnwindsafe` in this scope +fn test_location(_x: location<()>){} +//~^ ERROR: cannot find type `location` in this scope +fn test_panicinfo(_x: Panicinfo<()>){} +//~^ ERROR: cannot find type `Panicinfo` in this scope + +// checks case typos with libstd::path structs + +fn test_ancestors(_x: ancestors){} +//~^ ERROR: cannot find type `ancestors` in this scope +fn test_components(_x: components){} +//~^ ERROR: cannot find type `components` in this scope +fn test_pathbuf(_x: Pathbuf){} +//~^ ERROR: cannot find type `Pathbuf` in this scope +fn test_prefixcomponent(_x: Prefixcomponent){} +//~^ ERROR: cannot find type `Prefixcomponent` in this scope + +// checks case typos with libstd::pin structs + +fn test_pin(_x: pin<()>){} +//~^ ERROR: cannot find type `pin` in this scope + +// checks case typos with libstd::process structs + +fn test_child(_x: child){} +//~^ ERROR: cannot find type `child` in this scope +fn test_childstderr(_x: ChildStdErr){} +//~^ ERROR: cannot find type `ChildStdErr` in this scope +fn test_childstdin(_x: ChildStdIn){} +//~^ ERROR: cannot find type `ChildStdIn` in this scope +fn test_childstdout(_x: ChildStdOut){} +//~^ ERROR: cannot find type `ChildStdOut` in this scope +fn test_command(_x: command){} +//~^ ERROR: cannot find type `command` in this scope +fn test_exitstatus(_x: Exitstatus){} +//~^ ERROR: cannot find type `Exitstatus` in this scope +fn test_output(_x: output){} +//~^ ERROR: cannot find type `output` in this scope +fn test_stdio(_x: StdIo){} +//~^ ERROR: cannot find type `StdIo` in this scope + +// checks case typos with libstd::ptr structs + +fn test_nonnull(_x: Nonnull<()>){} +//~^ ERROR: cannot find type `Nonnull` in this scope + +// checks case typos with libstd::rc structs + +fn test_rc(_x: rc<()>){} +//~^ ERROR: cannot find type `rc` in this scope +fn test_weak(_x: weak<()>){} +//~^ ERROR: cannot find type `weak` in this scope + +// checks case typos with libstd::string structs + +fn test_drain(_x: drain){} +//~^ ERROR: cannot find type `drain` in this scope + +// checks case typos with libstd::str structs + +fn test_charindices(_x: Charindices){} +//~^ ERROR: cannot find type `Charindices` in this scope +fn test_chars(_x: chars){} +//~^ ERROR: cannot find type `chars` in this scope +fn test_encodeutf16(_x: EncodeUTF16){} +//~^ ERROR: cannot find type `EncodeUTF16` in this scope +fn test_matchindices(_x: Matchindices){} +//~^ ERROR: cannot find type `Matchindices` in this scope +fn test_rmatchindices(_x: RmatchIndices){} +//~^ ERROR: cannot find type `RmatchIndices` in this scope +fn test_rmatches(_x: Rmatches){} +//~^ ERROR: cannot find type `Rmatches` in this scope +fn test_rsplit(_x: Rsplit){} +//~^ ERROR: cannot find type `Rsplit` in this scope +fn test_rsplitn(_x: RSplitn){} +//~^ ERROR: cannot find type `RSplitn` in this scope +fn test_rsplitterminator(_x: RsplitTerminator){} +//~^ ERROR: cannot find type `RsplitTerminator` in this scope +fn test_splitasciiwhitespace(_x: SplitASCIIWhitespace){} +//~^ ERROR: cannot find type `SplitASCIIWhitespace` in this scope +fn test_splitn(_x: Splitn){} +//~^ ERROR: cannot find type `Splitn` in this scope +fn test_splitterminator(_x: Splitterminator){} +//~^ ERROR: cannot find type `Splitterminator` in this scope +fn test_splitwhitespace(_x: Splitwhitespace){} +//~^ ERROR: cannot find type `Splitwhitespace` in this scope + +// checks case typos with libstd::sync structs + +fn test_arc(_x: arc<()>){} +//~^ ERROR: cannot find type `arc` in this scope +fn test_barrier(_x: barrier<()>){} +//~^ ERROR: cannot find type `barrier` in this scope +fn test_barrierwaitresult(_x: BarrierwaitResult<()>){} +//~^ ERROR: cannot find type `BarrierwaitResult` in this scope +fn test_condvar(_x: CondVar<()>){} +//~^ ERROR: cannot find type `CondVar` in this scope +fn test_mutex(_x: mutex<()>){} +//~^ ERROR: cannot find type `mutex` in this scope +fn test_mutexguard(_x: Mutexguard<()>){} +//~^ ERROR: cannot find type `Mutexguard` in this scope +fn test_rwlock(_x: RWlock<()>){} +//~^ ERROR: cannot find type `RWlock` in this scope +fn test_rwlockreadguard(_x: RWlockReadGuard<()>){} +//~^ ERROR: cannot find type `RWlockReadGuard` in this scope +fn test_rwlockwriteguard(_x: RWlockWriteGuard<()>){} +//~^ ERROR: cannot find type `RWlockWriteGuard` in this scope +fn test_waittimeoutresult(_x: WaittimeoutResult<()>){} +//~^ ERROR: cannot find type `WaittimeoutResult` in this scope + +// checks case typos with libstd::task structs + +fn test_context(_x: context){} +//~^ ERROR: cannot find type `context` in this scope +fn test_rawwaker(_x: Rawwaker){} +//~^ ERROR: cannot find type `Rawwaker` in this scope +fn test_rawwakervtable(_x: RawwakerVTable){} +//~^ ERROR: cannot find type `RawwakerVTable` in this scope +fn test_waker(_x: waker){} +//~^ ERROR: cannot find type `waker` in this scope + +// checks case typos with libstd::thread structs + +fn test_builder(_x: builder){} +//~^ ERROR: cannot find type `builder` in this scope +fn test_joinhandle(_x: Joinhandle<()>){} +//~^ ERROR: cannot find type `Joinhandle` in this scope +fn test_localkey(_x: Localkey<()>){} +//~^ ERROR: cannot find type `Localkey` in this scope +fn test_thread(_x: thread){} +//~^ ERROR: cannot find type `thread` in this scope +fn test_threadid(_x: ThreadID){} +//~^ ERROR: cannot find type `ThreadID` in this scope + +// checks case typos with libstd::time structs + +fn test_duration(_x: duration){} +//~^ ERROR: cannot find type `duration` in this scope +fn test_instant(_x: instant){} +//~^ ERROR: cannot find type `instant` in this scope +fn test_systemtime(_x: Systemtime){} +//~^ ERROR: cannot find type `Systemtime` in this scope + +fn test_systemtime2(_x: SystemTime){} +//~^ ERROR: cannot find type `SystemTime` in this scope + +struct SystemTome{} +mod st{ + struct SystemTame{} +} + +fn main(){} diff --git a/tests/ui/libstd-case-typo/libstd.stderr b/tests/ui/libstd-case-typo/libstd.stderr new file mode 100644 index 0000000000000..72590e5c78d5e --- /dev/null +++ b/tests/ui/libstd-case-typo/libstd.stderr @@ -0,0 +1,1939 @@ +error[E0425]: cannot find type `LayOut` in this scope + --> $DIR/libstd.rs:3:20 + | +LL | fn test_layout(_x: LayOut){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::alloc::Layout; + | + +error[E0425]: cannot find type `system` in this scope + --> $DIR/libstd.rs:5:20 + | +LL | fn test_system(_x: system){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::alloc::System; + | + +error[E0425]: cannot find type `Typeid` in this scope + --> $DIR/libstd.rs:10:20 + | +LL | fn test_typeid(_x: Typeid){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::any::TypeId; + | + +error[E0425]: cannot find type `Escapedefault` in this scope + --> $DIR/libstd.rs:15:27 + | +LL | fn test_escapedefault(_x: Escapedefault){} + | ^^^^^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::ascii::EscapeDefault; + | +LL + use std::char::EscapeDefault; + | +LL + use std::str::EscapeDefault; + | + +error[E0425]: cannot find type `cell` in this scope + --> $DIR/libstd.rs:20:18 + | +LL | fn test_cell(_x: cell<()>){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::cell::Cell; + | + +error[E0425]: cannot find type `DecodeUTF16` in this scope + --> $DIR/libstd.rs:25:25 + | +LL | fn test_decodeutf16(_x: DecodeUTF16<()>){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::char::DecodeUtf16; + | + +error[E0425]: cannot find type `Escapeunicode` in this scope + --> $DIR/libstd.rs:28:27 + | +LL | fn test_escapeunicode(_x: Escapeunicode){} + | ^^^^^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::char::EscapeUnicode; + | +LL + use std::str::EscapeUnicode; + | + +error[E0425]: cannot find type `Tolowercase` in this scope + --> $DIR/libstd.rs:31:25 + | +LL | fn test_tolowercase(_x: Tolowercase){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::char::ToLowercase; + | + +error[E0425]: cannot find type `Touppercase` in this scope + --> $DIR/libstd.rs:34:25 + | +LL | fn test_touppercase(_x: Touppercase){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::char::ToUppercase; + | + +error[E0425]: cannot find type `reverse` in this scope + --> $DIR/libstd.rs:39:21 + | +LL | fn test_reverse(_x: reverse<()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::cmp::Reverse; + | + +error[E0425]: cannot find type `BtreeMap` in this scope + --> $DIR/libstd.rs:44:22 + | +LL | fn test_btreemap(_x: BtreeMap<(), ()>){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::collections::BTreeMap; + | + +error[E0425]: cannot find type `BtreeSet` in this scope + --> $DIR/libstd.rs:46:22 + | +LL | fn test_btreeset(_x: BtreeSet<()>){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::collections::BTreeSet; + | + +error[E0425]: cannot find type `Binaryheap` in this scope + --> $DIR/libstd.rs:48:24 + | +LL | fn test_binaryheap(_x: Binaryheap<()>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::collections::BinaryHeap; + | + +error[E0425]: cannot find type `Hashmap` in this scope + --> $DIR/libstd.rs:50:21 + | +LL | fn test_hashmap(_x: Hashmap){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::collections::HashMap; + | + +error[E0425]: cannot find type `Hashset` in this scope + --> $DIR/libstd.rs:52:21 + | +LL | fn test_hashset(_x: Hashset<()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::collections::HashSet; + | + +error[E0425]: cannot find type `Linkedlist` in this scope + --> $DIR/libstd.rs:54:24 + | +LL | fn test_linkedlist(_x: Linkedlist<()>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::collections::LinkedList; + | + +error[E0425]: cannot find type `Vecdeque` in this scope + --> $DIR/libstd.rs:56:22 + | +LL | fn test_vecdeque(_x: Vecdeque<()>){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::collections::VecDeque; + | + +error[E0425]: cannot find type `args` in this scope + --> $DIR/libstd.rs:61:18 + | +LL | fn test_args(_x: args){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::env::Args; + | + +error[E0425]: cannot find type `Argsos` in this scope + --> $DIR/libstd.rs:63:20 + | +LL | fn test_argsos(_x: Argsos){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::env::ArgsOs; + | + +error[E0425]: cannot find type `Splitpaths` in this scope + --> $DIR/libstd.rs:65:24 + | +LL | fn test_splitpaths(_x: Splitpaths<'_>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::env::SplitPaths; + | + +error[E0425]: cannot find type `vars` in this scope + --> $DIR/libstd.rs:67:18 + | +LL | fn test_vars(_x: vars){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::env::Vars; + | + +error[E0425]: cannot find type `Varsos` in this scope + --> $DIR/libstd.rs:69:20 + | +LL | fn test_varsos(_x: Varsos){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::env::VarsOs; + | + +error[E0425]: cannot find type `cStr` in this scope + --> $DIR/libstd.rs:74:18 + | +LL | fn test_cstr(_x: cStr){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::ffi::CStr; + | + +error[E0425]: cannot find type `Osstr` in this scope + --> $DIR/libstd.rs:76:19 + | +LL | fn test_osstr(_x: Osstr){} + | ^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::ffi::OsStr; + | + +error[E0425]: cannot find type `Osstring` in this scope + --> $DIR/libstd.rs:78:22 + | +LL | fn test_osstring(_x: Osstring){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::ffi::OsString; + | + +error[E0425]: cannot find type `Debuglist` in this scope + --> $DIR/libstd.rs:83:23 + | +LL | fn test_debuglist(_x: Debuglist){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fmt::DebugList; + | + +error[E0425]: cannot find type `Debugmap` in this scope + --> $DIR/libstd.rs:85:22 + | +LL | fn test_debugmap(_x: Debugmap){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fmt::DebugMap; + | + +error[E0425]: cannot find type `Debugset` in this scope + --> $DIR/libstd.rs:87:22 + | +LL | fn test_debugset(_x: Debugset){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fmt::DebugSet; + | + +error[E0425]: cannot find type `Debugstruct` in this scope + --> $DIR/libstd.rs:89:25 + | +LL | fn test_debugstruct(_x: Debugstruct){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fmt::DebugStruct; + | + +error[E0425]: cannot find type `Debugtuple` in this scope + --> $DIR/libstd.rs:91:24 + | +LL | fn test_debugtuple(_x: Debugtuple){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fmt::DebugTuple; + | + +error[E0425]: cannot find type `formatter` in this scope + --> $DIR/libstd.rs:93:23 + | +LL | fn test_fmter(mut _x: formatter){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fmt::Formatter; + | + +error[E0425]: cannot find type `Dirbuilder` in this scope + --> $DIR/libstd.rs:98:24 + | +LL | fn test_dirbuilder(_x: Dirbuilder){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fs::DirBuilder; + | + +error[E0425]: cannot find type `Direntry` in this scope + --> $DIR/libstd.rs:100:22 + | +LL | fn test_direntry(_x: Direntry){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fs::DirEntry; + | + +error[E0425]: cannot find type `Filetype` in this scope + --> $DIR/libstd.rs:102:22 + | +LL | fn test_filetype(_x: Filetype){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fs::FileType; + | + +error[E0425]: cannot find type `MetaData` in this scope + --> $DIR/libstd.rs:104:22 + | +LL | fn test_metadata(_x: MetaData){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fs::Metadata; + | + +error[E0425]: cannot find type `Openoptions` in this scope + --> $DIR/libstd.rs:106:25 + | +LL | fn test_openoptions(_x: Openoptions){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fs::OpenOptions; + | + +error[E0425]: cannot find type `permissions` in this scope + --> $DIR/libstd.rs:108:25 + | +LL | fn test_permissions(_x: permissions){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fs::Permissions; + | + +error[E0425]: cannot find type `Readdir` in this scope + --> $DIR/libstd.rs:110:21 + | +LL | fn test_readdir(_x: Readdir){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::fs::ReadDir; + | + +error[E0425]: cannot find type `BuildhasherDefault` in this scope + --> $DIR/libstd.rs:115:32 + | +LL | fn test_buildhasherdefault(_x: BuildhasherDefault){} + | ^^^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::hash::BuildHasherDefault; + | + +error[E0425]: cannot find type `Bufreader` in this scope + --> $DIR/libstd.rs:120:23 + | +LL | fn test_bufreader(_x: Bufreader<()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::BufReader; + | + +error[E0425]: cannot find type `Bufwriter` in this scope + --> $DIR/libstd.rs:122:23 + | +LL | fn test_bufwriter(_x: Bufwriter<()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::BufWriter; + | + +error[E0425]: cannot find type `bytes` in this scope + --> $DIR/libstd.rs:124:19 + | +LL | fn test_bytes(_x: bytes<()>){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::io::Bytes; + | +LL + use std::str::Bytes; + | + +error[E0425]: cannot find type `chain` in this scope + --> $DIR/libstd.rs:126:19 + | +LL | fn test_chain(_x: chain<(), ()>){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::io::Chain; + | +LL + use std::iter::Chain; + | + +error[E0425]: cannot find type `cursor` in this scope + --> $DIR/libstd.rs:128:20 + | +LL | fn test_cursor(_x: cursor<()>){} + | ^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::collections::btree_map::Cursor; + | +LL + use std::collections::btree_set::Cursor; + | +LL + use std::collections::linked_list::Cursor; + | +LL + use std::io::Cursor; + | + +error[E0425]: cannot find type `empty` in this scope + --> $DIR/libstd.rs:130:19 + | +LL | fn test_empty(_x: empty){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::io::Empty; + | +LL + use std::iter::Empty; + | + +error[E0425]: cannot find type `Ioslice` in this scope + --> $DIR/libstd.rs:132:21 + | +LL | fn test_ioslice(_x: Ioslice){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::IoSlice; + | + +error[E0425]: cannot find type `IosliceMut` in this scope + --> $DIR/libstd.rs:134:24 + | +LL | fn test_ioslicemut(_x: IosliceMut){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::IoSliceMut; + | + +error[E0425]: cannot find type `Linewriter` in this scope + --> $DIR/libstd.rs:136:24 + | +LL | fn test_linewriter(_x: Linewriter<()>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::LineWriter; + | + +error[E0425]: cannot find type `lines` in this scope + --> $DIR/libstd.rs:138:19 + | +LL | fn test_lines(_x: lines<()>){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::io::Lines; + | +LL + use std::str::Lines; + | + +error[E0425]: cannot find type `repeat` in this scope + --> $DIR/libstd.rs:140:20 + | +LL | fn test_repeat(_x: repeat){} + | ^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::io::Repeat; + | +LL + use std::iter::Repeat; + | + +error[E0425]: cannot find type `sink` in this scope + --> $DIR/libstd.rs:142:18 + | +LL | fn test_sink(_x: sink){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::Sink; + | + +error[E0425]: cannot find type `split` in this scope + --> $DIR/libstd.rs:144:19 + | +LL | fn test_split(_x: split<()>){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::io::Split; + | +LL + use std::slice::Split; + | +LL + use std::str::Split; + | + +error[E0425]: cannot find type `StdErr` in this scope + --> $DIR/libstd.rs:146:20 + | +LL | fn test_stderr(_x: StdErr){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::Stderr; + | + +error[E0425]: cannot find type `StdErrLock` in this scope + --> $DIR/libstd.rs:148:24 + | +LL | fn test_stderrlock(_x: StdErrLock){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::StderrLock; + | + +error[E0425]: cannot find type `StdIn` in this scope + --> $DIR/libstd.rs:150:19 + | +LL | fn test_stdin(_x: StdIn){} + | ^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::Stdin; + | + +error[E0425]: cannot find type `StdInLock` in this scope + --> $DIR/libstd.rs:152:23 + | +LL | fn test_stdinlock(_x: StdInLock){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::StdinLock; + | + +error[E0425]: cannot find type `StdOut` in this scope + --> $DIR/libstd.rs:154:20 + | +LL | fn test_stdout(_x: StdOut){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::Stdout; + | + +error[E0425]: cannot find type `StdOutLock` in this scope + --> $DIR/libstd.rs:156:24 + | +LL | fn test_stdoutlock(_x: StdOutLock){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::io::StdoutLock; + | + +error[E0425]: cannot find type `take` in this scope + --> $DIR/libstd.rs:158:18 + | +LL | fn test_take(_x: take){} + | ^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::io::Take; + | +LL + use std::iter::Take; + | + +error[E0425]: cannot find type `cloned` in this scope + --> $DIR/libstd.rs:163:20 + | +LL | fn test_cloned(_x: cloned<(), ()>){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Cloned; + | + +error[E0425]: cannot find type `copied` in this scope + --> $DIR/libstd.rs:165:20 + | +LL | fn test_copied(_x: copied<(), ()>){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Copied; + | + +error[E0425]: cannot find type `cycle` in this scope + --> $DIR/libstd.rs:167:19 + | +LL | fn test_cycle(_x: cycle<(), ()>){} + | ^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Cycle; + | + +error[E0425]: cannot find type `enumerate` in this scope + --> $DIR/libstd.rs:169:23 + | +LL | fn test_enumerate(_x: enumerate<(), ()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Enumerate; + | + +error[E0425]: cannot find type `filter` in this scope + --> $DIR/libstd.rs:171:20 + | +LL | fn test_filter(_x: filter<(), ()>){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Filter; + | + +error[E0425]: cannot find type `Filtermap` in this scope + --> $DIR/libstd.rs:173:23 + | +LL | fn test_filtermap(_x: Filtermap<(), ()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::FilterMap; + | + +error[E0425]: cannot find type `flatten` in this scope + --> $DIR/libstd.rs:175:21 + | +LL | fn test_flatten(_x: flatten<()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Flatten; + | + +error[E0425]: cannot find type `Fromfn` in this scope + --> $DIR/libstd.rs:177:20 + | +LL | fn test_fromfn(_x: Fromfn<()>){} + | ^^^^^^ + | + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | + = note: similarly named trait `From` defined here +help: a trait with a similar name exists + | +LL - fn test_fromfn(_x: Fromfn<()>){} +LL + fn test_fromfn(_x: From<()>){} + | + +error[E0425]: cannot find type `fuse` in this scope + --> $DIR/libstd.rs:179:18 + | +LL | fn test_fuse(_x: fuse<()>){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Fuse; + | + +error[E0425]: cannot find type `inspect` in this scope + --> $DIR/libstd.rs:181:21 + | +LL | fn test_inspect(_x: inspect<(), ()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Inspect; + | + +error[E0425]: cannot find type `map` in this scope + --> $DIR/libstd.rs:183:17 + | +LL | fn test_map(_x: map<(), ()>){} + | ^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Map; + | + +error[E0425]: cannot find type `once` in this scope + --> $DIR/libstd.rs:185:18 + | +LL | fn test_once(_x: once<()>){} + | ^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::iter::Once; + | +LL + use std::sync::Once; + | + +error[E0425]: cannot find type `Oncewith` in this scope + --> $DIR/libstd.rs:187:22 + | +LL | fn test_oncewith(_x: Oncewith<()>){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::OnceWith; + | + +error[E0425]: cannot find type `peekable` in this scope + --> $DIR/libstd.rs:189:22 + | +LL | fn test_peekable(_x: peekable<()>){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Peekable; + | + +error[E0425]: cannot find type `Repeatwith` in this scope + --> $DIR/libstd.rs:191:24 + | +LL | fn test_repeatwith(_x: Repeatwith<()>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::RepeatWith; + | + +error[E0425]: cannot find type `rev` in this scope + --> $DIR/libstd.rs:193:17 + | +LL | fn test_rev(_x: rev<()>){} + | ^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Rev; + | + +error[E0425]: cannot find type `scan` in this scope + --> $DIR/libstd.rs:195:18 + | +LL | fn test_scan(_x: scan<(), (), ()>){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Scan; + | + +error[E0425]: cannot find type `skip` in this scope + --> $DIR/libstd.rs:197:18 + | +LL | fn test_skip(_x: skip<()>){} + | ^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Skip; + | + +error[E0425]: cannot find type `Skipwhile` in this scope + --> $DIR/libstd.rs:199:23 + | +LL | fn test_skipwhile(_x: Skipwhile<(), ()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::SkipWhile; + | + +error[E0425]: cannot find type `Stepby` in this scope + --> $DIR/libstd.rs:201:20 + | +LL | fn test_stepby(_x: Stepby<()>){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::StepBy; + | + +error[E0425]: cannot find type `successors` in this scope + --> $DIR/libstd.rs:203:24 + | +LL | fn test_successors(_x: successors<()>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Successors; + | + +error[E0425]: cannot find type `Takewhile` in this scope + --> $DIR/libstd.rs:205:23 + | +LL | fn test_takewhile(_x: Takewhile<(), ()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::TakeWhile; + | + +error[E0425]: cannot find type `zip` in this scope + --> $DIR/libstd.rs:207:17 + | +LL | fn test_zip(_x: zip<(), ()>){} + | ^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::iter::Zip; + | + +error[E0425]: cannot find type `Phantomdata` in this scope + --> $DIR/libstd.rs:212:25 + | +LL | fn test_phantomdata(_x: Phantomdata){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::marker::PhantomData; + | + +error[E0425]: cannot find type `Phantompinned` in this scope + --> $DIR/libstd.rs:214:27 + | +LL | fn test_phantompinned(_x: Phantompinned){} + | ^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::marker::PhantomPinned; + | + +error[E0425]: cannot find type `discriminant` in this scope + --> $DIR/libstd.rs:219:26 + | +LL | fn test_discriminant(_x: discriminant<()>){} + | ^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::mem::Discriminant; + | + +error[E0425]: cannot find type `Manuallydrop` in this scope + --> $DIR/libstd.rs:221:26 + | +LL | fn test_manuallydrop(_x: Manuallydrop<()>){} + | ^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::mem::ManuallyDrop; + | + +error[E0425]: cannot find type `incoming` in this scope + --> $DIR/libstd.rs:226:22 + | +LL | fn test_incoming(_x: incoming){} + | ^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::net::Incoming; + | +LL + use std::os::unix::net::Incoming; + | + +error[E0425]: cannot find type `IPv4Addr` in this scope + --> $DIR/libstd.rs:228:22 + | +LL | fn test_ipv4addr(_x: IPv4Addr){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::net::Ipv4Addr; + | + +error[E0425]: cannot find type `IPv6Addr` in this scope + --> $DIR/libstd.rs:230:22 + | +LL | fn test_ipv6addr(_x: IPv6Addr){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::net::Ipv6Addr; + | + +error[E0425]: cannot find type `SocketAddrv4` in this scope + --> $DIR/libstd.rs:232:26 + | +LL | fn test_socketaddrv4(_x: SocketAddrv4){} + | ^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::net::SocketAddrV4; + | + +error[E0425]: cannot find type `SocketAddrv6` in this scope + --> $DIR/libstd.rs:234:26 + | +LL | fn test_socketaddrv6(_x: SocketAddrv6){} + | ^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::net::SocketAddrV6; + | + +error[E0425]: cannot find type `TCPListener` in this scope + --> $DIR/libstd.rs:236:25 + | +LL | fn test_tcplistener(_x: TCPListener){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::net::TcpListener; + | + +error[E0425]: cannot find type `TCPStream` in this scope + --> $DIR/libstd.rs:238:23 + | +LL | fn test_tcpstream(_x: TCPStream){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::net::TcpStream; + | + +error[E0425]: cannot find type `UDPSocket` in this scope + --> $DIR/libstd.rs:240:23 + | +LL | fn test_udpsocket(_x: UDPSocket){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::net::UdpSocket; + | + +error[E0425]: cannot find type `NonZeroi8` in this scope + --> $DIR/libstd.rs:245:23 + | +LL | fn test_nonzeroi8(_x: NonZeroi8){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroI8; + | + +error[E0425]: cannot find type `NonZeroi16` in this scope + --> $DIR/libstd.rs:247:24 + | +LL | fn test_nonzeroi16(_x: NonZeroi16){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroI16; + | + +error[E0425]: cannot find type `NonZeroi32` in this scope + --> $DIR/libstd.rs:249:24 + | +LL | fn test_nonzeroi32(_x: NonZeroi32){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroI32; + | + +error[E0425]: cannot find type `NonZeroi64` in this scope + --> $DIR/libstd.rs:251:24 + | +LL | fn test_nonzeroi64(_x: NonZeroi64){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroI64; + | + +error[E0425]: cannot find type `NonZeroi128` in this scope + --> $DIR/libstd.rs:253:25 + | +LL | fn test_nonzeroi128(_x: NonZeroi128){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroI128; + | + +error[E0425]: cannot find type `NonZerou8` in this scope + --> $DIR/libstd.rs:255:23 + | +LL | fn test_nonzerou8(_x: NonZerou8){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroU8; + | + +error[E0425]: cannot find type `NonZerou16` in this scope + --> $DIR/libstd.rs:257:24 + | +LL | fn test_nonzerou16(_x: NonZerou16){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroU16; + | + +error[E0425]: cannot find type `NonZerou32` in this scope + --> $DIR/libstd.rs:259:24 + | +LL | fn test_nonzerou32(_x: NonZerou32){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroU32; + | + +error[E0425]: cannot find type `NonZerou64` in this scope + --> $DIR/libstd.rs:261:24 + | +LL | fn test_nonzerou64(_x: NonZerou64){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroU64; + | + +error[E0425]: cannot find type `NonZerou128` in this scope + --> $DIR/libstd.rs:263:25 + | +LL | fn test_nonzerou128(_x: NonZerou128){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroU128; + | + +error[E0425]: cannot find type `NonzeroUsize` in this scope + --> $DIR/libstd.rs:265:26 + | +LL | fn test_nonzerousize(_x: NonzeroUsize){} + | ^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::num::NonZeroUsize; + | + +error[E0425]: cannot find type `wrapping` in this scope + --> $DIR/libstd.rs:267:22 + | +LL | fn test_wrapping(_x: wrapping){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::num::Wrapping; + | + +error[E0425]: cannot find type `range` in this scope + --> $DIR/libstd.rs:272:19 + | +LL | fn test_range(_x: range<()>){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::collections::btree_map::Range; + | +LL + use std::collections::btree_set::Range; + | +LL + use std::ops::Range; + | +LL + use std::range::Range; + | + +error[E0425]: cannot find type `Rangefrom` in this scope + --> $DIR/libstd.rs:274:23 + | +LL | fn test_rangefrom(_x: Rangefrom<()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::ops::RangeFrom; + | +LL + use std::range::RangeFrom; + | + +error[E0425]: cannot find type `Rangefull` in this scope + --> $DIR/libstd.rs:276:23 + | +LL | fn test_rangefull(_x: Rangefull<()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::ops::RangeFull; + | + +error[E0425]: cannot find type `Rangeinclusive` in this scope + --> $DIR/libstd.rs:278:28 + | +LL | fn test_rangeinclusive(_x: Rangeinclusive<()>){} + | ^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::ops::RangeInclusive; + | +LL + use std::range::RangeInclusive; + | + +error[E0425]: cannot find type `Rangeto` in this scope + --> $DIR/libstd.rs:280:21 + | +LL | fn test_rangeto(_x: Rangeto<()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::ops::RangeTo; + | + +error[E0425]: cannot find type `RangetoInclusive` in this scope + --> $DIR/libstd.rs:282:30 + | +LL | fn test_rangetoinclusive(_x: RangetoInclusive<()>){} + | ^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::ops::RangeToInclusive; + | +LL + use std::range::RangeToInclusive; + | + +error[E0425]: cannot find type `AssertUnwindsafe` in this scope + --> $DIR/libstd.rs:287:30 + | +LL | fn test_assertunwindsafe(_x: AssertUnwindsafe<()>){} + | ^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::panic::AssertUnwindSafe; + | + +error[E0425]: cannot find type `location` in this scope + --> $DIR/libstd.rs:289:22 + | +LL | fn test_location(_x: location<()>){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::panic::Location; + | + +error[E0425]: cannot find type `Panicinfo` in this scope + --> $DIR/libstd.rs:291:23 + | +LL | fn test_panicinfo(_x: Panicinfo<()>){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named type alias + | +LL + use std::panic::PanicInfo; + | + +error[E0425]: cannot find type `ancestors` in this scope + --> $DIR/libstd.rs:296:23 + | +LL | fn test_ancestors(_x: ancestors){} + | ^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::path::Ancestors; + | + +error[E0425]: cannot find type `components` in this scope + --> $DIR/libstd.rs:298:24 + | +LL | fn test_components(_x: components){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::path::Components; + | + +error[E0425]: cannot find type `Pathbuf` in this scope + --> $DIR/libstd.rs:300:21 + | +LL | fn test_pathbuf(_x: Pathbuf){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::path::PathBuf; + | + +error[E0425]: cannot find type `Prefixcomponent` in this scope + --> $DIR/libstd.rs:302:29 + | +LL | fn test_prefixcomponent(_x: Prefixcomponent){} + | ^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::path::PrefixComponent; + | + +error[E0425]: cannot find type `pin` in this scope + --> $DIR/libstd.rs:307:17 + | +LL | fn test_pin(_x: pin<()>){} + | ^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::pin::Pin; + | + +error[E0425]: cannot find type `child` in this scope + --> $DIR/libstd.rs:312:19 + | +LL | fn test_child(_x: child){} + | ^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::Child; + | + +error[E0425]: cannot find type `ChildStdErr` in this scope + --> $DIR/libstd.rs:314:25 + | +LL | fn test_childstderr(_x: ChildStdErr){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::ChildStderr; + | + +error[E0425]: cannot find type `ChildStdIn` in this scope + --> $DIR/libstd.rs:316:24 + | +LL | fn test_childstdin(_x: ChildStdIn){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::ChildStdin; + | + +error[E0425]: cannot find type `ChildStdOut` in this scope + --> $DIR/libstd.rs:318:25 + | +LL | fn test_childstdout(_x: ChildStdOut){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::ChildStdout; + | + +error[E0425]: cannot find type `command` in this scope + --> $DIR/libstd.rs:320:21 + | +LL | fn test_command(_x: command){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::Command; + | + +error[E0425]: cannot find type `Exitstatus` in this scope + --> $DIR/libstd.rs:322:24 + | +LL | fn test_exitstatus(_x: Exitstatus){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::ExitStatus; + | + +error[E0425]: cannot find type `output` in this scope + --> $DIR/libstd.rs:324:20 + | +LL | fn test_output(_x: output){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::Output; + | + +error[E0425]: cannot find type `StdIo` in this scope + --> $DIR/libstd.rs:326:19 + | +LL | fn test_stdio(_x: StdIo){} + | ^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::process::Stdio; + | + +error[E0425]: cannot find type `Nonnull` in this scope + --> $DIR/libstd.rs:331:21 + | +LL | fn test_nonnull(_x: Nonnull<()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::ptr::NonNull; + | + +error[E0425]: cannot find type `rc` in this scope + --> $DIR/libstd.rs:336:16 + | +LL | fn test_rc(_x: rc<()>){} + | ^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::rc::Rc; + | + +error[E0425]: cannot find type `weak` in this scope + --> $DIR/libstd.rs:338:18 + | +LL | fn test_weak(_x: weak<()>){} + | ^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::rc::Weak; + | +LL + use std::sync::Weak; + | + +error[E0425]: cannot find type `drain` in this scope + --> $DIR/libstd.rs:343:19 + | +LL | fn test_drain(_x: drain){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::collections::binary_heap::Drain; + | +LL + use std::collections::hash_map::Drain; + | +LL + use std::collections::hash_set::Drain; + | +LL + use std::collections::vec_deque::Drain; + | + = and 2 other candidates + +error[E0425]: cannot find type `Charindices` in this scope + --> $DIR/libstd.rs:348:25 + | +LL | fn test_charindices(_x: Charindices){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::CharIndices; + | + +error[E0425]: cannot find type `chars` in this scope + --> $DIR/libstd.rs:350:19 + | +LL | fn test_chars(_x: chars){} + | ^^^^^ + | +help: a builtin type with a similar name exists + | +LL - fn test_chars(_x: chars){} +LL + fn test_chars(_x: char){} + | + +error[E0425]: cannot find type `EncodeUTF16` in this scope + --> $DIR/libstd.rs:352:25 + | +LL | fn test_encodeutf16(_x: EncodeUTF16){} + | ^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::EncodeUtf16; + | + +error[E0425]: cannot find type `Matchindices` in this scope + --> $DIR/libstd.rs:354:26 + | +LL | fn test_matchindices(_x: Matchindices){} + | ^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::MatchIndices; + | + +error[E0425]: cannot find type `RmatchIndices` in this scope + --> $DIR/libstd.rs:356:27 + | +LL | fn test_rmatchindices(_x: RmatchIndices){} + | ^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::RMatchIndices; + | + +error[E0425]: cannot find type `Rmatches` in this scope + --> $DIR/libstd.rs:358:22 + | +LL | fn test_rmatches(_x: Rmatches){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::RMatches; + | + +error[E0425]: cannot find type `Rsplit` in this scope + --> $DIR/libstd.rs:360:20 + | +LL | fn test_rsplit(_x: Rsplit){} + | ^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::slice::RSplit; + | +LL + use std::str::RSplit; + | + +error[E0425]: cannot find type `RSplitn` in this scope + --> $DIR/libstd.rs:362:21 + | +LL | fn test_rsplitn(_x: RSplitn){} + | ^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::slice::RSplitN; + | +LL + use std::str::RSplitN; + | + +error[E0425]: cannot find type `RsplitTerminator` in this scope + --> $DIR/libstd.rs:364:30 + | +LL | fn test_rsplitterminator(_x: RsplitTerminator){} + | ^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::RSplitTerminator; + | + +error[E0425]: cannot find type `SplitASCIIWhitespace` in this scope + --> $DIR/libstd.rs:366:34 + | +LL | fn test_splitasciiwhitespace(_x: SplitASCIIWhitespace){} + | ^^^^^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::SplitAsciiWhitespace; + | + +error[E0425]: cannot find type `Splitn` in this scope + --> $DIR/libstd.rs:368:20 + | +LL | fn test_splitn(_x: Splitn){} + | ^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::slice::SplitN; + | +LL + use std::str::SplitN; + | + +error[E0425]: cannot find type `Splitterminator` in this scope + --> $DIR/libstd.rs:370:29 + | +LL | fn test_splitterminator(_x: Splitterminator){} + | ^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::SplitTerminator; + | + +error[E0425]: cannot find type `Splitwhitespace` in this scope + --> $DIR/libstd.rs:372:29 + | +LL | fn test_splitwhitespace(_x: Splitwhitespace){} + | ^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::str::SplitWhitespace; + | + +error[E0425]: cannot find type `arc` in this scope + --> $DIR/libstd.rs:377:17 + | +LL | fn test_arc(_x: arc<()>){} + | ^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::sync::Arc; + | + +error[E0425]: cannot find type `barrier` in this scope + --> $DIR/libstd.rs:379:21 + | +LL | fn test_barrier(_x: barrier<()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::sync::Barrier; + | + +error[E0425]: cannot find type `BarrierwaitResult` in this scope + --> $DIR/libstd.rs:381:31 + | +LL | fn test_barrierwaitresult(_x: BarrierwaitResult<()>){} + | ^^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::sync::BarrierWaitResult; + | + +error[E0425]: cannot find type `CondVar` in this scope + --> $DIR/libstd.rs:383:21 + | +LL | fn test_condvar(_x: CondVar<()>){} + | ^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::sync::Condvar; + | +LL + use std::sync::nonpoison::Condvar; + | + +error[E0425]: cannot find type `mutex` in this scope + --> $DIR/libstd.rs:385:19 + | +LL | fn test_mutex(_x: mutex<()>){} + | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::sync::Mutex; + | +LL + use std::sync::nonpoison::Mutex; + | + +error[E0425]: cannot find type `Mutexguard` in this scope + --> $DIR/libstd.rs:387:24 + | +LL | fn test_mutexguard(_x: Mutexguard<()>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::sync::MutexGuard; + | +LL + use std::sync::nonpoison::MutexGuard; + | + +error[E0425]: cannot find type `RWlock` in this scope + --> $DIR/libstd.rs:389:20 + | +LL | fn test_rwlock(_x: RWlock<()>){} + | ^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::sync::RwLock; + | +LL + use std::sync::nonpoison::RwLock; + | + +error[E0425]: cannot find type `RWlockReadGuard` in this scope + --> $DIR/libstd.rs:391:29 + | +LL | fn test_rwlockreadguard(_x: RWlockReadGuard<()>){} + | ^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::sync::RwLockReadGuard; + | +LL + use std::sync::nonpoison::RwLockReadGuard; + | + +error[E0425]: cannot find type `RWlockWriteGuard` in this scope + --> $DIR/libstd.rs:393:30 + | +LL | fn test_rwlockwriteguard(_x: RWlockWriteGuard<()>){} + | ^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing one of these similarly named structs + | +LL + use std::sync::RwLockWriteGuard; + | +LL + use std::sync::nonpoison::RwLockWriteGuard; + | + +error[E0425]: cannot find type `WaittimeoutResult` in this scope + --> $DIR/libstd.rs:395:31 + | +LL | fn test_waittimeoutresult(_x: WaittimeoutResult<()>){} + | ^^^^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::sync::WaitTimeoutResult; + | + +error[E0425]: cannot find type `context` in this scope + --> $DIR/libstd.rs:400:21 + | +LL | fn test_context(_x: context){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::task::Context; + | + +error[E0425]: cannot find type `Rawwaker` in this scope + --> $DIR/libstd.rs:402:22 + | +LL | fn test_rawwaker(_x: Rawwaker){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::task::RawWaker; + | + +error[E0425]: cannot find type `RawwakerVTable` in this scope + --> $DIR/libstd.rs:404:28 + | +LL | fn test_rawwakervtable(_x: RawwakerVTable){} + | ^^^^^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::task::RawWakerVTable; + | + +error[E0425]: cannot find type `waker` in this scope + --> $DIR/libstd.rs:406:19 + | +LL | fn test_waker(_x: waker){} + | ^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::task::Waker; + | + +error[E0425]: cannot find type `builder` in this scope + --> $DIR/libstd.rs:411:21 + | +LL | fn test_builder(_x: builder){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::thread::Builder; + | + +error[E0425]: cannot find type `Joinhandle` in this scope + --> $DIR/libstd.rs:413:24 + | +LL | fn test_joinhandle(_x: Joinhandle<()>){} + | ^^^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::thread::JoinHandle; + | + +error[E0425]: cannot find type `Localkey` in this scope + --> $DIR/libstd.rs:415:22 + | +LL | fn test_localkey(_x: Localkey<()>){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::thread::LocalKey; + | + +error[E0425]: cannot find type `thread` in this scope + --> $DIR/libstd.rs:417:20 + | +LL | fn test_thread(_x: thread){} + | ^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::thread::Thread; + | + +error[E0425]: cannot find type `ThreadID` in this scope + --> $DIR/libstd.rs:419:22 + | +LL | fn test_threadid(_x: ThreadID){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::thread::ThreadId; + | + +error[E0425]: cannot find type `duration` in this scope + --> $DIR/libstd.rs:424:22 + | +LL | fn test_duration(_x: duration){} + | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::time::Duration; + | + +error[E0425]: cannot find type `instant` in this scope + --> $DIR/libstd.rs:426:21 + | +LL | fn test_instant(_x: instant){} + | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named struct + | +LL + use std::time::Instant; + | + +error[E0425]: cannot find type `Systemtime` in this scope + --> $DIR/libstd.rs:428:24 + | +LL | fn test_systemtime(_x: Systemtime){} + | ^^^^^^^^^^ +... +LL | struct SystemTome{} + | ----------------- similarly named struct `SystemTome` defined here + | +help: a struct with a similar name exists + | +LL - fn test_systemtime(_x: Systemtime){} +LL + fn test_systemtime(_x: SystemTome){} + | + +error[E0425]: cannot find type `SystemTime` in this scope + --> $DIR/libstd.rs:431:25 + | +LL | fn test_systemtime2(_x: SystemTime){} + | ^^^^^^^^^^ +... +LL | struct SystemTome{} + | ----------------- similarly named struct `SystemTome` defined here + | +help: a struct with a similar name exists + | +LL - fn test_systemtime2(_x: SystemTime){} +LL + fn test_systemtime2(_x: SystemTome){} + | +help: consider importing this struct + | +LL + use std::time::SystemTime; + | + +error: aborting due to 168 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/parser/raw/raw-literal-keywords.stderr b/tests/ui/parser/raw/raw-literal-keywords.stderr index f7b6c894a90fe..7c7322d12d338 100644 --- a/tests/ui/parser/raw/raw-literal-keywords.stderr +++ b/tests/ui/parser/raw/raw-literal-keywords.stderr @@ -27,12 +27,22 @@ error[E0425]: cannot find value `r#struct` in this scope | LL | let _ = r#struct; | ^^^^^^^^ not found in this scope + | +help: consider importing this similarly named tuple variant + | +LL + use std::mem::type_info::TypeKind::Struct; + | error[E0425]: cannot find value `union` in this scope --> $DIR/raw-literal-keywords.rs:22:13 | LL | let _ = r#union; | ^^^^^^^ not found in this scope + | +help: consider importing this similarly named tuple variant + | +LL + use std::mem::type_info::TypeKind::Union; + | error: aborting due to 6 previous errors diff --git a/tests/ui/resolve/export-fully-qualified-2018.stderr b/tests/ui/resolve/export-fully-qualified-2018.stderr index 25c9e6fbdab96..1246d51a7fca1 100644 --- a/tests/ui/resolve/export-fully-qualified-2018.stderr +++ b/tests/ui/resolve/export-fully-qualified-2018.stderr @@ -5,6 +5,10 @@ LL | pub fn bar() { foo::baz(); } | ^^^ use of unresolved module or unlinked crate `foo` | = help: you might be missing a crate named `foo` +help: consider importing this module + | +LL + use crate::foo; + | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/export-fully-qualified.stderr b/tests/ui/resolve/export-fully-qualified.stderr index f8433dcfb8924..c9514d34b8d0f 100644 --- a/tests/ui/resolve/export-fully-qualified.stderr +++ b/tests/ui/resolve/export-fully-qualified.stderr @@ -5,6 +5,10 @@ LL | pub fn bar() { foo::baz(); } | ^^^ use of unresolved module or unlinked crate `foo` | = help: you might be missing a crate named `foo` +help: consider importing this module + | +LL + use foo; + | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/resolve-assoc-suggestions.stderr b/tests/ui/resolve/resolve-assoc-suggestions.stderr index e6311962884f1..37fccacec69e9 100644 --- a/tests/ui/resolve/resolve-assoc-suggestions.stderr +++ b/tests/ui/resolve/resolve-assoc-suggestions.stderr @@ -3,6 +3,13 @@ error[E0425]: cannot find type `field` in this scope | LL | let _: field; | ^^^^^ not found in this scope + | +help: consider importing one of these similarly named items + | +LL + use std::field::Field; + | +LL + use std::mem::type_info::Field; + | error[E0531]: cannot find tuple struct or tuple variant `field` in this scope --> $DIR/resolve-assoc-suggestions.rs:18:13 diff --git a/tests/ui/resolve/resolve-speculative-adjustment.stderr b/tests/ui/resolve/resolve-speculative-adjustment.stderr index fb15472bdae8d..e03d0cb2088ab 100644 --- a/tests/ui/resolve/resolve-speculative-adjustment.stderr +++ b/tests/ui/resolve/resolve-speculative-adjustment.stderr @@ -3,6 +3,11 @@ error[E0425]: cannot find value `field` in this scope | LL | field; | ^^^^^ not found in this scope + | +help: consider importing this similarly named function + | +LL + use std::intrinsics::mir::Field; + | error[E0425]: cannot find value `field` in this scope --> $DIR/resolve-speculative-adjustment.rs:23:9 diff --git a/tests/ui/suggestions/crate-or-module-typo.stderr b/tests/ui/suggestions/crate-or-module-typo.stderr index 49ac1c89ab52a..59d6c64b1b934 100644 --- a/tests/ui/suggestions/crate-or-module-typo.stderr +++ b/tests/ui/suggestions/crate-or-module-typo.stderr @@ -21,6 +21,17 @@ LL - use bas::bar; LL + use bar::bar; | +error[E0433]: cannot find module or crate `bar` in this scope + --> $DIR/crate-or-module-typo.rs:6:20 + | +LL | pub fn bar() { bar::baz(); } + | ^^^ function `bar` is not a crate or module + | +help: consider importing this module + | +LL + use crate::bar; + | + error[E0433]: cannot find module or crate `st` in this scope --> $DIR/crate-or-module-typo.rs:14:10 | @@ -41,12 +52,6 @@ LL - bar: st::cell::Cell LL + bar: cell::Cell | -error[E0433]: cannot find module or crate `bar` in this scope - --> $DIR/crate-or-module-typo.rs:6:20 - | -LL | pub fn bar() { bar::baz(); } - | ^^^ function `bar` is not a crate or module - error: aborting due to 4 previous errors Some errors have detailed explanations: E0432, E0433.