diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl index 4f2d59b4c6632..283d580f203da 100644 --- a/compiler/rustc_lint/messages.ftl +++ b/compiler/rustc_lint/messages.ftl @@ -609,7 +609,8 @@ lint_opaque_hidden_inferred_bound_sugg = add this bound lint_or_patterns_back_compat = the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro .suggestion = use pat_param to preserve semantics -lint_out_of_scope_macro_calls = cannot find macro `{$path}` in this scope +lint_out_of_scope_macro_calls = cannot find macro `{$path}` in {$scope} + .label = not found in {$scope} .help = import `macro_rules` with `use` to make it callable above its definition lint_overflowing_bin_hex = literal out of range for `{$ty}` diff --git a/compiler/rustc_lint/src/context/diagnostics.rs b/compiler/rustc_lint/src/context/diagnostics.rs index 05e075205c4b7..a388bc8d3ae82 100644 --- a/compiler/rustc_lint/src/context/diagnostics.rs +++ b/compiler/rustc_lint/src/context/diagnostics.rs @@ -434,8 +434,8 @@ pub(super) fn decorate_lint(sess: &Session, diagnostic: BuiltinLintDiag, diag: & lints::InnerAttributeUnstable::CustomInnerAttribute } .decorate_lint(diag), - BuiltinLintDiag::OutOfScopeMacroCalls { path } => { - lints::OutOfScopeMacroCalls { path }.decorate_lint(diag) + BuiltinLintDiag::OutOfScopeMacroCalls { span, path, scope } => { + lints::OutOfScopeMacroCalls { span, path, scope }.decorate_lint(diag) } } } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 54c73710eca6f..ba0833a921d05 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -2917,5 +2917,8 @@ pub struct UnsafeAttrOutsideUnsafeSuggestion { #[diag(lint_out_of_scope_macro_calls)] #[help] pub struct OutOfScopeMacroCalls { + #[label] + pub span: Span, pub path: String, + pub scope: String, } diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index f87f19e170005..e27868a405dee 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -745,7 +745,9 @@ pub enum BuiltinLintDiag { is_macro: bool, }, OutOfScopeMacroCalls { + span: Span, path: String, + scope: String, }, } diff --git a/compiler/rustc_resolve/messages.ftl b/compiler/rustc_resolve/messages.ftl index 4b9c36ad39fb5..0016a588e9a35 100644 --- a/compiler/rustc_resolve/messages.ftl +++ b/compiler/rustc_resolve/messages.ftl @@ -80,8 +80,8 @@ resolve_cannot_determine_macro_resolution = resolve_cannot_find_builtin_macro_with_name = cannot find a built-in macro with name `{$ident}` -resolve_cannot_find_ident_in_this_scope = - cannot find {$expected} `{$ident}` in this scope +resolve_cannot_find_ident_in_this_scope = cannot find {$expected} `{$ident}` in {$scope} + .label = not found in {$scope} resolve_cannot_glob_import_possible_crates = cannot glob-import all possible crates diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 92cf73870ff13..bbc9535fc3052 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -307,9 +307,15 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> { PathResult::NonModule(partial_res) => { expected_found_error(partial_res.expect_full_res()) } - PathResult::Failed { span, label, suggestion, .. } => { - Err(VisResolutionError::FailedToResolve(span, label, suggestion)) - } + PathResult::Failed { + span, label, suggestion, segment_name, item_type, .. + } => Err(VisResolutionError::FailedToResolve( + span, + segment_name, + label, + suggestion, + item_type, + )), PathResult::Indeterminate => Err(VisResolutionError::Indeterminate(path.span)), } } diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index ffd495aa9857e..a21869af7f6e7 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -794,9 +794,32 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { ResolutionError::SelfImportOnlyInImportListWithNonEmptyPrefix => { self.dcx().create_err(errs::SelfImportOnlyInImportListWithNonEmptyPrefix { span }) } - ResolutionError::FailedToResolve { segment, label, suggestion, module } => { - let mut err = - struct_span_code_err!(self.dcx(), span, E0433, "failed to resolve: {}", &label); + ResolutionError::FailedToResolve { segment, label, suggestion, module, item_type } => { + let mut err = struct_span_code_err!( + self.dcx(), + span, + E0433, + "cannot find {item_type} `{segment}` in {}", + match module { + Some(ModuleOrUniformRoot::CurrentScope) | None => "this scope".to_string(), + Some(ModuleOrUniformRoot::Module(module)) => { + match module.kind { + ModuleKind::Def(_, _, name) if name == kw::Empty => { + "the crate root".to_string() + } + ModuleKind::Def(kind, def_id, name) => { + format!("{} `{name}`", kind.descr(def_id)) + } + ModuleKind::Block => "this scope".to_string(), + } + } + Some(ModuleOrUniformRoot::CrateRootAndExternPrelude) => { + "the crate root or the list of imported crates".to_string() + } + Some(ModuleOrUniformRoot::ExternPrelude) => + "the list of imported crates".to_string(), + }, + ); err.span_label(span, label); if let Some((suggestions, msg, applicability)) = suggestion { @@ -809,7 +832,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { if let Some(ModuleOrUniformRoot::Module(module)) = module && let Some(module) = module.opt_def_id() - && let Some(segment) = segment { self.find_cfg_stripped(&mut err, &segment, module); } @@ -989,10 +1011,18 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { VisResolutionError::AncestorOnly(span) => { self.dcx().create_err(errs::AncestorOnly(span)) } - VisResolutionError::FailedToResolve(span, label, suggestion) => self.into_struct_error( - span, - ResolutionError::FailedToResolve { segment: None, label, suggestion, module: None }, - ), + VisResolutionError::FailedToResolve(span, segment, label, suggestion, item_type) => { + self.into_struct_error( + span, + ResolutionError::FailedToResolve { + segment, + label, + suggestion, + module: None, + item_type, + }, + ) + } VisResolutionError::ExpectedFound(span, path_str, res) => { self.dcx().create_err(errs::ExpectedModuleFound { span, res, path_str }) } @@ -2001,18 +2031,23 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { Applicability::MaybeIncorrect, )), ) + } else if ident.is_special() { + (format!("`{ident}` is not a valid item name"), None) } else if ident.name == sym::core { ( - format!("maybe a missing crate `{ident}`?"), + format!("you might be missing a crate named `{ident}`"), Some(( vec![(ident.span, "std".to_string())], "try using `std` instead of `core`".to_string(), Applicability::MaybeIncorrect, )), ) + } else if ident.is_raw_guess() { + // We're unlikely to have a crate called `r#super`, don't suggest anything. + ("unresolved import".to_string(), None) } else if self.tcx.sess.is_rust_2015() { ( - format!("maybe a missing crate `{ident}`?"), + format!("you might be missing a crate named `{ident}`"), Some(( vec![], format!( diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs index 0620f3d709eb2..15d0fd0ffa01f 100644 --- a/compiler/rustc_resolve/src/errors.rs +++ b/compiler/rustc_resolve/src/errors.rs @@ -635,8 +635,10 @@ pub(crate) struct ImportsCannotReferTo<'a> { #[diag(resolve_cannot_find_ident_in_this_scope)] pub(crate) struct CannotFindIdentInThisScope<'a> { #[primary_span] + #[label] pub(crate) span: Span, pub(crate) expected: &'a str, + pub(crate) scope: &'a str, pub(crate) ident: Ident, } diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 7d531385e2120..a026432a8eb2d 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -1,5 +1,5 @@ use rustc_ast::{self as ast, NodeId}; -use rustc_errors::ErrorGuaranteed; +use rustc_errors::{Applicability, ErrorGuaranteed}; use rustc_hir::def::{DefKind, Namespace, NonMacroAttrKind, PartialRes, PerNS}; use rustc_middle::bug; use rustc_middle::ty; @@ -1463,9 +1463,28 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { continue; } } - return PathResult::failed(ident, false, finalize.is_some(), module, || { - ("there are too many leading `super` keywords".to_string(), None) - }); + let mut item_type = "module"; + let mut suggestion = None; + let label = if path.len() == 1 + && let Some(ribs) = ribs + && let RibKind::Normal = ribs[ValueNS][ribs[ValueNS].len() - 1].kind + { + item_type = "item"; + suggestion = Some((vec![(ident.span.shrink_to_lo(), "r#".to_string())], "if you still want to call your identifier `super`, use the raw identifier format".to_string(), Applicability::MachineApplicable)); + "can't use `super` as an identifier" + } else if segment_idx == 0 { + "can't use `super` on the crate root, there are no further modules to go \"up\" to" + } else { + "there are too many leading `super` keywords" + }; + return PathResult::failed( + ident, + false, + finalize.is_some(), + module, + || (label.to_string(), suggestion), + item_type, + ); } if segment_idx == 0 { if name == kw::SelfLower { @@ -1497,19 +1516,26 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { // Report special messages for path segment keywords in wrong positions. if ident.is_path_segment_keyword() && segment_idx != 0 { - return PathResult::failed(ident, false, finalize.is_some(), module, || { - let name_str = if name == kw::PathRoot { - "crate root".to_string() - } else { - format!("`{name}`") - }; - let label = if segment_idx == 1 && path[0].ident.name == kw::PathRoot { - format!("global paths cannot start with {name_str}") - } else { - format!("{name_str} in paths can only be used in start position") - }; - (label, None) - }); + return PathResult::failed( + ident, + false, + finalize.is_some(), + module, + || { + let name_str = if name == kw::PathRoot { + "crate root".to_string() + } else { + format!("`{name}`") + }; + let label = if segment_idx == 1 && path[0].ident.name == kw::PathRoot { + format!("global paths cannot start with {name_str}") + } else { + format!("{name_str} in paths can only be used in start position") + }; + (label, None) + }, + "module", + ); } let binding = if let Some(module) = module { @@ -1605,6 +1631,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { ); (label, None) }, + "module", ); } } @@ -1619,18 +1646,29 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { } } - return PathResult::failed(ident, is_last, finalize.is_some(), module, || { - self.report_path_resolution_error( - path, - opt_ns, - parent_scope, - ribs, - ignore_binding, - module, - segment_idx, - ident, - ) - }); + return PathResult::failed( + ident, + is_last, + finalize.is_some(), + module, + || { + self.report_path_resolution_error( + path, + opt_ns, + parent_scope, + ribs, + ignore_binding, + module, + segment_idx, + ident, + ) + }, + match opt_ns { + Some(ValueNS) if path.len() == 1 => "item or value", + Some(ns) if path.len() - 1 == segment_idx => ns.descr(), + Some(_) | None => "item", + }, + ); } } } diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index 3896fe4c4fa64..a7b25b8f0804f 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -900,16 +900,18 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { label, suggestion, module, + item_type, } => { if no_ambiguity { assert!(import.imported_module.get().is_none()); self.report_error( span, ResolutionError::FailedToResolve { - segment: Some(segment_name), + segment: segment_name, label, suggestion, module, + item_type, }, ); } diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 1d37264f96a3c..dae42983d80d8 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -4274,14 +4274,16 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> { suggestion, module, segment_name, + item_type, } => { return Err(respan( span, ResolutionError::FailedToResolve { - segment: Some(segment_name), + segment: segment_name, label, suggestion, module, + item_type, }, )); } diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 941fb6436df92..3bf881b0e42b1 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -347,7 +347,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> { } else { suggestion }; - (format!("not found in {mod_str}"), override_suggestion) + (format!("not found in {mod_prefix}{mod_str}"), override_suggestion) }; BaseError { diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 7cb5a3fb2fd15..c920ac17847a0 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -228,10 +228,11 @@ enum ResolutionError<'a> { SelfImportOnlyInImportListWithNonEmptyPrefix, /// Error E0433: failed to resolve. FailedToResolve { - segment: Option, + segment: Symbol, label: String, suggestion: Option, module: Option>, + item_type: &'static str, }, /// Error E0434: can't capture dynamic environment in a fn item. CannotCaptureDynamicEnvironmentInFnItem, @@ -287,7 +288,7 @@ enum ResolutionError<'a> { enum VisResolutionError<'a> { Relative2018(Span, &'a ast::Path), AncestorOnly(Span), - FailedToResolve(Span, String, Option), + FailedToResolve(Span, Symbol, String, Option, &'static str), ExpectedFound(Span, String, Res), Indeterminate(Span), ModuleOnly(Span), @@ -429,6 +430,7 @@ enum PathResult<'a> { module: Option>, /// The segment name of target segment_name: Symbol, + item_type: &'static str, }, } @@ -439,6 +441,7 @@ impl<'a> PathResult<'a> { finalize: bool, module: Option>, label_and_suggestion: impl FnOnce() -> (String, Option), + item_type: &'static str, ) -> PathResult<'a> { let (label, suggestion) = if finalize { label_and_suggestion() } else { (String::new(), None) }; @@ -449,6 +452,7 @@ impl<'a> PathResult<'a> { suggestion, is_error_from_last_segment, module, + item_type, } } } diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index cb9bebd33d306..c767586d920ed 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -862,44 +862,54 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { ), path_res @ (PathResult::NonModule(..) | PathResult::Failed { .. }) => { let mut suggestion = None; - let (span, label, module) = - if let PathResult::Failed { span, label, module, .. } = path_res { - // try to suggest if it's not a macro, maybe a function - if let PathResult::NonModule(partial_res) = - self.maybe_resolve_path(&path, Some(ValueNS), &parent_scope) - && partial_res.unresolved_segments() == 0 - { - let sm = self.tcx.sess.source_map(); - let exclamation_span = sm.next_point(span); - suggestion = Some(( - vec![(exclamation_span, "".to_string())], - format!( - "{} is not a macro, but a {}, try to remove `!`", - Segment::names_to_string(&path), - partial_res.base_res().descr() - ), - Applicability::MaybeIncorrect, - )); - } - (span, label, module) - } else { - ( - path_span, + let (span, label, module, segment, item_type) = if let PathResult::Failed { + span, + label, + module, + segment_name, + item_type, + .. + } = path_res + { + // try to suggest if it's not a macro, maybe a function + if let PathResult::NonModule(partial_res) = + self.maybe_resolve_path(&path, Some(ValueNS), &parent_scope) + && partial_res.unresolved_segments() == 0 + { + let sm = self.tcx.sess.source_map(); + let exclamation_span = sm.next_point(span); + suggestion = Some(( + vec![(exclamation_span, "".to_string())], format!( - "partially resolved path in {} {}", - kind.article(), - kind.descr() + "{} is not a macro, but a {}, try to remove `!`", + Segment::names_to_string(&path), + partial_res.base_res().descr() ), - None, - ) - }; + Applicability::MaybeIncorrect, + )); + } + (span, label, module, segment_name, item_type) + } else { + ( + path_span, + format!( + "partially resolved path in {} {}", + kind.article(), + kind.descr() + ), + None, + path.last().map(|segment| segment.ident.name).unwrap(), + "item", + ) + }; self.report_error( span, ResolutionError::FailedToResolve { - segment: path.last().map(|segment| segment.ident.name), + segment, label, suggestion, module, + item_type, }, ); } @@ -940,10 +950,17 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { } Err(..) => { let expected = kind.descr_expected(); - + let scope = match parent_scope.module.kind { + ModuleKind::Def(_, _, name) if name == kw::Empty => "the crate root", + ModuleKind::Def(kind, def_id, name) => { + &format!("{} `{name}`", kind.descr(def_id)) + } + ModuleKind::Block => "this scope", + }; let mut err = self.dcx().create_err(CannotFindIdentInThisScope { span: ident.span, expected, + scope, ident, }); self.unresolved_macro_suggestions(&mut err, kind, &parent_scope, ident, krate); @@ -1067,11 +1084,24 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { None, ); if fallback_binding.ok().and_then(|b| b.res().opt_def_id()) != Some(def_id) { + let scope = match parent_scope.module.kind { + ModuleKind::Def(_, _, name) if name == kw::Empty => { + "the crate root".to_string() + } + ModuleKind::Def(kind, def_id, name) => { + format!("{} `{name}`", kind.descr(def_id)) + } + ModuleKind::Block => "this scope".to_string(), + }; self.tcx.sess.psess.buffer_lint( OUT_OF_SCOPE_MACRO_CALLS, path.span, node_id, - BuiltinLintDiag::OutOfScopeMacroCalls { path: pprust::path_to_string(path) }, + BuiltinLintDiag::OutOfScopeMacroCalls { + span: path.span, + path: pprust::path_to_string(path), + scope, + }, ); } } diff --git a/src/tools/clippy/tests/ui/crashes/unreachable-array-or-slice.stderr b/src/tools/clippy/tests/ui/crashes/unreachable-array-or-slice.stderr index 9e0d3b934b80f..5420e611728f0 100644 --- a/src/tools/clippy/tests/ui/crashes/unreachable-array-or-slice.stderr +++ b/src/tools/clippy/tests/ui/crashes/unreachable-array-or-slice.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> tests/ui/crashes/unreachable-array-or-slice.rs:4:9 | LL | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5); diff --git a/src/tools/miri/tests/fail/rustc-error2.rs b/src/tools/miri/tests/fail/rustc-error2.rs index fd2c53933856d..6d9cd9544b3e4 100644 --- a/src/tools/miri/tests/fail/rustc-error2.rs +++ b/src/tools/miri/tests/fail/rustc-error2.rs @@ -4,7 +4,7 @@ struct Struct(T); impl std::ops::Deref for Struct { type Target = dyn Fn(T); fn deref(&self) -> &assert_mem_uninitialized_valid::Target { - //~^ERROR: undeclared crate or module + //~^ ERROR: cannot find item `assert_mem_uninitialized_valid` unimplemented!() } } diff --git a/src/tools/miri/tests/fail/rustc-error2.stderr b/src/tools/miri/tests/fail/rustc-error2.stderr index de2861a019c69..59919adb42de5 100644 --- a/src/tools/miri/tests/fail/rustc-error2.stderr +++ b/src/tools/miri/tests/fail/rustc-error2.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `assert_mem_uninitialized_valid` +error[E0433]: cannot find item `assert_mem_uninitialized_valid` in this scope --> $DIR/rustc-error2.rs:LL:CC | LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target { diff --git a/tests/rustdoc-ui/impl-fn-nesting.rs b/tests/rustdoc-ui/impl-fn-nesting.rs index a927f6bd79976..38275ebcc6c32 100644 --- a/tests/rustdoc-ui/impl-fn-nesting.rs +++ b/tests/rustdoc-ui/impl-fn-nesting.rs @@ -9,28 +9,28 @@ pub trait NeedsBody { /// This function has docs pub fn f(a: UnknownType, b: B) { -//~^ ERROR cannot find trait `UnknownBound` in this scope -//~| ERROR cannot find type `UnknownType` in this scope +//~^ ERROR cannot find trait `UnknownBound` +//~| ERROR cannot find type `UnknownType` impl UnknownTrait for ValidType {} //~ ERROR cannot find trait `UnknownTrait` impl UnknownTrait for T {} - //~^ ERROR cannot find trait `UnknownBound` in this scope - //~| ERROR cannot find trait `UnknownTrait` in this scope + //~^ ERROR cannot find trait `UnknownBound` + //~| ERROR cannot find trait `UnknownTrait` impl ValidTrait for UnknownType {} - //~^ ERROR cannot find type `UnknownType` in this scope + //~^ ERROR cannot find type `UnknownType` impl ValidTrait for ValidType where ValidTrait: UnknownBound {} - //~^ ERROR cannot find trait `UnknownBound` in this scope + //~^ ERROR cannot find trait `UnknownBound` /// This impl has documentation impl NeedsBody for ValidType { type Item = UnknownType; - //~^ ERROR cannot find type `UnknownType` in this scope + //~^ ERROR cannot find type `UnknownType` /// This function has documentation fn f() { ::a(); content::shouldnt::matter(); unknown_macro!(); - //~^ ERROR cannot find macro `unknown_macro` in this scope + //~^ ERROR cannot find macro `unknown_macro` /// This is documentation for a macro macro_rules! can_define_macros_here_too { @@ -42,7 +42,7 @@ pub fn f(a: UnknownType, b: B) { /// This also is documented. pub fn doubly_nested(c: UnknownType) { - //~^ ERROR cannot find type `UnknownType` in this scope + //~^ ERROR cannot find type `UnknownType` } } } diff --git a/tests/rustdoc-ui/impl-fn-nesting.stderr b/tests/rustdoc-ui/impl-fn-nesting.stderr index 75e6b4ed217dd..4710e9893acb8 100644 --- a/tests/rustdoc-ui/impl-fn-nesting.stderr +++ b/tests/rustdoc-ui/impl-fn-nesting.stderr @@ -2,7 +2,7 @@ error: cannot find macro `unknown_macro` in this scope --> $DIR/impl-fn-nesting.rs:32:13 | LL | unknown_macro!(); - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in this scope error[E0405]: cannot find trait `UnknownBound` in this scope --> $DIR/impl-fn-nesting.rs:11:13 diff --git a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.rs b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.rs index c71e5bee12ead..504151c341ee8 100644 --- a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.rs +++ b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.rs @@ -1,6 +1,6 @@ // Regression test for issue #95879. -use unresolved_crate::module::Name; //~ ERROR failed to resolve +use unresolved_crate::module::Name; //~ ERROR cannot find item /// [Name] pub struct S; diff --git a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr index 8315c73a639f8..c9de7231f0383 100644 --- a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr +++ b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve: maybe a missing crate `unresolved_crate`? +error[E0433]: cannot find item `unresolved_crate` in the crate root --> $DIR/unresolved-import-recovery.rs:3:5 | LL | use unresolved_crate::module::Name; - | ^^^^^^^^^^^^^^^^ maybe a missing crate `unresolved_crate`? + | ^^^^^^^^^^^^^^^^ you might be missing a crate named `unresolved_crate` | = help: consider adding `extern crate unresolved_crate` to use the `unresolved_crate` crate diff --git a/tests/rustdoc-ui/issues/issue-61732.rs b/tests/rustdoc-ui/issues/issue-61732.rs index 4bd8efeaa3b97..938cbc316eb71 100644 --- a/tests/rustdoc-ui/issues/issue-61732.rs +++ b/tests/rustdoc-ui/issues/issue-61732.rs @@ -1,4 +1,4 @@ // This previously triggered an ICE. pub(in crate::r#mod) fn main() {} -//~^ ERROR failed to resolve: maybe a missing crate `r#mod` +//~^ ERROR cannot find item `mod` in this scope diff --git a/tests/rustdoc-ui/issues/issue-61732.stderr b/tests/rustdoc-ui/issues/issue-61732.stderr index f351f52d1e15c..437f6618d1062 100644 --- a/tests/rustdoc-ui/issues/issue-61732.stderr +++ b/tests/rustdoc-ui/issues/issue-61732.stderr @@ -1,10 +1,8 @@ -error[E0433]: failed to resolve: maybe a missing crate `r#mod`? +error[E0433]: cannot find item `mod` in this scope --> $DIR/issue-61732.rs:3:15 | LL | pub(in crate::r#mod) fn main() {} - | ^^^^^ maybe a missing crate `r#mod`? - | - = help: consider adding `extern crate r#mod` to use the `r#mod` crate + | ^^^^^ unresolved import error: aborting due to 1 previous error diff --git a/tests/rustdoc-ui/issues/issue-81662-shortness.rs b/tests/rustdoc-ui/issues/issue-81662-shortness.rs index 02207d2a736d7..7df63261ce7ee 100644 --- a/tests/rustdoc-ui/issues/issue-81662-shortness.rs +++ b/tests/rustdoc-ui/issues/issue-81662-shortness.rs @@ -1,6 +1,6 @@ //@ compile-flags:--test --error-format=short //@ check-stdout -//@ error-pattern:cannot find function `foo` in this scope +//@ error-pattern:cannot find function `foo` //@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ failure-status: 101 diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs index dc268dfc5caf7..07796b139cf6a 100644 --- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs +++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs @@ -56,14 +56,14 @@ enum DiagnosticOnEnum { #[derive(Diagnostic)] #[diag(no_crate_example, code = E0123)] #[diag = "E0123"] -//~^ ERROR failed to resolve: maybe a missing crate `core` +//~^ ERROR cannot find item `core` struct WrongStructAttrStyle {} #[derive(Diagnostic)] #[nonsense(no_crate_example, code = E0123)] //~^ ERROR `#[nonsense(...)]` is not a valid attribute -//~^^ ERROR diagnostic slug not specified -//~^^^ ERROR cannot find attribute `nonsense` in this scope +//~| ERROR diagnostic slug not specified +//~| ERROR cannot find attribute `nonsense` struct InvalidStructAttr {} #[derive(Diagnostic)] @@ -73,7 +73,7 @@ struct InvalidLitNestedAttr {} #[derive(Diagnostic)] #[diag(nonsense, code = E0123)] -//~^ ERROR cannot find value `nonsense` in module `crate::fluent_generated` +//~^ ERROR cannot find value `nonsense` struct InvalidNestedStructAttr {} #[derive(Diagnostic)] @@ -149,7 +149,7 @@ struct MessageWrongType { struct InvalidPathFieldAttr { #[nonsense] //~^ ERROR `#[nonsense]` is not a valid attribute - //~^^ ERROR cannot find attribute `nonsense` in this scope + //~^^ ERROR cannot find attribute `nonsense` foo: String, } @@ -583,28 +583,28 @@ struct ErrorWithWarn { #[error(no_crate_example, code = E0123)] //~^ ERROR `#[error(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified -//~| ERROR cannot find attribute `error` in this scope +//~| ERROR cannot find attribute `error` struct ErrorAttribute {} #[derive(Diagnostic)] #[warn_(no_crate_example, code = E0123)] //~^ ERROR `#[warn_(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified -//~| ERROR cannot find attribute `warn_` in this scope +//~| ERROR cannot find attribute `warn_` struct WarnAttribute {} #[derive(Diagnostic)] #[lint(no_crate_example, code = E0123)] //~^ ERROR `#[lint(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified -//~| ERROR cannot find attribute `lint` in this scope +//~| ERROR cannot find attribute `lint` struct LintAttributeOnSessionDiag {} #[derive(LintDiagnostic)] #[lint(no_crate_example, code = E0123)] //~^ ERROR `#[lint(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified -//~| ERROR cannot find attribute `lint` in this scope +//~| ERROR cannot find attribute `lint` struct LintAttributeOnLintDiag {} #[derive(Diagnostic)] @@ -643,14 +643,14 @@ struct MissingCodeInSuggestion { #[diag(no_crate_example, code = E0123)] #[multipart_suggestion(no_crate_suggestion)] //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute -//~| ERROR cannot find attribute `multipart_suggestion` in this scope +//~| ERROR cannot find attribute `multipart_suggestion` #[multipart_suggestion()] -//~^ ERROR cannot find attribute `multipart_suggestion` in this scope +//~^ ERROR cannot find attribute `multipart_suggestion` //~| ERROR `#[multipart_suggestion(...)]` is not a valid attribute struct MultipartSuggestion { #[multipart_suggestion(no_crate_suggestion)] //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute - //~| ERROR cannot find attribute `multipart_suggestion` in this scope + //~| ERROR cannot find attribute `multipart_suggestion` suggestion: Span, } @@ -801,15 +801,15 @@ struct SuggestionsNoItem { struct SuggestionsInvalidItem { #[suggestion(code(foo))] //~^ ERROR `code(...)` must contain only string literals - //~| ERROR failed to resolve: maybe a missing crate `core` + //~| ERROR cannot find item `core` sub: Span, } -#[derive(Diagnostic)] //~ ERROR cannot find value `__code_34` in this scope +#[derive(Diagnostic)] //~ ERROR cannot find value `__code_34` #[diag(no_crate_example)] struct SuggestionsInvalidLiteral { #[suggestion(code = 3)] - //~^ ERROR failed to resolve: maybe a missing crate `core` + //~^ ERROR cannot find item `core` sub: Span, } diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr index e36c6852d3b20..1268a99e95c6f 100644 --- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr +++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr @@ -524,83 +524,92 @@ LL | #[suggestion(no_crate_suggestion, code = "")] = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]` = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]` -error[E0433]: failed to resolve: maybe a missing crate `core`? +error[E0433]: cannot find item `core` in the crate root --> $DIR/diagnostic-derive.rs:58:8 | LL | #[diag = "E0123"] - | ^ maybe a missing crate `core`? + | ^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? +error[E0433]: cannot find item `core` in the crate root --> $DIR/diagnostic-derive.rs:802:23 | LL | #[suggestion(code(foo))] - | ^^^ maybe a missing crate `core`? + | ^^^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? +error[E0433]: cannot find item `core` in the crate root --> $DIR/diagnostic-derive.rs:811:25 | LL | #[suggestion(code = 3)] - | ^ maybe a missing crate `core`? + | ^ you might be missing a crate named `core` -error: cannot find attribute `nonsense` in this scope +error: cannot find attribute `nonsense` in the crate root --> $DIR/diagnostic-derive.rs:63:3 | LL | #[nonsense(no_crate_example, code = E0123)] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root -error: cannot find attribute `nonsense` in this scope +error: cannot find attribute `nonsense` in the crate root --> $DIR/diagnostic-derive.rs:150:7 | LL | #[nonsense] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root -error: cannot find attribute `error` in this scope +error: cannot find attribute `error` in the crate root --> $DIR/diagnostic-derive.rs:583:3 | LL | #[error(no_crate_example, code = E0123)] - | ^^^^^ + | ^^^^^ not found in the crate root -error: cannot find attribute `warn_` in this scope +error: cannot find attribute `warn_` in the crate root --> $DIR/diagnostic-derive.rs:590:3 | LL | #[warn_(no_crate_example, code = E0123)] - | ^^^^^ help: a built-in attribute with a similar name exists: `warn` + | ^^^^^ + | | + | not found in the crate root + | help: a built-in attribute with a similar name exists: `warn` -error: cannot find attribute `lint` in this scope +error: cannot find attribute `lint` in the crate root --> $DIR/diagnostic-derive.rs:597:3 | LL | #[lint(no_crate_example, code = E0123)] - | ^^^^ help: a built-in attribute with a similar name exists: `link` + | ^^^^ + | | + | not found in the crate root + | help: a built-in attribute with a similar name exists: `link` -error: cannot find attribute `lint` in this scope +error: cannot find attribute `lint` in the crate root --> $DIR/diagnostic-derive.rs:604:3 | LL | #[lint(no_crate_example, code = E0123)] - | ^^^^ help: a built-in attribute with a similar name exists: `link` + | ^^^^ + | | + | not found in the crate root + | help: a built-in attribute with a similar name exists: `link` -error: cannot find attribute `multipart_suggestion` in this scope +error: cannot find attribute `multipart_suggestion` in the crate root --> $DIR/diagnostic-derive.rs:644:3 | LL | #[multipart_suggestion(no_crate_suggestion)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `multipart_suggestion` in this scope +error: cannot find attribute `multipart_suggestion` in the crate root --> $DIR/diagnostic-derive.rs:647:3 | LL | #[multipart_suggestion()] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `multipart_suggestion` in this scope +error: cannot find attribute `multipart_suggestion` in the crate root --> $DIR/diagnostic-derive.rs:651:7 | LL | #[multipart_suggestion(no_crate_suggestion)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ not found in the crate root error[E0425]: cannot find value `nonsense` in module `crate::fluent_generated` --> $DIR/diagnostic-derive.rs:75:8 | LL | #[diag(nonsense, code = E0123)] - | ^^^^^^^^ not found in `crate::fluent_generated` + | ^^^^^^^^ not found in module `crate::fluent_generated` error[E0425]: cannot find value `__code_34` in this scope --> $DIR/diagnostic-derive.rs:808:10 diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs index 659ae54f7a3be..3e78c1f65b98f 100644 --- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs +++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs @@ -66,7 +66,8 @@ struct D { #[derive(Subdiagnostic)] #[foo] //~^ ERROR `#[foo]` is not a valid attribute -//~^^ ERROR cannot find attribute `foo` in this scope +//~| ERROR cannot find attribute `foo` +//~| NOTE not found in struct E { #[primary_span] span: Span, @@ -94,8 +95,8 @@ struct G { #[derive(Subdiagnostic)] #[label("...")] -//~^ ERROR failed to resolve: maybe a missing crate `core`? -//~| NOTE maybe a missing crate `core`? +//~^ ERROR cannot find item `core` +//~| NOTE you might be missing a crate named `core` struct H { #[primary_span] span: Span, @@ -124,8 +125,8 @@ struct K { #[derive(Subdiagnostic)] #[label(slug)] -//~^ ERROR cannot find value `slug` in module `crate::fluent_generated` -//~^^ NOTE not found in `crate::fluent_generated` +//~^ ERROR cannot find value `slug` +//~^^ NOTE not found in module `crate::fluent_generated` struct L { #[primary_span] span: Span, @@ -161,8 +162,9 @@ struct O { #[derive(Subdiagnostic)] #[foo] -//~^ ERROR cannot find attribute `foo` in this scope -//~^^ ERROR unsupported type attribute for subdiagnostic enum +//~^ ERROR cannot find attribute `foo` +//~| ERROR unsupported type attribute for subdiagnostic enum +//~| NOTE not found in enum P { #[label(no_crate_example)] A { @@ -176,7 +178,8 @@ enum P { enum Q { #[bar] //~^ ERROR `#[bar]` is not a valid attribute - //~^^ ERROR cannot find attribute `bar` in this scope + //~| ERROR cannot find attribute `bar` + //~| NOTE not found in A { #[primary_span] span: Span, @@ -188,7 +191,8 @@ enum Q { enum R { #[bar = "..."] //~^ ERROR `#[bar = ...]` is not a valid attribute - //~^^ ERROR cannot find attribute `bar` in this scope + //~| ERROR cannot find attribute `bar` + //~| NOTE not found in A { #[primary_span] span: Span, @@ -200,7 +204,8 @@ enum R { enum S { #[bar = 4] //~^ ERROR `#[bar = ...]` is not a valid attribute - //~^^ ERROR cannot find attribute `bar` in this scope + //~| ERROR cannot find attribute `bar` + //~| NOTE not found in A { #[primary_span] span: Span, @@ -212,7 +217,8 @@ enum S { enum T { #[bar("...")] //~^ ERROR `#[bar(...)]` is not a valid attribute - //~^^ ERROR cannot find attribute `bar` in this scope + //~| ERROR cannot find attribute `bar` + //~| NOTE not found in A { #[primary_span] span: Span, @@ -273,7 +279,8 @@ struct Y { span: Span, #[bar] //~^ ERROR `#[bar]` is not a valid attribute - //~^^ ERROR cannot find attribute `bar` in this scope + //~| ERROR cannot find attribute `bar` + //~| NOTE not found in bar: String, } @@ -284,7 +291,8 @@ struct Z { span: Span, #[bar = "..."] //~^ ERROR `#[bar = ...]` is not a valid attribute - //~^^ ERROR cannot find attribute `bar` in this scope + //~| ERROR cannot find attribute `bar` + //~| NOTE not found in bar: String, } @@ -295,7 +303,8 @@ struct AA { span: Span, #[bar("...")] //~^ ERROR `#[bar(...)]` is not a valid attribute - //~^^ ERROR cannot find attribute `bar` in this scope + //~| ERROR cannot find attribute `bar` + //~| NOTE not found in bar: String, } @@ -310,8 +319,8 @@ struct AB { #[derive(Subdiagnostic)] union AC { - //~^ ERROR failed to resolve: maybe a missing crate `core`? - //~| NOTE maybe a missing crate `core`? + //~^ ERROR cannot find item `core` + //~| NOTE you might be missing a crate named `core` span: u32, b: u64, } @@ -581,8 +590,8 @@ struct BD { span2: Span, #[suggestion_part(foo = "bar")] //~^ ERROR `code` is the only valid nested attribute - //~| ERROR failed to resolve: maybe a missing crate `core`? - //~| NOTE maybe a missing crate `core`? + //~| ERROR cannot find item `core` + //~| NOTE you might be missing a crate named `core` span4: Span, #[suggestion_part(code = "...")] //~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` @@ -674,8 +683,8 @@ enum BL { struct BM { #[suggestion_part(code("foo"))] //~^ ERROR expected exactly one string literal for `code = ...` - //~| ERROR failed to resolve: maybe a missing crate `core`? - //~| NOTE maybe a missing crate `core`? + //~| ERROR cannot find item `core` + //~| NOTE you might be missing a crate named `core` span: Span, r#type: String, } @@ -685,8 +694,8 @@ struct BM { struct BN { #[suggestion_part(code("foo", "bar"))] //~^ ERROR expected exactly one string literal for `code = ...` - //~| ERROR failed to resolve: maybe a missing crate `core`? - //~| NOTE maybe a missing crate `core`? + //~| ERROR cannot find item `core` + //~| NOTE you might be missing a crate named `core` span: Span, r#type: String, } @@ -696,8 +705,8 @@ struct BN { struct BO { #[suggestion_part(code(3))] //~^ ERROR expected exactly one string literal for `code = ...` - //~| ERROR failed to resolve: maybe a missing crate `core`? - //~| NOTE maybe a missing crate `core`? + //~| ERROR cannot find item `core` + //~| NOTE you might be missing a crate named `core` span: Span, r#type: String, } @@ -712,14 +721,14 @@ struct BP { } #[derive(Subdiagnostic)] -//~^ ERROR cannot find value `__code_29` in this scope +//~^ ERROR cannot find value `__code_29` //~| NOTE in this expansion -//~| NOTE not found in this scope +//~| NOTE not found in #[multipart_suggestion(no_crate_example)] struct BQ { #[suggestion_part(code = 3)] - //~^ ERROR failed to resolve: maybe a missing crate `core`? - //~| NOTE maybe a missing crate `core`? + //~^ ERROR cannot find item `core` + //~| NOTE you might be missing a crate named `core` span: Span, r#type: String, } @@ -811,8 +820,8 @@ struct SuggestionStyleInvalid3 { #[derive(Subdiagnostic)] #[suggestion(no_crate_example, code = "", style("foo"))] //~^ ERROR expected `= "xxx"` -//~| ERROR failed to resolve: maybe a missing crate `core`? -//~| NOTE maybe a missing crate `core`? +//~| ERROR cannot find item `core` +//~| NOTE you might be missing a crate named `core` struct SuggestionStyleInvalid4 { #[primary_span] sub: Span, diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr index fccf3757dbec6..ef9ed4c511d0a 100644 --- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr +++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr @@ -17,127 +17,127 @@ LL | #[foo] | ^ error: `#[label = ...]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:77:1 + --> $DIR/subdiagnostic-derive.rs:78:1 | LL | #[label = "..."] | ^ error: only `no_span` is a valid nested attribute - --> $DIR/subdiagnostic-derive.rs:86:9 + --> $DIR/subdiagnostic-derive.rs:87:9 | LL | #[label(bug = "...")] | ^^^ error: diagnostic slug must be first argument of a `#[label(...)]` attribute - --> $DIR/subdiagnostic-derive.rs:86:1 + --> $DIR/subdiagnostic-derive.rs:87:1 | LL | #[label(bug = "...")] | ^ error: only `no_span` is a valid nested attribute - --> $DIR/subdiagnostic-derive.rs:106:9 + --> $DIR/subdiagnostic-derive.rs:107:9 | LL | #[label(slug = 4)] | ^^^^ error: diagnostic slug must be first argument of a `#[label(...)]` attribute - --> $DIR/subdiagnostic-derive.rs:106:1 + --> $DIR/subdiagnostic-derive.rs:107:1 | LL | #[label(slug = 4)] | ^ error: only `no_span` is a valid nested attribute - --> $DIR/subdiagnostic-derive.rs:116:9 + --> $DIR/subdiagnostic-derive.rs:117:9 | LL | #[label(slug("..."))] | ^^^^ error: diagnostic slug must be first argument of a `#[label(...)]` attribute - --> $DIR/subdiagnostic-derive.rs:116:1 + --> $DIR/subdiagnostic-derive.rs:117:1 | LL | #[label(slug("..."))] | ^ error: diagnostic slug must be first argument of a `#[label(...)]` attribute - --> $DIR/subdiagnostic-derive.rs:136:1 + --> $DIR/subdiagnostic-derive.rs:137:1 | LL | #[label()] | ^ error: only `no_span` is a valid nested attribute - --> $DIR/subdiagnostic-derive.rs:145:27 + --> $DIR/subdiagnostic-derive.rs:146:27 | LL | #[label(no_crate_example, code = "...")] | ^^^^ error: only `no_span` is a valid nested attribute - --> $DIR/subdiagnostic-derive.rs:154:27 + --> $DIR/subdiagnostic-derive.rs:155:27 | LL | #[label(no_crate_example, applicability = "machine-applicable")] | ^^^^^^^^^^^^^ error: unsupported type attribute for subdiagnostic enum - --> $DIR/subdiagnostic-derive.rs:163:1 + --> $DIR/subdiagnostic-derive.rs:164:1 | LL | #[foo] | ^ error: `#[bar]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:177:5 + --> $DIR/subdiagnostic-derive.rs:179:5 | LL | #[bar] | ^ error: `#[bar = ...]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:189:5 + --> $DIR/subdiagnostic-derive.rs:192:5 | LL | #[bar = "..."] | ^ error: `#[bar = ...]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:201:5 + --> $DIR/subdiagnostic-derive.rs:205:5 | LL | #[bar = 4] | ^ error: `#[bar(...)]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:213:5 + --> $DIR/subdiagnostic-derive.rs:218:5 | LL | #[bar("...")] | ^ error: only `no_span` is a valid nested attribute - --> $DIR/subdiagnostic-derive.rs:225:13 + --> $DIR/subdiagnostic-derive.rs:231:13 | LL | #[label(code = "...")] | ^^^^ error: diagnostic slug must be first argument of a `#[label(...)]` attribute - --> $DIR/subdiagnostic-derive.rs:225:5 + --> $DIR/subdiagnostic-derive.rs:231:5 | LL | #[label(code = "...")] | ^ error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan` - --> $DIR/subdiagnostic-derive.rs:254:5 + --> $DIR/subdiagnostic-derive.rs:260:5 | LL | #[primary_span] | ^ error: label without `#[primary_span]` field - --> $DIR/subdiagnostic-derive.rs:251:1 + --> $DIR/subdiagnostic-derive.rs:257:1 | LL | #[label(no_crate_example)] | ^ error: `#[applicability]` is only valid on suggestions - --> $DIR/subdiagnostic-derive.rs:264:5 + --> $DIR/subdiagnostic-derive.rs:270:5 | LL | #[applicability] | ^ error: `#[bar]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:274:5 + --> $DIR/subdiagnostic-derive.rs:280:5 | LL | #[bar] | ^ @@ -145,13 +145,13 @@ LL | #[bar] = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes error: `#[bar = ...]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:285:5 + --> $DIR/subdiagnostic-derive.rs:292:5 | LL | #[bar = "..."] | ^ error: `#[bar(...)]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:296:5 + --> $DIR/subdiagnostic-derive.rs:304:5 | LL | #[bar("...")] | ^ @@ -159,97 +159,97 @@ LL | #[bar("...")] = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes error: a diagnostic slug must be the first argument to the attribute - --> $DIR/subdiagnostic-derive.rs:328:44 + --> $DIR/subdiagnostic-derive.rs:337:44 | LL | #[label(no_crate_example, no_crate::example)] | ^ error: specified multiple times - --> $DIR/subdiagnostic-derive.rs:341:5 + --> $DIR/subdiagnostic-derive.rs:350:5 | LL | #[primary_span] | ^ | note: previously specified here - --> $DIR/subdiagnostic-derive.rs:338:5 + --> $DIR/subdiagnostic-derive.rs:347:5 | LL | #[primary_span] | ^ error: subdiagnostic kind not specified - --> $DIR/subdiagnostic-derive.rs:347:8 + --> $DIR/subdiagnostic-derive.rs:356:8 | LL | struct AG { | ^^ error: specified multiple times - --> $DIR/subdiagnostic-derive.rs:384:46 + --> $DIR/subdiagnostic-derive.rs:393:46 | LL | #[suggestion(no_crate_example, code = "...", code = "...")] | ^^^^ | note: previously specified here - --> $DIR/subdiagnostic-derive.rs:384:32 + --> $DIR/subdiagnostic-derive.rs:393:32 | LL | #[suggestion(no_crate_example, code = "...", code = "...")] | ^^^^ error: specified multiple times - --> $DIR/subdiagnostic-derive.rs:402:5 + --> $DIR/subdiagnostic-derive.rs:411:5 | LL | #[applicability] | ^ | note: previously specified here - --> $DIR/subdiagnostic-derive.rs:399:5 + --> $DIR/subdiagnostic-derive.rs:408:5 | LL | #[applicability] | ^ error: the `#[applicability]` attribute can only be applied to fields of type `Applicability` - --> $DIR/subdiagnostic-derive.rs:412:5 + --> $DIR/subdiagnostic-derive.rs:421:5 | LL | #[applicability] | ^ error: suggestion without `code = "..."` - --> $DIR/subdiagnostic-derive.rs:425:1 + --> $DIR/subdiagnostic-derive.rs:434:1 | LL | #[suggestion(no_crate_example)] | ^ error: invalid applicability - --> $DIR/subdiagnostic-derive.rs:435:62 + --> $DIR/subdiagnostic-derive.rs:444:62 | LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")] | ^^^^^ error: suggestion without `#[primary_span]` field - --> $DIR/subdiagnostic-derive.rs:453:1 + --> $DIR/subdiagnostic-derive.rs:462:1 | LL | #[suggestion(no_crate_example, code = "...")] | ^ error: unsupported type attribute for subdiagnostic enum - --> $DIR/subdiagnostic-derive.rs:467:1 + --> $DIR/subdiagnostic-derive.rs:476:1 | LL | #[label] | ^ error: `var` doesn't refer to a field on this type - --> $DIR/subdiagnostic-derive.rs:487:39 + --> $DIR/subdiagnostic-derive.rs:496:39 | LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")] | ^^^^^^^ error: `var` doesn't refer to a field on this type - --> $DIR/subdiagnostic-derive.rs:506:43 + --> $DIR/subdiagnostic-derive.rs:515:43 | LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")] | ^^^^^^^ error: `#[suggestion_part]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:529:5 + --> $DIR/subdiagnostic-derive.rs:538:5 | LL | #[suggestion_part] | ^ @@ -257,7 +257,7 @@ LL | #[suggestion_part] = help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead error: `#[suggestion_part(...)]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:532:5 + --> $DIR/subdiagnostic-derive.rs:541:5 | LL | #[suggestion_part(code = "...")] | ^ @@ -265,13 +265,13 @@ LL | #[suggestion_part(code = "...")] = help: `#[suggestion_part(...)]` is only valid in multipart suggestions error: suggestion without `#[primary_span]` field - --> $DIR/subdiagnostic-derive.rs:526:1 + --> $DIR/subdiagnostic-derive.rs:535:1 | LL | #[suggestion(no_crate_example, code = "...")] | ^ error: invalid nested attribute - --> $DIR/subdiagnostic-derive.rs:541:42 + --> $DIR/subdiagnostic-derive.rs:550:42 | LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")] | ^^^^ @@ -279,25 +279,25 @@ LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "mac = help: only `no_span`, `style` and `applicability` are valid nested attributes error: multipart suggestion without any `#[suggestion_part(...)]` fields - --> $DIR/subdiagnostic-derive.rs:541:1 + --> $DIR/subdiagnostic-derive.rs:550:1 | LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")] | ^ error: `#[suggestion_part(...)]` attribute without `code = "..."` - --> $DIR/subdiagnostic-derive.rs:551:5 + --> $DIR/subdiagnostic-derive.rs:560:5 | LL | #[suggestion_part] | ^ error: `#[suggestion_part(...)]` attribute without `code = "..."` - --> $DIR/subdiagnostic-derive.rs:559:5 + --> $DIR/subdiagnostic-derive.rs:568:5 | LL | #[suggestion_part()] | ^ error: `#[primary_span]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:568:5 + --> $DIR/subdiagnostic-derive.rs:577:5 | LL | #[primary_span] | ^ @@ -305,97 +305,97 @@ LL | #[primary_span] = help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]` error: multipart suggestion without any `#[suggestion_part(...)]` fields - --> $DIR/subdiagnostic-derive.rs:565:1 + --> $DIR/subdiagnostic-derive.rs:574:1 | LL | #[multipart_suggestion(no_crate_example)] | ^ error: `#[suggestion_part(...)]` attribute without `code = "..."` - --> $DIR/subdiagnostic-derive.rs:576:5 + --> $DIR/subdiagnostic-derive.rs:585:5 | LL | #[suggestion_part] | ^ error: `#[suggestion_part(...)]` attribute without `code = "..."` - --> $DIR/subdiagnostic-derive.rs:579:5 + --> $DIR/subdiagnostic-derive.rs:588:5 | LL | #[suggestion_part()] | ^ error: `code` is the only valid nested attribute - --> $DIR/subdiagnostic-derive.rs:582:23 + --> $DIR/subdiagnostic-derive.rs:591:23 | LL | #[suggestion_part(foo = "bar")] | ^^^ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` - --> $DIR/subdiagnostic-derive.rs:587:5 + --> $DIR/subdiagnostic-derive.rs:596:5 | LL | #[suggestion_part(code = "...")] | ^ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` - --> $DIR/subdiagnostic-derive.rs:590:5 + --> $DIR/subdiagnostic-derive.rs:599:5 | LL | #[suggestion_part()] | ^ error: specified multiple times - --> $DIR/subdiagnostic-derive.rs:598:37 + --> $DIR/subdiagnostic-derive.rs:607:37 | LL | #[suggestion_part(code = "...", code = ",,,")] | ^^^^ | note: previously specified here - --> $DIR/subdiagnostic-derive.rs:598:23 + --> $DIR/subdiagnostic-derive.rs:607:23 | LL | #[suggestion_part(code = "...", code = ",,,")] | ^^^^ error: `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."` - --> $DIR/subdiagnostic-derive.rs:627:5 + --> $DIR/subdiagnostic-derive.rs:636:5 | LL | #[applicability] | ^ error: expected exactly one string literal for `code = ...` - --> $DIR/subdiagnostic-derive.rs:675:34 + --> $DIR/subdiagnostic-derive.rs:684:34 | LL | #[suggestion_part(code("foo"))] | ^ error: expected exactly one string literal for `code = ...` - --> $DIR/subdiagnostic-derive.rs:686:41 + --> $DIR/subdiagnostic-derive.rs:695:41 | LL | #[suggestion_part(code("foo", "bar"))] | ^ error: expected exactly one string literal for `code = ...` - --> $DIR/subdiagnostic-derive.rs:697:30 + --> $DIR/subdiagnostic-derive.rs:706:30 | LL | #[suggestion_part(code(3))] | ^ error: expected exactly one string literal for `code = ...` - --> $DIR/subdiagnostic-derive.rs:708:29 + --> $DIR/subdiagnostic-derive.rs:717:29 | LL | #[suggestion_part(code())] | ^ error: specified multiple times - --> $DIR/subdiagnostic-derive.rs:763:1 + --> $DIR/subdiagnostic-derive.rs:772:1 | LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")] | ^ | note: previously specified here - --> $DIR/subdiagnostic-derive.rs:763:1 + --> $DIR/subdiagnostic-derive.rs:772:1 | LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")] | ^ error: `#[suggestion_hidden(...)]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:772:1 + --> $DIR/subdiagnostic-derive.rs:781:1 | LL | #[suggestion_hidden(no_crate_example, code = "")] | ^ @@ -403,7 +403,7 @@ LL | #[suggestion_hidden(no_crate_example, code = "")] = help: Use `#[suggestion(..., style = "hidden")]` instead error: `#[suggestion_hidden(...)]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:780:1 + --> $DIR/subdiagnostic-derive.rs:789:1 | LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")] | ^ @@ -411,7 +411,7 @@ LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")] = help: Use `#[suggestion(..., style = "hidden")]` instead error: invalid suggestion style - --> $DIR/subdiagnostic-derive.rs:788:51 + --> $DIR/subdiagnostic-derive.rs:797:51 | LL | #[suggestion(no_crate_example, code = "", style = "foo")] | ^^^^^ @@ -419,25 +419,25 @@ LL | #[suggestion(no_crate_example, code = "", style = "foo")] = help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only` error: expected `= "xxx"` - --> $DIR/subdiagnostic-derive.rs:796:49 + --> $DIR/subdiagnostic-derive.rs:805:49 | LL | #[suggestion(no_crate_example, code = "", style = 42)] | ^ error: a diagnostic slug must be the first argument to the attribute - --> $DIR/subdiagnostic-derive.rs:804:48 + --> $DIR/subdiagnostic-derive.rs:813:48 | LL | #[suggestion(no_crate_example, code = "", style)] | ^ error: expected `= "xxx"` - --> $DIR/subdiagnostic-derive.rs:812:48 + --> $DIR/subdiagnostic-derive.rs:821:48 | LL | #[suggestion(no_crate_example, code = "", style("foo"))] | ^ error: `#[primary_span]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:825:5 + --> $DIR/subdiagnostic-derive.rs:834:5 | LL | #[primary_span] | ^ @@ -446,121 +446,121 @@ LL | #[primary_span] = help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead error: suggestion without `#[primary_span]` field - --> $DIR/subdiagnostic-derive.rs:822:1 + --> $DIR/subdiagnostic-derive.rs:831:1 | LL | #[suggestion(no_crate_example, code = "")] | ^ -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:96:9 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:97:9 | LL | #[label("...")] - | ^^^^^ maybe a missing crate `core`? + | ^^^^^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:312:1 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:321:1 | LL | union AC { - | ^^^^^ maybe a missing crate `core`? + | ^^^^^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:582:27 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:591:27 | LL | #[suggestion_part(foo = "bar")] - | ^ maybe a missing crate `core`? + | ^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:675:28 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:684:28 | LL | #[suggestion_part(code("foo"))] - | ^^^^^ maybe a missing crate `core`? + | ^^^^^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:686:28 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:695:28 | LL | #[suggestion_part(code("foo", "bar"))] - | ^^^^^ maybe a missing crate `core`? + | ^^^^^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:697:28 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:706:28 | LL | #[suggestion_part(code(3))] - | ^ maybe a missing crate `core`? + | ^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:720:30 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:729:30 | LL | #[suggestion_part(code = 3)] - | ^ maybe a missing crate `core`? + | ^ you might be missing a crate named `core` -error[E0433]: failed to resolve: maybe a missing crate `core`? - --> $DIR/subdiagnostic-derive.rs:812:48 +error[E0433]: cannot find item `core` in the crate root + --> $DIR/subdiagnostic-derive.rs:821:48 | LL | #[suggestion(no_crate_example, code = "", style("foo"))] - | ^ maybe a missing crate `core`? + | ^ you might be missing a crate named `core` -error: cannot find attribute `foo` in this scope +error: cannot find attribute `foo` in the crate root --> $DIR/subdiagnostic-derive.rs:67:3 | LL | #[foo] - | ^^^ + | ^^^ not found in the crate root -error: cannot find attribute `foo` in this scope - --> $DIR/subdiagnostic-derive.rs:163:3 +error: cannot find attribute `foo` in the crate root + --> $DIR/subdiagnostic-derive.rs:164:3 | LL | #[foo] - | ^^^ + | ^^^ not found in the crate root -error: cannot find attribute `bar` in this scope - --> $DIR/subdiagnostic-derive.rs:177:7 +error: cannot find attribute `bar` in enum `Q` + --> $DIR/subdiagnostic-derive.rs:179:7 | LL | #[bar] - | ^^^ + | ^^^ not found in enum `Q` -error: cannot find attribute `bar` in this scope - --> $DIR/subdiagnostic-derive.rs:189:7 +error: cannot find attribute `bar` in enum `R` + --> $DIR/subdiagnostic-derive.rs:192:7 | LL | #[bar = "..."] - | ^^^ + | ^^^ not found in enum `R` -error: cannot find attribute `bar` in this scope - --> $DIR/subdiagnostic-derive.rs:201:7 +error: cannot find attribute `bar` in enum `S` + --> $DIR/subdiagnostic-derive.rs:205:7 | LL | #[bar = 4] - | ^^^ + | ^^^ not found in enum `S` -error: cannot find attribute `bar` in this scope - --> $DIR/subdiagnostic-derive.rs:213:7 +error: cannot find attribute `bar` in enum `T` + --> $DIR/subdiagnostic-derive.rs:218:7 | LL | #[bar("...")] - | ^^^ + | ^^^ not found in enum `T` -error: cannot find attribute `bar` in this scope - --> $DIR/subdiagnostic-derive.rs:274:7 +error: cannot find attribute `bar` in the crate root + --> $DIR/subdiagnostic-derive.rs:280:7 | LL | #[bar] - | ^^^ + | ^^^ not found in the crate root -error: cannot find attribute `bar` in this scope - --> $DIR/subdiagnostic-derive.rs:285:7 +error: cannot find attribute `bar` in the crate root + --> $DIR/subdiagnostic-derive.rs:292:7 | LL | #[bar = "..."] - | ^^^ + | ^^^ not found in the crate root -error: cannot find attribute `bar` in this scope - --> $DIR/subdiagnostic-derive.rs:296:7 +error: cannot find attribute `bar` in the crate root + --> $DIR/subdiagnostic-derive.rs:304:7 | LL | #[bar("...")] - | ^^^ + | ^^^ not found in the crate root error[E0425]: cannot find value `slug` in module `crate::fluent_generated` - --> $DIR/subdiagnostic-derive.rs:126:9 + --> $DIR/subdiagnostic-derive.rs:127:9 | LL | #[label(slug)] - | ^^^^ not found in `crate::fluent_generated` + | ^^^^ not found in module `crate::fluent_generated` error[E0425]: cannot find value `__code_29` in this scope - --> $DIR/subdiagnostic-derive.rs:714:10 + --> $DIR/subdiagnostic-derive.rs:723:10 | LL | #[derive(Subdiagnostic)] | ^^^^^^^^^^^^^ not found in this scope diff --git a/tests/ui/annotate-snippet/missing-type.rs b/tests/ui/annotate-snippet/missing-type.rs index ea1c2521103e8..29834d2028ed7 100644 --- a/tests/ui/annotate-snippet/missing-type.rs +++ b/tests/ui/annotate-snippet/missing-type.rs @@ -1,5 +1,5 @@ //@ compile-flags: --error-format human-annotate-rs -Z unstable-options -//@ error-pattern:cannot find type `Iter` in this scope +//@ error-pattern:cannot find type `Iter` pub fn main() { let x: Iter; diff --git a/tests/ui/argument-suggestions/extern-fn-arg-names.rs b/tests/ui/argument-suggestions/extern-fn-arg-names.rs index df2fd6624cd0c..ed9697d7e5c52 100644 --- a/tests/ui/argument-suggestions/extern-fn-arg-names.rs +++ b/tests/ui/argument-suggestions/extern-fn-arg-names.rs @@ -1,6 +1,6 @@ extern "Rust" { fn dstfn(src: i32, dst: err); - //~^ ERROR cannot find type `err` in this scope + //~^ ERROR cannot find type `err` } fn main() { diff --git a/tests/ui/argument-suggestions/suggest-better-removing-issue-126246.rs b/tests/ui/argument-suggestions/suggest-better-removing-issue-126246.rs index fa1802283c39c..bdd91fdf6938d 100644 --- a/tests/ui/argument-suggestions/suggest-better-removing-issue-126246.rs +++ b/tests/ui/argument-suggestions/suggest-better-removing-issue-126246.rs @@ -8,14 +8,14 @@ fn add_two(x: i32, y: i32) -> i32 { fn main() { add_one(2, 2); //~ ERROR this function takes 1 argument but 2 arguments were supplied - add_one(no_such_local, 10); //~ ERROR cannot find value `no_such_local` in this scope + add_one(no_such_local, 10); //~ ERROR cannot find value `no_such_local` //~| ERROR this function takes 1 argument but 2 arguments were supplied - add_one(10, no_such_local); //~ ERROR cannot find value `no_such_local` in this scope + add_one(10, no_such_local); //~ ERROR cannot find value `no_such_local` //~| ERROR this function takes 1 argument but 2 arguments were supplied - add_two(10, no_such_local, 10); //~ ERROR cannot find value `no_such_local` in this scope + add_two(10, no_such_local, 10); //~ ERROR cannot find value `no_such_local` //~| ERROR this function takes 2 arguments but 3 arguments were supplied - add_two(no_such_local, 10, 10); //~ ERROR cannot find value `no_such_local` in this scope + add_two(no_such_local, 10, 10); //~ ERROR cannot find value `no_such_local` //~| ERROR this function takes 2 arguments but 3 arguments were supplied - add_two(10, 10, no_such_local); //~ ERROR cannot find value `no_such_local` in this scope + add_two(10, 10, no_such_local); //~ ERROR cannot find value `no_such_local` //~| ERROR this function takes 2 arguments but 3 arguments were supplied } diff --git a/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs b/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs index 03a1876fdc5a5..ea4141b27664e 100644 --- a/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs +++ b/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs @@ -24,8 +24,8 @@ fn main() { }; match does_not_exist { - //~^ ERROR cannot find value `does_not_exist` in this scope - [] => {} // ERROR cannot find value `does_not_exist` in this scope + //~^ ERROR cannot find value `does_not_exist` + [] => {} // ERROR cannot find value `does_not_exist` }; } diff --git a/tests/ui/asm/issue-113788.rs b/tests/ui/asm/issue-113788.rs index 3b11e253eda27..04a88999e5aff 100644 --- a/tests/ui/asm/issue-113788.rs +++ b/tests/ui/asm/issue-113788.rs @@ -2,6 +2,6 @@ //@ needs-asm-support //@ only-x86_64 fn main() { - let peb: *const PEB; //~ ERROR cannot find type `PEB` in this scope [E0412] + let peb: *const PEB; //~ ERROR cannot find type `PEB` unsafe { std::arch::asm!("mov {0}, fs:[0x30]", out(reg) peb); } } diff --git a/tests/ui/associated-consts/issue-93835.rs b/tests/ui/associated-consts/issue-93835.rs index 9cc33d53f9cd5..cf458b11135eb 100644 --- a/tests/ui/associated-consts/issue-93835.rs +++ b/tests/ui/associated-consts/issue-93835.rs @@ -2,10 +2,10 @@ fn e() { type_ascribe!(p, a>); - //~^ ERROR cannot find type `a` in this scope + //~^ ERROR cannot find type `a` //~| ERROR cannot find value //~| ERROR associated const equality - //~| ERROR cannot find trait `p` in this scope + //~| ERROR cannot find trait `p` } fn main() {} diff --git a/tests/ui/associated-item/issue-87638.fixed b/tests/ui/associated-item/issue-87638.fixed index 36184e7862557..a923dec25ade6 100644 --- a/tests/ui/associated-item/issue-87638.fixed +++ b/tests/ui/associated-item/issue-87638.fixed @@ -14,9 +14,9 @@ impl Trait for S { } fn main() { - let _: ::Target; //~ ERROR cannot find associated type `Output` in trait `Trait` + let _: ::Target; //~ ERROR cannot find associated type `Output` //~^ HELP maybe you meant this associated type - let _ = ::FOO; //~ ERROR cannot find method or associated constant `BAR` in trait `Trait` + let _ = ::FOO; //~ ERROR cannot find method or associated constant `BAR` //~^ HELP maybe you meant this associated constant } diff --git a/tests/ui/associated-item/issue-87638.rs b/tests/ui/associated-item/issue-87638.rs index 30187625ff3da..9ccd44aa43b43 100644 --- a/tests/ui/associated-item/issue-87638.rs +++ b/tests/ui/associated-item/issue-87638.rs @@ -14,9 +14,9 @@ impl Trait for S { } fn main() { - let _: ::Output; //~ ERROR cannot find associated type `Output` in trait `Trait` + let _: ::Output; //~ ERROR cannot find associated type `Output` //~^ HELP maybe you meant this associated type - let _ = ::BAR; //~ ERROR cannot find method or associated constant `BAR` in trait `Trait` + let _ = ::BAR; //~ ERROR cannot find method or associated constant `BAR` //~^ HELP maybe you meant this associated constant } diff --git a/tests/ui/associated-item/issue-87638.stderr b/tests/ui/associated-item/issue-87638.stderr index cf6083444b0e6..7f8e58f457889 100644 --- a/tests/ui/associated-item/issue-87638.stderr +++ b/tests/ui/associated-item/issue-87638.stderr @@ -7,7 +7,7 @@ LL | type Target; LL | let _: ::Output; | ^^^^^^ | | - | not found in `Trait` + | not found in trait `Trait` | help: maybe you meant this associated type: `Target` error[E0576]: cannot find method or associated constant `BAR` in trait `Trait` @@ -19,7 +19,7 @@ LL | const FOO: usize; LL | let _ = ::BAR; | ^^^ | | - | not found in `Trait` + | not found in trait `Trait` | help: maybe you meant this associated constant: `FOO` error: aborting due to 2 previous errors diff --git a/tests/ui/associated-path-shl.rs b/tests/ui/associated-path-shl.rs index 20a6fd83faa32..a9639063ee824 100644 --- a/tests/ui/associated-path-shl.rs +++ b/tests/ui/associated-path-shl.rs @@ -1,9 +1,9 @@ // Check that associated paths starting with `<<` are successfully parsed. fn main() { - let _: <::B>::C; //~ ERROR cannot find type `A` in this scope - let _ = <::B>::C; //~ ERROR cannot find type `A` in this scope - let <::B>::C; //~ ERROR cannot find type `A` in this scope - let 0 ..= <::B>::C; //~ ERROR cannot find type `A` in this scope - <::B>::C; //~ ERROR cannot find type `A` in this scope + let _: <::B>::C; //~ ERROR cannot find type `A` + let _ = <::B>::C; //~ ERROR cannot find type `A` + let <::B>::C; //~ ERROR cannot find type `A` + let 0 ..= <::B>::C; //~ ERROR cannot find type `A` + <::B>::C; //~ ERROR cannot find type `A` } diff --git a/tests/ui/associated-type-bounds/missing-trait-bound-for-assoc-fails.rs b/tests/ui/associated-type-bounds/missing-trait-bound-for-assoc-fails.rs index 07d0f8f8769e5..05343e853a9fc 100644 --- a/tests/ui/associated-type-bounds/missing-trait-bound-for-assoc-fails.rs +++ b/tests/ui/associated-type-bounds/missing-trait-bound-for-assoc-fails.rs @@ -2,7 +2,7 @@ fn foo(_m: M) where M::Item: Temp, - //~^ ERROR cannot find trait `Temp` in this scope [E0405] + //~^ ERROR cannot find trait `Temp` //~| ERROR associated type `Item` not found for `M` [E0220] { } diff --git a/tests/ui/associated-types/associated-types-eq-1.rs b/tests/ui/associated-types/associated-types-eq-1.rs index c371138ff45b1..f672f83d260a2 100644 --- a/tests/ui/associated-types/associated-types-eq-1.rs +++ b/tests/ui/associated-types/associated-types-eq-1.rs @@ -7,7 +7,7 @@ pub trait Foo { } fn foo2(x: I) { - let _: A = x.boo(); //~ ERROR cannot find type `A` in this scope + let _: A = x.boo(); //~ ERROR cannot find type `A` } pub fn main() {} diff --git a/tests/ui/associated-types/issue-19883.rs b/tests/ui/associated-types/issue-19883.rs index 5cf422043a585..ad63ea57e1ad0 100644 --- a/tests/ui/associated-types/issue-19883.rs +++ b/tests/ui/associated-types/issue-19883.rs @@ -7,7 +7,7 @@ trait From { trait To: Sized { fn to>(self) -> >::Dst - //~^ ERROR cannot find associated type `Dst` in trait `From` + //~^ ERROR cannot find associated type `Dst` { From::from(self) } diff --git a/tests/ui/associated-types/issue-19883.stderr b/tests/ui/associated-types/issue-19883.stderr index 35184e852cfe1..66615fba8362f 100644 --- a/tests/ui/associated-types/issue-19883.stderr +++ b/tests/ui/associated-types/issue-19883.stderr @@ -7,7 +7,7 @@ LL | type Output; LL | >::Dst | ^^^ | | - | not found in `From` + | not found in trait `From` | help: maybe you meant this associated type: `Output` error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-22037.rs b/tests/ui/associated-types/issue-22037.rs index b9eb41b6ea6e5..83c17132e7a31 100644 --- a/tests/ui/associated-types/issue-22037.rs +++ b/tests/ui/associated-types/issue-22037.rs @@ -1,7 +1,7 @@ trait A { type Output; fn a(&self) -> ::X; - //~^ ERROR cannot find associated type `X` in trait `A` + //~^ ERROR cannot find associated type `X` } impl A for u32 { diff --git a/tests/ui/associated-types/issue-22037.stderr b/tests/ui/associated-types/issue-22037.stderr index b02dad97d354e..568b49d3ad220 100644 --- a/tests/ui/associated-types/issue-22037.stderr +++ b/tests/ui/associated-types/issue-22037.stderr @@ -6,7 +6,7 @@ LL | type Output; LL | fn a(&self) -> ::X; | ^ | | - | not found in `A` + | not found in trait `A` | help: maybe you meant this associated type: `Output` error: aborting due to 1 previous error diff --git a/tests/ui/async-await/async-closures/tainted-body.rs b/tests/ui/async-await/async-closures/tainted-body.rs index e42d9d6e36ade..8ea499de9c7a4 100644 --- a/tests/ui/async-await/async-closures/tainted-body.rs +++ b/tests/ui/async-await/async-closures/tainted-body.rs @@ -7,7 +7,7 @@ fn main() { let _ = async || { used_fn(); - //~^ ERROR cannot find function `used_fn` in this scope + //~^ ERROR cannot find function `used_fn` 0 }; } diff --git a/tests/ui/async-await/async-fn/not-a-trait.rs b/tests/ui/async-await/async-fn/not-a-trait.rs index 0d22cbd2c0730..663bdcdaefc89 100644 --- a/tests/ui/async-await/async-fn/not-a-trait.rs +++ b/tests/ui/async-await/async-fn/not-a-trait.rs @@ -8,6 +8,6 @@ fn test(x: impl async S) {} //~^ ERROR expected trait, found struct `S` fn missing(x: impl async Missing) {} -//~^ ERROR cannot find trait `Missing` in this scope +//~^ ERROR cannot find trait `Missing` fn main() {} diff --git a/tests/ui/async-await/drop-order/drop-order-locals-are-hidden.rs b/tests/ui/async-await/drop-order/drop-order-locals-are-hidden.rs index d4897a1caf39d..a218877047866 100644 --- a/tests/ui/async-await/drop-order/drop-order-locals-are-hidden.rs +++ b/tests/ui/async-await/drop-order/drop-order-locals-are-hidden.rs @@ -1,13 +1,13 @@ //@ edition:2018 async fn foobar_async(x: u32, (a, _, _c): (u32, u32, u32), _: u32, _y: u32) { - assert_eq!(__arg1, (1, 2, 3)); //~ ERROR cannot find value `__arg1` in this scope [E0425] - assert_eq!(__arg2, 4); //~ ERROR cannot find value `__arg2` in this scope [E0425] + assert_eq!(__arg1, (1, 2, 3)); //~ ERROR cannot find value `__arg1` + assert_eq!(__arg2, 4); //~ ERROR cannot find value `__arg2` } async fn baz_async(ref mut x: u32, ref y: u32) { - assert_eq!(__arg0, 1); //~ ERROR cannot find value `__arg0` in this scope [E0425] - assert_eq!(__arg1, 2); //~ ERROR cannot find value `__arg1` in this scope [E0425] + assert_eq!(__arg0, 1); //~ ERROR cannot find value `__arg0` + assert_eq!(__arg1, 2); //~ ERROR cannot find value `__arg1` } fn main() {} diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.rs b/tests/ui/async-await/in-trait/return-not-existing-pair.rs index 3889efe1f2a3c..f3105e7c451bb 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-pair.rs +++ b/tests/ui/async-await/in-trait/return-not-existing-pair.rs @@ -3,7 +3,7 @@ trait MyTrait<'a, 'b, T> { async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); - //~^ ERROR: cannot find type `ConnImpl` in this scope [E0412] + //~^ ERROR: cannot find type `ConnImpl` } impl<'a, 'b, T, U> MyTrait for U { diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs index e45fca6de770f..fbbba38c57405 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs +++ b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs @@ -5,7 +5,7 @@ struct Wrapper(T); trait Foo { fn bar() -> Wrapper>; - //~^ ERROR: cannot find type `Missing` in this scope [E0412] + //~^ ERROR: cannot find type `Missing` } impl Foo for () { diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.rs b/tests/ui/attributes/field-attributes-vis-unresolved.rs index d1bd2a1e72724..04ed4283d294d 100644 --- a/tests/ui/attributes/field-attributes-vis-unresolved.rs +++ b/tests/ui/attributes/field-attributes-vis-unresolved.rs @@ -14,12 +14,12 @@ mod internal { struct S { #[rustfmt::skip] - pub(in nonexistent) field: u8 //~ ERROR failed to resolve + pub(in nonexistent) field: u8 //~ ERROR cannot find item `nonexistent` } struct Z( #[rustfmt::skip] - pub(in nonexistent) u8 //~ ERROR failed to resolve + pub(in nonexistent) u8 //~ ERROR cannot find item `nonexistent` ); fn main() {} diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.stderr b/tests/ui/attributes/field-attributes-vis-unresolved.stderr index 439762546381e..edd019ae3b8e7 100644 --- a/tests/ui/attributes/field-attributes-vis-unresolved.stderr +++ b/tests/ui/attributes/field-attributes-vis-unresolved.stderr @@ -1,16 +1,16 @@ -error[E0433]: failed to resolve: maybe a missing crate `nonexistent`? +error[E0433]: cannot find item `nonexistent` in this scope --> $DIR/field-attributes-vis-unresolved.rs:17:12 | LL | pub(in nonexistent) field: u8 - | ^^^^^^^^^^^ maybe a missing crate `nonexistent`? + | ^^^^^^^^^^^ you might be missing a crate named `nonexistent` | = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate -error[E0433]: failed to resolve: maybe a missing crate `nonexistent`? +error[E0433]: cannot find item `nonexistent` in this scope --> $DIR/field-attributes-vis-unresolved.rs:22:12 | LL | pub(in nonexistent) u8 - | ^^^^^^^^^^^ maybe a missing crate `nonexistent`? + | ^^^^^^^^^^^ you might be missing a crate named `nonexistent` | = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate diff --git a/tests/ui/attributes/issue-90873.rs b/tests/ui/attributes/issue-90873.rs index 53339ce7e28fb..47643c52fd2d3 100644 --- a/tests/ui/attributes/issue-90873.rs +++ b/tests/ui/attributes/issue-90873.rs @@ -1,9 +1,9 @@ #![u=||{static d=||1;}] //~^ attribute value must be a literal -//~| cannot find attribute `u` in this scope +//~| cannot find attribute `u` //~| missing type for `static` item #![a={impl std::ops::Neg for i8 {}}] //~^ ERROR attribute value must be a literal -//~| ERROR cannot find attribute `a` in this scope +//~| ERROR cannot find attribute `a` //~| ERROR `main` function not found in crate `issue_90873` diff --git a/tests/ui/attributes/issue-90873.stderr b/tests/ui/attributes/issue-90873.stderr index 5a8bbaf8ec191..a43d2bd93a5ca 100644 --- a/tests/ui/attributes/issue-90873.stderr +++ b/tests/ui/attributes/issue-90873.stderr @@ -10,17 +10,17 @@ error: attribute value must be a literal LL | #![a={impl std::ops::Neg for i8 {}}] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: cannot find attribute `u` in this scope +error: cannot find attribute `u` in the crate root --> $DIR/issue-90873.rs:1:4 | LL | #![u=||{static d=||1;}] - | ^ + | ^ not found in the crate root -error: cannot find attribute `a` in this scope +error: cannot find attribute `a` in the crate root --> $DIR/issue-90873.rs:6:4 | LL | #![a={impl std::ops::Neg for i8 {}}] - | ^ + | ^ not found in the crate root error[E0601]: `main` function not found in crate `issue_90873` --> $DIR/issue-90873.rs:6:37 diff --git a/tests/ui/attributes/key-value-expansion-scope.rs b/tests/ui/attributes/key-value-expansion-scope.rs index b6eab1571d490..6860b55a0ac0d 100644 --- a/tests/ui/attributes/key-value-expansion-scope.rs +++ b/tests/ui/attributes/key-value-expansion-scope.rs @@ -1,27 +1,27 @@ -#![doc = in_root!()] //~ WARN cannot find macro `in_root` in this scope +#![doc = in_root!()] //~ WARN cannot find macro `in_root` //~| WARN this was previously accepted by the compiler -#![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope -#![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` in this scope +#![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` +#![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` //~| WARN this was previously accepted by the compiler -#![doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope +#![doc = in_block!()] //~ ERROR cannot find macro `in_block` -#[doc = in_root!()] //~ ERROR cannot find macro `in_root` in this scope -#[doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope -#[doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape` in this scope -#[doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope +#[doc = in_root!()] //~ ERROR cannot find macro `in_root` +#[doc = in_mod!()] //~ ERROR cannot find macro `in_mod` +#[doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape` +#[doc = in_block!()] //~ ERROR cannot find macro `in_block` fn before() { - #![doc = in_root!()] //~ ERROR cannot find macro `in_root` in this scope - #![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope - #![doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape` in this scope - #![doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope + #![doc = in_root!()] //~ ERROR cannot find macro `in_root` + #![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` + #![doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape` + #![doc = in_block!()] //~ ERROR cannot find macro `in_block` } macro_rules! in_root { () => { "" } } -#[doc = in_mod!()] //~ WARN cannot find macro `in_mod` in this scope +#[doc = in_mod!()] //~ WARN cannot find macro `in_mod` //~| WARN this was previously accepted by the compiler mod macros_stay { - #![doc = in_mod!()] //~ WARN cannot find macro `in_mod` in this scope + #![doc = in_mod!()] //~ WARN cannot find macro `in_mod` //~| WARN this was previously accepted by the compiler macro_rules! in_mod { () => { "" } } @@ -33,10 +33,10 @@ mod macros_stay { } #[macro_use] -#[doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` in this scope +#[doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` //~| WARN this was previously accepted by the compiler mod macros_escape { - #![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` in this scope + #![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` //~| WARN this was previously accepted by the compiler macro_rules! in_mod_escape { () => { "" } } @@ -47,9 +47,9 @@ mod macros_escape { } } -#[doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope +#[doc = in_block!()] //~ ERROR cannot find macro `in_block` fn block() { - #![doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope + #![doc = in_block!()] //~ ERROR cannot find macro `in_block` macro_rules! in_block { () => { "" } } @@ -60,14 +60,14 @@ fn block() { } #[doc = in_root!()] // OK -#[doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope +#[doc = in_mod!()] //~ ERROR cannot find macro `in_mod` #[doc = in_mod_escape!()] // OK -#[doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope +#[doc = in_block!()] //~ ERROR cannot find macro `in_block` fn after() { #![doc = in_root!()] // OK - #![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope + #![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` #![doc = in_mod_escape!()] // OK - #![doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope + #![doc = in_block!()] //~ ERROR cannot find macro `in_block` } fn main() {} diff --git a/tests/ui/attributes/key-value-expansion-scope.stderr b/tests/ui/attributes/key-value-expansion-scope.stderr index d22fef7dd251e..2f80503dccdda 100644 --- a/tests/ui/attributes/key-value-expansion-scope.stderr +++ b/tests/ui/attributes/key-value-expansion-scope.stderr @@ -1,187 +1,187 @@ -error: cannot find macro `in_mod` in this scope +error: cannot find macro `in_mod` in the crate root --> $DIR/key-value-expansion-scope.rs:3:10 | LL | #![doc = in_mod!()] - | ^^^^^^ + | ^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_block` in this scope +error: cannot find macro `in_block` in the crate root --> $DIR/key-value-expansion-scope.rs:6:10 | LL | #![doc = in_block!()] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_root` in this scope +error: cannot find macro `in_root` in the crate root --> $DIR/key-value-expansion-scope.rs:8:9 | LL | #[doc = in_root!()] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_mod` in this scope +error: cannot find macro `in_mod` in the crate root --> $DIR/key-value-expansion-scope.rs:9:9 | LL | #[doc = in_mod!()] - | ^^^^^^ + | ^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_mod_escape` in this scope +error: cannot find macro `in_mod_escape` in the crate root --> $DIR/key-value-expansion-scope.rs:10:9 | LL | #[doc = in_mod_escape!()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_block` in this scope +error: cannot find macro `in_block` in the crate root --> $DIR/key-value-expansion-scope.rs:11:9 | LL | #[doc = in_block!()] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_root` in this scope +error: cannot find macro `in_root` in the crate root --> $DIR/key-value-expansion-scope.rs:13:14 | LL | #![doc = in_root!()] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_mod` in this scope +error: cannot find macro `in_mod` in the crate root --> $DIR/key-value-expansion-scope.rs:14:14 | LL | #![doc = in_mod!()] - | ^^^^^^ + | ^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_mod_escape` in this scope +error: cannot find macro `in_mod_escape` in the crate root --> $DIR/key-value-expansion-scope.rs:15:14 | LL | #![doc = in_mod_escape!()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_block` in this scope +error: cannot find macro `in_block` in the crate root --> $DIR/key-value-expansion-scope.rs:16:14 | LL | #![doc = in_block!()] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_block` in this scope +error: cannot find macro `in_block` in the crate root --> $DIR/key-value-expansion-scope.rs:50:9 | LL | #[doc = in_block!()] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_block` in this scope +error: cannot find macro `in_block` in the crate root --> $DIR/key-value-expansion-scope.rs:52:14 | LL | #![doc = in_block!()] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_mod` in this scope +error: cannot find macro `in_mod` in the crate root --> $DIR/key-value-expansion-scope.rs:63:9 | LL | #[doc = in_mod!()] - | ^^^^^^ + | ^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_block` in this scope +error: cannot find macro `in_block` in the crate root --> $DIR/key-value-expansion-scope.rs:65:9 | LL | #[doc = in_block!()] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_mod` in this scope +error: cannot find macro `in_mod` in the crate root --> $DIR/key-value-expansion-scope.rs:68:14 | LL | #![doc = in_mod!()] - | ^^^^^^ + | ^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `in_block` in this scope +error: cannot find macro `in_block` in the crate root --> $DIR/key-value-expansion-scope.rs:70:14 | LL | #![doc = in_block!()] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = help: have you added the `#[macro_use]` on the module/import? -warning: cannot find macro `in_root` in this scope +warning: cannot find macro `in_root` in the crate root --> $DIR/key-value-expansion-scope.rs:1:10 | LL | #![doc = in_root!()] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #124535 = help: import `macro_rules` with `use` to make it callable above its definition = note: `#[warn(out_of_scope_macro_calls)]` on by default -warning: cannot find macro `in_mod_escape` in this scope +warning: cannot find macro `in_mod_escape` in the crate root --> $DIR/key-value-expansion-scope.rs:4:10 | LL | #![doc = in_mod_escape!()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in the crate root | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #124535 = help: import `macro_rules` with `use` to make it callable above its definition -warning: cannot find macro `in_mod` in this scope +warning: cannot find macro `in_mod` in module `macros_stay` --> $DIR/key-value-expansion-scope.rs:21:9 | LL | #[doc = in_mod!()] - | ^^^^^^ + | ^^^^^^ not found in module `macros_stay` | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #124535 = help: import `macro_rules` with `use` to make it callable above its definition -warning: cannot find macro `in_mod` in this scope +warning: cannot find macro `in_mod` in module `macros_stay` --> $DIR/key-value-expansion-scope.rs:24:14 | LL | #![doc = in_mod!()] - | ^^^^^^ + | ^^^^^^ not found in module `macros_stay` | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #124535 = help: import `macro_rules` with `use` to make it callable above its definition -warning: cannot find macro `in_mod_escape` in this scope +warning: cannot find macro `in_mod_escape` in module `macros_escape` --> $DIR/key-value-expansion-scope.rs:36:9 | LL | #[doc = in_mod_escape!()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in module `macros_escape` | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #124535 = help: import `macro_rules` with `use` to make it callable above its definition -warning: cannot find macro `in_mod_escape` in this scope +warning: cannot find macro `in_mod_escape` in module `macros_escape` --> $DIR/key-value-expansion-scope.rs:39:14 | LL | #![doc = in_mod_escape!()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in module `macros_escape` | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #124535 diff --git a/tests/ui/attributes/main-removed-1.rs b/tests/ui/attributes/main-removed-1.rs index 0e887469d4466..36cec5c6d958f 100644 --- a/tests/ui/attributes/main-removed-1.rs +++ b/tests/ui/attributes/main-removed-1.rs @@ -1,2 +1,2 @@ -#[main] //~ ERROR cannot find attribute `main` in this scope +#[main] //~ ERROR cannot find attribute `main` fn main() {} diff --git a/tests/ui/attributes/main-removed-1.stderr b/tests/ui/attributes/main-removed-1.stderr index fda28772e429b..96e061403ecbe 100644 --- a/tests/ui/attributes/main-removed-1.stderr +++ b/tests/ui/attributes/main-removed-1.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `main` in this scope +error: cannot find attribute `main` in the crate root --> $DIR/main-removed-1.rs:1:3 | LL | #[main] - | ^^^^ + | ^^^^ not found in the crate root | = note: `main` is in scope, but it is a function, not an attribute diff --git a/tests/ui/attributes/obsolete-attr.rs b/tests/ui/attributes/obsolete-attr.rs index 7019abcaffbae..ae048eda531dd 100644 --- a/tests/ui/attributes/obsolete-attr.rs +++ b/tests/ui/attributes/obsolete-attr.rs @@ -1,9 +1,9 @@ // Obsolete attributes fall back to unstable custom attributes. #[ab_isize = "stdcall"] extern "C" {} -//~^ ERROR cannot find attribute `ab_isize` in this scope +//~^ ERROR cannot find attribute `ab_isize` #[fixed_stack_segment] fn f() {} -//~^ ERROR cannot find attribute `fixed_stack_segment` in this scope +//~^ ERROR cannot find attribute `fixed_stack_segment` fn main() {} diff --git a/tests/ui/attributes/obsolete-attr.stderr b/tests/ui/attributes/obsolete-attr.stderr index 37c1cd0c94df2..a97b9bcfb693d 100644 --- a/tests/ui/attributes/obsolete-attr.stderr +++ b/tests/ui/attributes/obsolete-attr.stderr @@ -1,14 +1,14 @@ -error: cannot find attribute `fixed_stack_segment` in this scope +error: cannot find attribute `fixed_stack_segment` in the crate root --> $DIR/obsolete-attr.rs:6:3 | LL | #[fixed_stack_segment] fn f() {} - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `ab_isize` in this scope +error: cannot find attribute `ab_isize` in the crate root --> $DIR/obsolete-attr.rs:3:3 | LL | #[ab_isize = "stdcall"] extern "C" {} - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/attributes/unknown-attr.rs b/tests/ui/attributes/unknown-attr.rs index 70fef04e95c67..ff6969c2426b4 100644 --- a/tests/ui/attributes/unknown-attr.rs +++ b/tests/ui/attributes/unknown-attr.rs @@ -3,10 +3,10 @@ #![feature(custom_inner_attributes)] #![mutable_doc] -//~^ ERROR cannot find attribute `mutable_doc` in this scope +//~^ ERROR cannot find attribute `mutable_doc` #[dance] mod a {} -//~^ ERROR cannot find attribute `dance` in this scope +//~^ ERROR cannot find attribute `dance` #[dance] fn main() {} -//~^ ERROR cannot find attribute `dance` in this scope +//~^ ERROR cannot find attribute `dance` diff --git a/tests/ui/attributes/unknown-attr.stderr b/tests/ui/attributes/unknown-attr.stderr index 85c227dc83aa6..a934737a2a4fe 100644 --- a/tests/ui/attributes/unknown-attr.stderr +++ b/tests/ui/attributes/unknown-attr.stderr @@ -1,20 +1,20 @@ -error: cannot find attribute `mutable_doc` in this scope +error: cannot find attribute `mutable_doc` in the crate root --> $DIR/unknown-attr.rs:5:4 | LL | #![mutable_doc] - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `dance` in this scope +error: cannot find attribute `dance` in the crate root --> $DIR/unknown-attr.rs:8:3 | LL | #[dance] mod a {} - | ^^^^^ + | ^^^^^ not found in the crate root -error: cannot find attribute `dance` in this scope +error: cannot find attribute `dance` in the crate root --> $DIR/unknown-attr.rs:11:3 | LL | #[dance] fn main() {} - | ^^^^^ + | ^^^^^ not found in the crate root error: aborting due to 3 previous errors diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs index a6c0ea578f25a..de94328ba7320 100644 --- a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs @@ -2,7 +2,7 @@ #[unsafe(unsafe(no_mangle))] //~^ ERROR expected identifier, found keyword `unsafe` -//~| ERROR cannot find attribute `r#unsafe` in this scope +//~| ERROR cannot find attribute `r#unsafe` //~| ERROR `r#unsafe` is not an unsafe attribute fn a() {} diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr index ea82bac6df07b..c359567fd1d3b 100644 --- a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr @@ -17,11 +17,11 @@ LL | #[unsafe(unsafe(no_mangle))] | = note: extraneous unsafe is not allowed in attributes -error: cannot find attribute `r#unsafe` in this scope +error: cannot find attribute `r#unsafe` in the crate root --> $DIR/double-unsafe-attributes.rs:3:10 | LL | #[unsafe(unsafe(no_mangle))] - | ^^^^^^ + | ^^^^^^ not found in the crate root error: aborting due to 3 previous errors diff --git a/tests/ui/attributes/unused-item-in-attr.rs b/tests/ui/attributes/unused-item-in-attr.rs index fda0a5d6a3f16..460e85569865c 100644 --- a/tests/ui/attributes/unused-item-in-attr.rs +++ b/tests/ui/attributes/unused-item-in-attr.rs @@ -1,6 +1,6 @@ #[w = { extern crate alloc; }] //~^ ERROR attribute value must be a literal -//~| ERROR cannot find attribute `w` in this scope +//~| ERROR cannot find attribute `w` fn f() {} fn main() {} diff --git a/tests/ui/attributes/unused-item-in-attr.stderr b/tests/ui/attributes/unused-item-in-attr.stderr index 84130965d31cf..b5d58103d07ef 100644 --- a/tests/ui/attributes/unused-item-in-attr.stderr +++ b/tests/ui/attributes/unused-item-in-attr.stderr @@ -4,11 +4,11 @@ error: attribute value must be a literal LL | #[w = { extern crate alloc; }] | ^^^^^^^^^^^^^^^^^^^^^^^ -error: cannot find attribute `w` in this scope +error: cannot find attribute `w` in the crate root --> $DIR/unused-item-in-attr.rs:1:3 | LL | #[w = { extern crate alloc; }] - | ^ + | ^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs b/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs index cf927e34fb418..6d11af54ec49f 100644 --- a/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs +++ b/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs @@ -4,9 +4,9 @@ fn main() { let mut a = E::StructVar { boxed: Box::new(5_i32) }; - //~^ ERROR failed to resolve: use of undeclared type `E` + //~^ ERROR cannot find item `E` match a { E::StructVar { box boxed } => { } - //~^ ERROR failed to resolve: use of undeclared type `E` + //~^ ERROR cannot find item `E` } } diff --git a/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr b/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr index 349546606a57e..3b7b60895680c 100644 --- a/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr +++ b/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `E` +error[E0433]: cannot find item `E` in this scope --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17 | LL | let mut a = E::StructVar { boxed: Box::new(5_i32) }; @@ -7,7 +7,7 @@ LL | let mut a = E::StructVar { boxed: Box::new(5_i32) }; | use of undeclared type `E` | help: a trait with a similar name exists: `Eq` -error[E0433]: failed to resolve: use of undeclared type `E` +error[E0433]: cannot find item `E` in this scope --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9 | LL | E::StructVar { box boxed } => { } diff --git a/tests/ui/c-variadic/issue-86053-1.rs b/tests/ui/c-variadic/issue-86053-1.rs index f952235be9811..ce80375dbd51a 100644 --- a/tests/ui/c-variadic/issue-86053-1.rs +++ b/tests/ui/c-variadic/issue-86053-1.rs @@ -1,7 +1,7 @@ // Regression test for the ICE described in issue #86053. //@ error-pattern:unexpected `self` parameter in function //@ error-pattern:`...` must be the last argument of a C-variadic function -//@ error-pattern:cannot find type `F` in this scope +//@ error-pattern:cannot find type `F` #![feature(c_variadic)] diff --git a/tests/ui/cast/ice-cast-type-with-error-124848.rs b/tests/ui/cast/ice-cast-type-with-error-124848.rs index 9b3732b02db43..e8b99e5878e2a 100644 --- a/tests/ui/cast/ice-cast-type-with-error-124848.rs +++ b/tests/ui/cast/ice-cast-type-with-error-124848.rs @@ -6,7 +6,7 @@ use std::cell::Cell; struct MyType<'a>(Cell>>, Pin); //~^ ERROR use of undeclared lifetime name `'unpinned` -//~| ERROR cannot find type `Pin` in this scope +//~| ERROR cannot find type `Pin` fn main() { let mut unpinned = MyType(Cell::new(None)); diff --git a/tests/ui/cfg/diagnostics-cross-crate.rs b/tests/ui/cfg/diagnostics-cross-crate.rs index 77dd91d6c2823..2a2c6d0ef33e8 100644 --- a/tests/ui/cfg/diagnostics-cross-crate.rs +++ b/tests/ui/cfg/diagnostics-cross-crate.rs @@ -5,27 +5,27 @@ extern crate cfged_out; fn main() { // There is no uwu at this path - no diagnostic. cfged_out::uwu(); //~ ERROR cannot find function - //~^ NOTE not found in `cfged_out` + //~^ NOTE not found in crate `cfged_out` // It does exist here - diagnostic. cfged_out::inner::uwu(); //~ ERROR cannot find function //~^ NOTE found an item that was configured out - //~| NOTE not found in `cfged_out::inner` + //~| NOTE not found in module `cfged_out::inner` // The module isn't found - we would like to get a diagnostic, but currently don't due to // the awkward way the resolver diagnostics are currently implemented. - cfged_out::inner::doesnt_exist::hello(); //~ ERROR failed to resolve + cfged_out::inner::doesnt_exist::hello(); //~ ERROR cannot find item `doesnt_exist` //~^ NOTE could not find `doesnt_exist` in `inner` //~| NOTE found an item that was configured out // It should find the one in the right module, not the wrong one. cfged_out::inner::right::meow(); //~ ERROR cannot find function //~^ NOTE found an item that was configured out - //~| NOTE not found in `cfged_out::inner::right + //~| NOTE not found in module `cfged_out::inner::right //~| NOTE the item is gated behind the `what-a-cool-feature` feature // Exists in the crate root - diagnostic. cfged_out::vanished(); //~ ERROR cannot find function //~^ NOTE found an item that was configured out - //~| NOTE not found in `cfged_out` + //~| NOTE not found in crate `cfged_out` } diff --git a/tests/ui/cfg/diagnostics-cross-crate.stderr b/tests/ui/cfg/diagnostics-cross-crate.stderr index 8a238f3640445..ff4327f7dd634 100644 --- a/tests/ui/cfg/diagnostics-cross-crate.stderr +++ b/tests/ui/cfg/diagnostics-cross-crate.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner` +error[E0433]: cannot find item `doesnt_exist` in module `inner` --> $DIR/diagnostics-cross-crate.rs:17:23 | LL | cfged_out::inner::doesnt_exist::hello(); @@ -14,13 +14,13 @@ error[E0425]: cannot find function `uwu` in crate `cfged_out` --> $DIR/diagnostics-cross-crate.rs:7:16 | LL | cfged_out::uwu(); - | ^^^ not found in `cfged_out` + | ^^^ not found in crate `cfged_out` error[E0425]: cannot find function `uwu` in module `cfged_out::inner` --> $DIR/diagnostics-cross-crate.rs:11:23 | LL | cfged_out::inner::uwu(); - | ^^^ not found in `cfged_out::inner` + | ^^^ not found in module `cfged_out::inner` | note: found an item that was configured out --> $DIR/auxiliary/cfged_out.rs:3:12 @@ -32,7 +32,7 @@ error[E0425]: cannot find function `meow` in module `cfged_out::inner::right` --> $DIR/diagnostics-cross-crate.rs:22:30 | LL | cfged_out::inner::right::meow(); - | ^^^^ not found in `cfged_out::inner::right` + | ^^^^ not found in module `cfged_out::inner::right` | note: found an item that was configured out --> $DIR/auxiliary/cfged_out.rs:17:16 @@ -45,7 +45,7 @@ error[E0425]: cannot find function `vanished` in crate `cfged_out` --> $DIR/diagnostics-cross-crate.rs:28:16 | LL | cfged_out::vanished(); - | ^^^^^^^^ not found in `cfged_out` + | ^^^^^^^^ not found in crate `cfged_out` | note: found an item that was configured out --> $DIR/auxiliary/cfged_out.rs:22:8 diff --git a/tests/ui/cfg/diagnostics-not-a-def.stderr b/tests/ui/cfg/diagnostics-not-a-def.stderr index 51c1c03640f68..7018064b178ae 100644 --- a/tests/ui/cfg/diagnostics-not-a-def.stderr +++ b/tests/ui/cfg/diagnostics-not-a-def.stderr @@ -2,7 +2,7 @@ error[E0425]: cannot find function `i_am_not` in module `inner` --> $DIR/diagnostics-not-a-def.rs:12:12 | LL | inner::i_am_not(); - | ^^^^^^^^ not found in `inner` + | ^^^^^^^^ not found in module `inner` error: aborting due to 1 previous error diff --git a/tests/ui/cfg/diagnostics-reexport.rs b/tests/ui/cfg/diagnostics-reexport.rs index 9b3208cb87cf9..71ded444bc41c 100644 --- a/tests/ui/cfg/diagnostics-reexport.rs +++ b/tests/ui/cfg/diagnostics-reexport.rs @@ -36,5 +36,5 @@ mod b { fn main() { // There is no uwu at this path - no diagnostic. inner::uwu(); //~ ERROR cannot find function - //~^ NOTE not found in `inner` + //~^ NOTE not found in module `inner` } diff --git a/tests/ui/cfg/diagnostics-reexport.stderr b/tests/ui/cfg/diagnostics-reexport.stderr index e25b7cf86e210..4d9b50e6c3416 100644 --- a/tests/ui/cfg/diagnostics-reexport.stderr +++ b/tests/ui/cfg/diagnostics-reexport.stderr @@ -33,7 +33,7 @@ error[E0425]: cannot find function `uwu` in module `inner` --> $DIR/diagnostics-reexport.rs:38:12 | LL | inner::uwu(); - | ^^^ not found in `inner` + | ^^^ not found in module `inner` | note: found an item that was configured out --> $DIR/diagnostics-reexport.rs:8:20 diff --git a/tests/ui/cfg/diagnostics-same-crate.rs b/tests/ui/cfg/diagnostics-same-crate.rs index b2a0fb58dd6b5..2304fa5350a18 100644 --- a/tests/ui/cfg/diagnostics-same-crate.rs +++ b/tests/ui/cfg/diagnostics-same-crate.rs @@ -32,7 +32,7 @@ mod placeholder { //~| NOTE no `doesnt_exist` in `inner` use super::inner::doesnt_exist::hi; //~^ ERROR unresolved import `super::inner::doesnt_exist` - //~| NOTE could not find `doesnt_exist` in `inner` + //~| NOTE could not find `doesnt_exist` } #[cfg(i_dont_exist_and_you_can_do_nothing_about_it)] @@ -41,25 +41,25 @@ pub fn vanished() {} fn main() { // There is no uwu at this path - no diagnostic. uwu(); //~ ERROR cannot find function - //~^ NOTE not found in this scope + //~^ NOTE not found // It does exist here - diagnostic. inner::uwu(); //~ ERROR cannot find function - //~| NOTE not found in `inner` + //~| NOTE not found in module `inner` // The module isn't found - we would like to get a diagnostic, but currently don't due to // the awkward way the resolver diagnostics are currently implemented. - inner::doesnt_exist::hello(); //~ ERROR failed to resolve + inner::doesnt_exist::hello(); //~ ERROR cannot find item `doesnt_exist` //~| NOTE could not find `doesnt_exist` in `inner` // It should find the one in the right module, not the wrong one. inner::right::meow(); //~ ERROR cannot find function - //~| NOTE not found in `inner::right + //~| NOTE not found in module `inner::right //~| NOTE the item is gated behind the `what-a-cool-feature` feature // Exists in the crate root - we would generally want a diagnostic, // but currently don't have one. // Not that it matters much though, this is highly unlikely to confuse anyone. vanished(); //~ ERROR cannot find function - //~^ NOTE not found in this scope + //~^ NOTE not found } diff --git a/tests/ui/cfg/diagnostics-same-crate.stderr b/tests/ui/cfg/diagnostics-same-crate.stderr index 86421736b8c60..1f15d087f59cb 100644 --- a/tests/ui/cfg/diagnostics-same-crate.stderr +++ b/tests/ui/cfg/diagnostics-same-crate.stderr @@ -22,7 +22,7 @@ note: found an item that was configured out LL | pub mod doesnt_exist { | ^^^^^^^^^^^^ -error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner` +error[E0433]: cannot find item `doesnt_exist` in module `inner` --> $DIR/diagnostics-same-crate.rs:52:12 | LL | inner::doesnt_exist::hello(); @@ -38,7 +38,7 @@ error[E0425]: cannot find function `uwu` in module `inner` --> $DIR/diagnostics-same-crate.rs:47:12 | LL | inner::uwu(); - | ^^^ not found in `inner` + | ^^^ not found in module `inner` | note: found an item that was configured out --> $DIR/diagnostics-same-crate.rs:5:12 @@ -50,7 +50,7 @@ error[E0425]: cannot find function `meow` in module `inner::right` --> $DIR/diagnostics-same-crate.rs:56:19 | LL | inner::right::meow(); - | ^^^^ not found in `inner::right` + | ^^^^ not found in module `inner::right` | note: found an item that was configured out --> $DIR/diagnostics-same-crate.rs:24:16 diff --git a/tests/ui/closures/issue-78720.rs b/tests/ui/closures/issue-78720.rs index 81af030fe5568..5fa9d805774d1 100644 --- a/tests/ui/closures/issue-78720.rs +++ b/tests/ui/closures/issue-78720.rs @@ -11,7 +11,7 @@ trait FilterBase2 { struct Map2 { _func: F, - //~^ ERROR cannot find type `F` in this scope + //~^ ERROR cannot find type `F` } impl FilterBase2 for F {} diff --git a/tests/ui/closures/issue-90871.rs b/tests/ui/closures/issue-90871.rs index 7ce061cd388c9..e8b57a3e76883 100644 --- a/tests/ui/closures/issue-90871.rs +++ b/tests/ui/closures/issue-90871.rs @@ -2,6 +2,6 @@ fn main() { type_ascribe!(2, n([u8; || 1])) - //~^ ERROR cannot find type `n` in this scope + //~^ ERROR cannot find type `n` //~| ERROR mismatched types } diff --git a/tests/ui/coercion/type-errors.rs b/tests/ui/coercion/type-errors.rs index a86789907a055..4d1f6fec30bcb 100644 --- a/tests/ui/coercion/type-errors.rs +++ b/tests/ui/coercion/type-errors.rs @@ -3,7 +3,7 @@ // shortcutting and returning success, because we need the adjustments for building the MIR. pub fn has_error() -> TypeError {} -//~^ ERROR cannot find type `TypeError` in this scope +//~^ ERROR cannot find type `TypeError` // https://github.com/rust-lang/rust/issues/120884 // Casting a function item to a data pointer in valid in HIR, but invalid in MIR. @@ -16,11 +16,11 @@ pub fn cast() -> *const u8 { // https://github.com/rust-lang/rust/issues/120945 // This one ICEd, because we skipped the builtin deref from `&TypeError` to `TypeError`. pub fn autoderef_source(e: &TypeError) { - //~^ ERROR cannot find type `TypeError` in this scope + //~^ ERROR cannot find type `TypeError` autoderef_target(e) } pub fn autoderef_target(_: &TypeError) {} -//~^ ERROR cannot find type `TypeError` in this scope +//~^ ERROR cannot find type `TypeError` fn main() {} diff --git a/tests/ui/coherence/conflicting-impl-with-err.rs b/tests/ui/coherence/conflicting-impl-with-err.rs index 3e0234b874d7b..940827119d3c1 100644 --- a/tests/ui/coherence/conflicting-impl-with-err.rs +++ b/tests/ui/coherence/conflicting-impl-with-err.rs @@ -1,8 +1,8 @@ struct ErrorKind; struct Error(ErrorKind); -impl From for Error { //~ ERROR failed to resolve - fn from(_: nope::Thing) -> Self { //~ ERROR failed to resolve +impl From for Error { //~ ERROR cannot find item `nope` + fn from(_: nope::Thing) -> Self { //~ ERROR cannot find item `nope` unimplemented!() } } diff --git a/tests/ui/coherence/conflicting-impl-with-err.stderr b/tests/ui/coherence/conflicting-impl-with-err.stderr index 3009b452dc7a0..7eef802ca67eb 100644 --- a/tests/ui/coherence/conflicting-impl-with-err.stderr +++ b/tests/ui/coherence/conflicting-impl-with-err.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `nope` +error[E0433]: cannot find item `nope` in this scope --> $DIR/conflicting-impl-with-err.rs:4:11 | LL | impl From for Error { | ^^^^ use of undeclared crate or module `nope` -error[E0433]: failed to resolve: use of undeclared crate or module `nope` +error[E0433]: cannot find item `nope` in this scope --> $DIR/conflicting-impl-with-err.rs:5:16 | LL | fn from(_: nope::Thing) -> Self { diff --git a/tests/ui/coherence/illegal-copy-bad-projection.rs b/tests/ui/coherence/illegal-copy-bad-projection.rs index 797443a0abe5a..bd8a00ef06455 100644 --- a/tests/ui/coherence/illegal-copy-bad-projection.rs +++ b/tests/ui/coherence/illegal-copy-bad-projection.rs @@ -4,7 +4,7 @@ trait AsPtr { impl AsPtr for () { type Ptr = *const void; - //~^ ERROR cannot find type `void` in this scope + //~^ ERROR cannot find type `void` } #[derive(Copy, Clone)] diff --git a/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs b/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs index 45b757e928302..14fa0ad847e24 100644 --- a/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs +++ b/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs @@ -1,7 +1,7 @@ macro_rules! foo { () => { #[cfg_attr(all(), unknown)] - //~^ ERROR cannot find attribute `unknown` in this scope + //~^ ERROR cannot find attribute `unknown` fn foo() {} } } diff --git a/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr b/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr index c91ad128d6e57..8ee90293522ee 100644 --- a/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `unknown` in this scope +error: cannot find attribute `unknown` in the crate root --> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27 | LL | #[cfg_attr(all(), unknown)] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root ... LL | foo!(); | ------ in this macro invocation diff --git a/tests/ui/conditional-compilation/cfg-generic-params.rs b/tests/ui/conditional-compilation/cfg-generic-params.rs index 4bb8f8ae94f69..dccd9380eb468 100644 --- a/tests/ui/conditional-compilation/cfg-generic-params.rs +++ b/tests/ui/conditional-compilation/cfg-generic-params.rs @@ -17,22 +17,22 @@ struct WhereBad where for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> u8: Copy; fn f_lt_no<#[cfg_attr(FALSE, unknown)] 'a>() {} // OK fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {} -//~^ ERROR cannot find attribute `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` fn f_ty_no<#[cfg_attr(FALSE, unknown)] T>() {} // OK fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {} -//~^ ERROR cannot find attribute `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` type FnNo = for<#[cfg_attr(FALSE, unknown)] 'a> fn(); // OK type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn(); -//~^ ERROR cannot find attribute `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` type PolyNo = dyn for<#[cfg_attr(FALSE, unknown)] 'a> Copy; // OK type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy; -//~^ ERROR cannot find attribute `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` struct WhereNo where for<#[cfg_attr(FALSE, unknown)] 'a> u8: Copy; // OK struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy; -//~^ ERROR cannot find attribute `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` fn main() { f_lt::<'static>(); diff --git a/tests/ui/conditional-compilation/cfg-generic-params.stderr b/tests/ui/conditional-compilation/cfg-generic-params.stderr index 563616be36bc1..aef384ed88e0a 100644 --- a/tests/ui/conditional-compilation/cfg-generic-params.stderr +++ b/tests/ui/conditional-compilation/cfg-generic-params.stderr @@ -1,32 +1,32 @@ -error: cannot find attribute `unknown` in this scope +error: cannot find attribute `unknown` in the crate root --> $DIR/cfg-generic-params.rs:19:29 | LL | fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {} - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `unknown` in this scope +error: cannot find attribute `unknown` in the crate root --> $DIR/cfg-generic-params.rs:22:29 | LL | fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {} - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `unknown` in this scope +error: cannot find attribute `unknown` in the crate root --> $DIR/cfg-generic-params.rs:26:34 | LL | type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn(); - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `unknown` in this scope +error: cannot find attribute `unknown` in the crate root --> $DIR/cfg-generic-params.rs:30:40 | LL | type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy; - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `unknown` in this scope +error: cannot find attribute `unknown` in the crate root --> $DIR/cfg-generic-params.rs:34:43 | LL | struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy; - | ^^^^^^^ + | ^^^^^^^ not found in the crate root error[E0658]: only lifetime parameters can be used in this context --> $DIR/cfg-generic-params.rs:7:48 diff --git a/tests/ui/conditional-compilation/test-cfg.rs b/tests/ui/conditional-compilation/test-cfg.rs index adbbc309be447..700fb3954c40b 100644 --- a/tests/ui/conditional-compilation/test-cfg.rs +++ b/tests/ui/conditional-compilation/test-cfg.rs @@ -4,5 +4,5 @@ fn foo() {} fn main() { - foo(); //~ ERROR cannot find function `foo` in this scope + foo(); //~ ERROR cannot find function `foo` } diff --git a/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs b/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs index 29ad935c0149c..76f0ce033a07a 100644 --- a/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs +++ b/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs @@ -4,7 +4,7 @@ #![allow(incomplete_features)] pub struct A {} -//~^ ERROR: cannot find value `x` in this scope +//~^ ERROR: cannot find value `x` //~| ERROR: `[usize; x]` is forbidden as the type of a const generic parameter impl A<2> { diff --git a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs index 4bea3ad87f5ed..0ca496880b346 100644 --- a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs +++ b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs @@ -9,7 +9,7 @@ use core::ops::SubAssign; fn f( data: &[(); { let f: F = async { 1 }; - //~^ ERROR cannot find type `F` in this scope + //~^ ERROR cannot find type `F` 1 }], diff --git a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs index 4ba696f4ae080..8550bf7d19f16 100644 --- a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs +++ b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs @@ -5,13 +5,13 @@ fn bug(&self) //~^ ERROR `self` parameter is only allowed in associated functions -//~^^ ERROR cannot find type `Nat` in this scope +//~^^ ERROR cannot find type `Nat` where for [(); COT::BYTES]:, //~^ ERROR only lifetime parameters can be used in this context //~^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders //~^^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders - //~^^^^ ERROR failed to resolve: use of undeclared type `COT` + //~^^^^ ERROR cannot find item `COT` { } diff --git a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr index ee0ec38ab0631..52260fec4654a 100644 --- a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr +++ b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr @@ -34,7 +34,7 @@ error: defaults for generic parameters are not allowed in `for<...>` binders LL | for [(); COT::BYTES]:, | ^^^^^^^ -error[E0433]: failed to resolve: use of undeclared type `COT` +error[E0433]: cannot find item `COT` in this scope --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:43 | LL | for [(); COT::BYTES]:, diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs index c6dd981cced00..c7d3de8b8c375 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs @@ -9,6 +9,6 @@ impl EntriesBuffer { } struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>); -//~^ ERROR: cannot find value `HashesEntryLEN` in this scope +//~^ ERROR: cannot find value `HashesEntryLEN` fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs index 51cae20df84d4..1bf05041477b2 100644 --- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs +++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs @@ -11,8 +11,8 @@ mod v20 { const v2: v11 = [[256; v4]; v4]; const v0: [[usize; v4]; v4] = v6(v8); - //~^ ERROR cannot find value `v8` in this scope - //~| ERROR cannot find function `v6` in this scope + //~^ ERROR cannot find value `v8` + //~| ERROR cannot find function `v6` pub struct v17 { //~^ WARN type `v17` should have an upper camel case name //~| ERROR `[[usize; v4]; v4]` is forbidden as the type of a const generic parameter @@ -21,16 +21,16 @@ mod v20 { impl v17<512, v0> { pub const fn v21() -> v18 {} - //~^ ERROR cannot find type `v18` in this scope + //~^ ERROR cannot find type `v18` } impl v17 { //~^ ERROR maximum number of nodes exceeded in constant v20::v17::::{constant#1} //~| ERROR maximum number of nodes exceeded in constant v20::v17::::{constant#1} pub const fn v21() -> v18 { - //~^ ERROR cannot find type `v18` in this scope + //~^ ERROR cannot find type `v18` v18 { _p: () } - //~^ ERROR cannot find struct, variant or union type `v18` in this scope + //~^ ERROR cannot find struct, variant or union type `v18` } } } diff --git a/tests/ui/const-generics/issues/issue-82956.rs b/tests/ui/const-generics/issues/issue-82956.rs index 3539e9b966c86..c154cb63045ba 100644 --- a/tests/ui/const-generics/issues/issue-82956.rs +++ b/tests/ui/const-generics/issues/issue-82956.rs @@ -23,7 +23,7 @@ where fn pop(self) -> (Self::Newlen, Self::Output) { let mut iter = IntoIter::new(self); - //~^ ERROR: failed to resolve: use of undeclared type `IntoIter` + //~^ ERROR: cannot find item `IntoIter` let end = iter.next_back().unwrap(); let new = [(); N - 1].map(move |()| iter.next().unwrap()); (new, end) diff --git a/tests/ui/const-generics/issues/issue-82956.stderr b/tests/ui/const-generics/issues/issue-82956.stderr index a956fc741f4d4..e3b34f18f5f9e 100644 --- a/tests/ui/const-generics/issues/issue-82956.stderr +++ b/tests/ui/const-generics/issues/issue-82956.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `IntoIter` +error[E0433]: cannot find item `IntoIter` in this scope --> $DIR/issue-82956.rs:25:24 | LL | let mut iter = IntoIter::new(self); diff --git a/tests/ui/const-generics/not_wf_param_in_rpitit.rs b/tests/ui/const-generics/not_wf_param_in_rpitit.rs index 5471dc9022f90..9e8a822c9c5e2 100644 --- a/tests/ui/const-generics/not_wf_param_in_rpitit.rs +++ b/tests/ui/const-generics/not_wf_param_in_rpitit.rs @@ -1,7 +1,7 @@ //@ edition:2021 trait Trait { - //~^ ERROR: cannot find value `bar` in this scope + //~^ ERROR: cannot find value `bar` //~| ERROR: cycle detected when computing type of `Trait::N` //~| ERROR: the trait `Trait` cannot be made into an object //~| ERROR: the trait `Trait` cannot be made into an object diff --git a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs index 09f7e2ba5b1dd..69251b301a2a7 100644 --- a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs +++ b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs @@ -4,7 +4,7 @@ pub struct Opcode(pub u8); pub struct Opcode2(&'a S); //~^ ERROR use of undeclared lifetime name `'a` -//~^^ ERROR cannot find type `S` in this scope +//~^^ ERROR cannot find type `S` impl Opcode2 { pub const OP2: Opcode2 = Opcode2(Opcode(0x1)); diff --git a/tests/ui/consts/const-eval/ice-unhandled-type-122191.rs b/tests/ui/consts/const-eval/ice-unhandled-type-122191.rs index a92b99976e262..376de119481cb 100644 --- a/tests/ui/consts/const-eval/ice-unhandled-type-122191.rs +++ b/tests/ui/consts/const-eval/ice-unhandled-type-122191.rs @@ -4,7 +4,7 @@ type Foo = impl Send; struct A; const VALUE: Foo = value(); -//~^ ERROR cannot find function `value` in this scope +//~^ ERROR cannot find function `value` fn test() { match VALUE { diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.rs b/tests/ui/consts/const_refs_to_static-ice-121413.rs index 8fc3912efd08e..24c2e0650b887 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.rs +++ b/tests/ui/consts/const_refs_to_static-ice-121413.rs @@ -7,7 +7,7 @@ const REF_INTERIOR_MUT: &usize = { //~^ HELP consider importing this struct static FOO: Sync = AtomicUsize::new(0); - //~^ ERROR failed to resolve: use of undeclared type `AtomicUsize` + //~^ ERROR cannot find item `AtomicUsize` //~| WARN trait objects without an explicit `dyn` are deprecated //~| ERROR the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time //~| ERROR the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.stderr b/tests/ui/consts/const_refs_to_static-ice-121413.stderr index fbe32a70293aa..abd476009ce86 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.stderr +++ b/tests/ui/consts/const_refs_to_static-ice-121413.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `AtomicUsize` +error[E0433]: cannot find item `AtomicUsize` in this scope --> $DIR/const_refs_to_static-ice-121413.rs:9:24 | LL | static FOO: Sync = AtomicUsize::new(0); diff --git a/tests/ui/consts/erroneous_type_in_const_return_value.rs b/tests/ui/consts/erroneous_type_in_const_return_value.rs index 304211f77da72..69a907d89d0fe 100644 --- a/tests/ui/consts/erroneous_type_in_const_return_value.rs +++ b/tests/ui/consts/erroneous_type_in_const_return_value.rs @@ -4,7 +4,7 @@ enum Eek { TheConst, UnusedByTheConst(Sum), - //~^ ERROR cannot find type `Sum` in this scope + //~^ ERROR cannot find type `Sum` } const EEK_ZERO: &[Eek] = &[]; diff --git a/tests/ui/consts/erroneous_type_in_promoted.rs b/tests/ui/consts/erroneous_type_in_promoted.rs index 32e33c2030fbb..6e34618bdbaf3 100644 --- a/tests/ui/consts/erroneous_type_in_promoted.rs +++ b/tests/ui/consts/erroneous_type_in_promoted.rs @@ -4,7 +4,7 @@ enum Eek { TheConst, UnusedByTheConst(Sum), - //~^ ERROR cannot find type `Sum` in this scope + //~^ ERROR cannot find type `Sum` } const fn foo() { diff --git a/tests/ui/consts/ice-bad-input-type-for-cast-83056.rs b/tests/ui/consts/ice-bad-input-type-for-cast-83056.rs index 1a22dc2b5495a..1e5e9007c415a 100644 --- a/tests/ui/consts/ice-bad-input-type-for-cast-83056.rs +++ b/tests/ui/consts/ice-bad-input-type-for-cast-83056.rs @@ -3,5 +3,5 @@ struct S([bool; f as usize]); fn f() -> T {} -//~^ ERROR cannot find type `T` in this scope +//~^ ERROR cannot find type `T` pub fn main() {} diff --git a/tests/ui/consts/issue-104609.rs b/tests/ui/consts/issue-104609.rs index 9ee83b409c16f..b769569857daa 100644 --- a/tests/ui/consts/issue-104609.rs +++ b/tests/ui/consts/issue-104609.rs @@ -1,6 +1,6 @@ fn foo() { oops; - //~^ ERROR: cannot find value `oops` in this scope + //~^ ERROR: cannot find value `oops` } unsafe fn bar() { diff --git a/tests/ui/consts/issue-116186.rs b/tests/ui/consts/issue-116186.rs index a77c38c64dc57..8a8d3e0747917 100644 --- a/tests/ui/consts/issue-116186.rs +++ b/tests/ui/consts/issue-116186.rs @@ -2,7 +2,7 @@ #![feature(generic_const_exprs)] fn something(path: [usize; N]) -> impl Clone { - //~^ ERROR cannot find value `N` in this scope + //~^ ERROR cannot find value `N` match path { [] => 0, //~ ERROR cannot pattern-match on an array without a fixed length _ => 1, diff --git a/tests/ui/consts/issue-90878-2.rs b/tests/ui/consts/issue-90878-2.rs index 0e61c65305fbe..0a5cb98c8206a 100644 --- a/tests/ui/consts/issue-90878-2.rs +++ b/tests/ui/consts/issue-90878-2.rs @@ -1,5 +1,5 @@ #![l=|x|[b;x ]] //~ ERROR attribute value must be a literal -//~^ ERROR cannot find attribute `l` in this scope +//~^ ERROR cannot find attribute `l` // notice the space at the start, // we can't attach any attributes to this file because it needs to be at the start diff --git a/tests/ui/consts/issue-90878-2.stderr b/tests/ui/consts/issue-90878-2.stderr index 0b332840042ef..45d1cf053b03b 100644 --- a/tests/ui/consts/issue-90878-2.stderr +++ b/tests/ui/consts/issue-90878-2.stderr @@ -4,11 +4,11 @@ error: attribute value must be a literal LL | #![l=|x|[b;x ]] | ^^^^^^^^^ -error: cannot find attribute `l` in this scope +error: cannot find attribute `l` in the crate root --> $DIR/issue-90878-2.rs:1:5 | LL | #![l=|x|[b;x ]] - | ^ + | ^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/consts/issue-91434.rs b/tests/ui/consts/issue-91434.rs index 001dc708f8932..da515adea6a09 100644 --- a/tests/ui/consts/issue-91434.rs +++ b/tests/ui/consts/issue-91434.rs @@ -1,5 +1,5 @@ fn main() { [9; [[9E; h]]]; //~^ ERROR: expected at least one digit in exponent - //~| ERROR: cannot find value `h` in this scope [E0425] + //~| ERROR: cannot find value `h` } diff --git a/tests/ui/coroutine/layout-error.rs b/tests/ui/coroutine/layout-error.rs index 3e26cf17d29ec..f4d7b16326095 100644 --- a/tests/ui/coroutine/layout-error.rs +++ b/tests/ui/coroutine/layout-error.rs @@ -24,7 +24,7 @@ mod helper { F:, { async fn cb() { - let a = Foo; //~ ERROR cannot find value `Foo` in this scope + let a = Foo; //~ ERROR cannot find value `Foo` } Task::spawn(&POOL, || cb()); diff --git a/tests/ui/custom-attribute-multisegment.rs b/tests/ui/custom-attribute-multisegment.rs index 2434921390245..a9f309b1a5e8c 100644 --- a/tests/ui/custom-attribute-multisegment.rs +++ b/tests/ui/custom-attribute-multisegment.rs @@ -2,5 +2,5 @@ mod existent {} -#[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent` +#[existent::nonexistent] //~ ERROR cannot find macro `nonexistent` fn main() {} diff --git a/tests/ui/custom-attribute-multisegment.stderr b/tests/ui/custom-attribute-multisegment.stderr index 90ebe27793911..28723fd9b33c0 100644 --- a/tests/ui/custom-attribute-multisegment.stderr +++ b/tests/ui/custom-attribute-multisegment.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `nonexistent` in `existent` +error[E0433]: cannot find macro `nonexistent` in module `existent` --> $DIR/custom-attribute-multisegment.rs:5:13 | LL | #[existent::nonexistent] diff --git a/tests/ui/custom_attribute.rs b/tests/ui/custom_attribute.rs index 4957184229da0..6bbe272d0b642 100644 --- a/tests/ui/custom_attribute.rs +++ b/tests/ui/custom_attribute.rs @@ -1,9 +1,9 @@ #![feature(stmt_expr_attributes)] -#[foo] //~ ERROR cannot find attribute `foo` in this scope +#[foo] //~ ERROR cannot find attribute `foo` fn main() { - #[foo] //~ ERROR cannot find attribute `foo` in this scope + #[foo] //~ ERROR cannot find attribute `foo` let x = (); - #[foo] //~ ERROR cannot find attribute `foo` in this scope + #[foo] //~ ERROR cannot find attribute `foo` x } diff --git a/tests/ui/custom_attribute.stderr b/tests/ui/custom_attribute.stderr index 4023892d29466..37dcb4211ecc0 100644 --- a/tests/ui/custom_attribute.stderr +++ b/tests/ui/custom_attribute.stderr @@ -1,20 +1,20 @@ -error: cannot find attribute `foo` in this scope +error: cannot find attribute `foo` in the crate root --> $DIR/custom_attribute.rs:3:3 | LL | #[foo] - | ^^^ + | ^^^ not found in the crate root error: cannot find attribute `foo` in this scope --> $DIR/custom_attribute.rs:5:7 | LL | #[foo] - | ^^^ + | ^^^ not found in this scope error: cannot find attribute `foo` in this scope --> $DIR/custom_attribute.rs:7:7 | LL | #[foo] - | ^^^ + | ^^^ not found in this scope error: aborting due to 3 previous errors diff --git a/tests/ui/deduplicate-diagnostics.deduplicate.stderr b/tests/ui/deduplicate-diagnostics.deduplicate.stderr index 5df2c687bddc2..2d6820da7f8af 100644 --- a/tests/ui/deduplicate-diagnostics.deduplicate.stderr +++ b/tests/ui/deduplicate-diagnostics.deduplicate.stderr @@ -4,11 +4,11 @@ error[E0452]: malformed lint attribute input LL | #[deny("literal")] | ^^^^^^^^^ bad attribute argument -error: cannot find derive macro `Unresolved` in this scope +error: cannot find derive macro `Unresolved` in the crate root --> $DIR/deduplicate-diagnostics.rs:4:10 | LL | #[derive(Unresolved)] - | ^^^^^^^^^^ + | ^^^^^^^^^^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/deduplicate-diagnostics.duplicate.stderr b/tests/ui/deduplicate-diagnostics.duplicate.stderr index 0544b993278d7..ff6bfa753ddef 100644 --- a/tests/ui/deduplicate-diagnostics.duplicate.stderr +++ b/tests/ui/deduplicate-diagnostics.duplicate.stderr @@ -4,17 +4,17 @@ error[E0452]: malformed lint attribute input LL | #[deny("literal")] | ^^^^^^^^^ bad attribute argument -error: cannot find derive macro `Unresolved` in this scope +error: cannot find derive macro `Unresolved` in the crate root --> $DIR/deduplicate-diagnostics.rs:4:10 | LL | #[derive(Unresolved)] - | ^^^^^^^^^^ + | ^^^^^^^^^^ not found in the crate root -error: cannot find derive macro `Unresolved` in this scope +error: cannot find derive macro `Unresolved` in the crate root --> $DIR/deduplicate-diagnostics.rs:4:10 | LL | #[derive(Unresolved)] - | ^^^^^^^^^^ + | ^^^^^^^^^^ not found in the crate root | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/deduplicate-diagnostics.rs b/tests/ui/deduplicate-diagnostics.rs index 54bd5dd5098c1..c36175426bc0a 100644 --- a/tests/ui/deduplicate-diagnostics.rs +++ b/tests/ui/deduplicate-diagnostics.rs @@ -1,8 +1,8 @@ //@ revisions: duplicate deduplicate //@[deduplicate] compile-flags: -Z deduplicate-diagnostics=yes -#[derive(Unresolved)] //~ ERROR cannot find derive macro `Unresolved` in this scope - //[duplicate]~| ERROR cannot find derive macro `Unresolved` in this scope +#[derive(Unresolved)] //~ ERROR cannot find derive macro `Unresolved` + //[duplicate]~| ERROR cannot find derive macro `Unresolved` struct S; #[deny("literal")] //~ ERROR malformed lint attribute input diff --git a/tests/ui/delegation/bad-resolve.rs b/tests/ui/delegation/bad-resolve.rs index f378e05304b29..e2287299bc5d7 100644 --- a/tests/ui/delegation/bad-resolve.rs +++ b/tests/ui/delegation/bad-resolve.rs @@ -29,15 +29,15 @@ impl Trait for S { //~| ERROR expected method or associated constant, found associated type `Trait::Type` reuse ::baz; //~^ ERROR method `baz` is not a member of trait `Trait` - //~| ERROR cannot find method or associated constant `baz` in trait `Trait` + //~| ERROR cannot find method or associated constant `baz` reuse ::bar; reuse foo { &self.0 } - //~^ ERROR cannot find function `foo` in this scope + //~^ ERROR cannot find function `foo` } mod prefix {} -reuse unresolved_prefix::{a, b, c}; //~ ERROR use of undeclared crate or module `unresolved_prefix` -reuse prefix::{self, super, crate}; //~ ERROR `crate` in paths can only be used in start position +reuse unresolved_prefix::{a, b, c}; //~ ERROR cannot find item `unresolved_prefix` +reuse prefix::{self, super, crate}; //~ ERROR cannot find module `crate` fn main() {} diff --git a/tests/ui/delegation/bad-resolve.stderr b/tests/ui/delegation/bad-resolve.stderr index 883ff523bcfea..faf0e19f66474 100644 --- a/tests/ui/delegation/bad-resolve.stderr +++ b/tests/ui/delegation/bad-resolve.stderr @@ -63,13 +63,13 @@ LL | type Type; LL | impl Trait for S { | ^^^^^^^^^^^^^^^^ missing `Type` in implementation -error[E0433]: failed to resolve: use of undeclared crate or module `unresolved_prefix` +error[E0433]: cannot find item `unresolved_prefix` in this scope --> $DIR/bad-resolve.rs:40:7 | LL | reuse unresolved_prefix::{a, b, c}; | ^^^^^^^^^^^^^^^^^ use of undeclared crate or module `unresolved_prefix` -error[E0433]: failed to resolve: `crate` in paths can only be used in start position +error[E0433]: cannot find module `crate` in module `prefix` --> $DIR/bad-resolve.rs:41:29 | LL | reuse prefix::{self, super, crate}; diff --git a/tests/ui/delegation/explicit-paths.rs b/tests/ui/delegation/explicit-paths.rs index a91ca4cb931ed..11637dda16102 100644 --- a/tests/ui/delegation/explicit-paths.rs +++ b/tests/ui/delegation/explicit-paths.rs @@ -27,7 +27,7 @@ mod fn_to_other { //~^ ERROR delegation to a trait method from a free function is not supported yet reuse to_reuse::foo3; reuse S::foo4; - //~^ ERROR cannot find function `foo4` in `S` + //~^ ERROR cannot find function `foo4` } mod inherent_impl_assoc_fn_to_other { @@ -38,7 +38,7 @@ mod inherent_impl_assoc_fn_to_other { reuse ::foo2; reuse to_reuse::foo3; reuse F::foo4 { &self.0 } - //~^ ERROR cannot find function `foo4` in `F` + //~^ ERROR cannot find function `foo4` } } @@ -52,7 +52,7 @@ mod trait_impl_assoc_fn_to_other { //~^ ERROR method `foo3` is not a member of trait `Trait` reuse F::foo4 { &self.0 } //~^ ERROR method `foo4` is not a member of trait `Trait` - //~| ERROR cannot find function `foo4` in `F` + //~| ERROR cannot find function `foo4` } } @@ -65,7 +65,7 @@ mod trait_assoc_fn_to_other { reuse ::foo2; reuse to_reuse::foo3; reuse F::foo4 { &F } - //~^ ERROR cannot find function `foo4` in `F` + //~^ ERROR cannot find function `foo4` } } diff --git a/tests/ui/delegation/glob-bad-path.rs b/tests/ui/delegation/glob-bad-path.rs index 7bc4f0153a308..f16569282e018 100644 --- a/tests/ui/delegation/glob-bad-path.rs +++ b/tests/ui/delegation/glob-bad-path.rs @@ -5,7 +5,7 @@ trait Trait {} struct S; impl Trait for u8 { - reuse unresolved::*; //~ ERROR failed to resolve: use of undeclared crate or module `unresolved` + reuse unresolved::*; //~ ERROR cannot find type `unresolved` reuse S::*; //~ ERROR expected trait, found struct `S` } diff --git a/tests/ui/delegation/glob-bad-path.stderr b/tests/ui/delegation/glob-bad-path.stderr index 0c06364b3f0ab..3ab1c29f1abef 100644 --- a/tests/ui/delegation/glob-bad-path.stderr +++ b/tests/ui/delegation/glob-bad-path.stderr @@ -4,7 +4,7 @@ error: expected trait, found struct `S` LL | reuse S::*; | ^ not a trait -error[E0433]: failed to resolve: use of undeclared crate or module `unresolved` +error[E0433]: cannot find type `unresolved` in this scope --> $DIR/glob-bad-path.rs:8:11 | LL | reuse unresolved::*; diff --git a/tests/ui/delegation/ice-issue-124342.rs b/tests/ui/delegation/ice-issue-124342.rs index ad62f6bd54af9..d1acee5135c39 100644 --- a/tests/ui/delegation/ice-issue-124342.rs +++ b/tests/ui/delegation/ice-issue-124342.rs @@ -5,8 +5,8 @@ mod to_reuse {} trait Trait { reuse to_reuse::foo { foo } - //~^ ERROR cannot find function `foo` in module `to_reuse` - //~| ERROR cannot find value `foo` in this scope + //~^ ERROR cannot find function `foo` + //~| ERROR cannot find value `foo` } fn main() {} diff --git a/tests/ui/delegation/ice-issue-124342.stderr b/tests/ui/delegation/ice-issue-124342.stderr index f9a3684d64932..a53739676cfc3 100644 --- a/tests/ui/delegation/ice-issue-124342.stderr +++ b/tests/ui/delegation/ice-issue-124342.stderr @@ -2,7 +2,7 @@ error[E0425]: cannot find function `foo` in module `to_reuse` --> $DIR/ice-issue-124342.rs:7:21 | LL | reuse to_reuse::foo { foo } - | ^^^ not found in `to_reuse` + | ^^^ not found in module `to_reuse` error[E0425]: cannot find value `foo` in this scope --> $DIR/ice-issue-124342.rs:7:27 diff --git a/tests/ui/delegation/target-expr.rs b/tests/ui/delegation/target-expr.rs index fd7ea943b9d5e..889cb8d3daff8 100644 --- a/tests/ui/delegation/target-expr.rs +++ b/tests/ui/delegation/target-expr.rs @@ -36,5 +36,5 @@ fn main() { self.0; //~^ ERROR expected value, found module `self` let z = x; - //~^ ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` } diff --git a/tests/ui/derived-errors/issue-31997-1.stderr b/tests/ui/derived-errors/issue-31997-1.stderr index 40485027a660c..ccb62a6db55f4 100644 --- a/tests/ui/derived-errors/issue-31997-1.stderr +++ b/tests/ui/derived-errors/issue-31997-1.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `HashMap` +error[E0433]: cannot find item `HashMap` in this scope --> $DIR/issue-31997-1.rs:20:19 | LL | let mut map = HashMap::new(); diff --git a/tests/ui/derived-errors/issue-31997.rs b/tests/ui/derived-errors/issue-31997.rs index ff619313afb5b..a4cbf2c46df89 100644 --- a/tests/ui/derived-errors/issue-31997.rs +++ b/tests/ui/derived-errors/issue-31997.rs @@ -11,7 +11,7 @@ fn closure(x: F) -> Result } fn foo() -> Result<(), ()> { - try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope + try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` Ok(()) } diff --git a/tests/ui/derives/deriving-bounds.rs b/tests/ui/derives/deriving-bounds.rs index 95d440420b065..ed54eb0e64856 100644 --- a/tests/ui/derives/deriving-bounds.rs +++ b/tests/ui/derives/deriving-bounds.rs @@ -1,11 +1,11 @@ #[derive(Send)] -//~^ ERROR cannot find derive macro `Send` in this scope -//~| ERROR cannot find derive macro `Send` in this scope +//~^ ERROR cannot find derive macro `Send` +//~| ERROR cannot find derive macro `Send` struct Test; #[derive(Sync)] -//~^ ERROR cannot find derive macro `Sync` in this scope -//~| ERROR cannot find derive macro `Sync` in this scope +//~^ ERROR cannot find derive macro `Sync` +//~| ERROR cannot find derive macro `Sync` struct Test1; pub fn main() {} diff --git a/tests/ui/derives/deriving-bounds.stderr b/tests/ui/derives/deriving-bounds.stderr index 4461652eb02e3..8337ab21a8343 100644 --- a/tests/ui/derives/deriving-bounds.stderr +++ b/tests/ui/derives/deriving-bounds.stderr @@ -1,8 +1,8 @@ -error: cannot find derive macro `Sync` in this scope +error: cannot find derive macro `Sync` in the crate root --> $DIR/deriving-bounds.rs:6:10 | LL | #[derive(Sync)] - | ^^^^ + | ^^^^ not found in the crate root | note: unsafe traits like `Sync` should be implemented explicitly --> $DIR/deriving-bounds.rs:6:10 @@ -10,11 +10,11 @@ note: unsafe traits like `Sync` should be implemented explicitly LL | #[derive(Sync)] | ^^^^ -error: cannot find derive macro `Sync` in this scope +error: cannot find derive macro `Sync` in the crate root --> $DIR/deriving-bounds.rs:6:10 | LL | #[derive(Sync)] - | ^^^^ + | ^^^^ not found in the crate root | note: unsafe traits like `Sync` should be implemented explicitly --> $DIR/deriving-bounds.rs:6:10 @@ -23,11 +23,11 @@ LL | #[derive(Sync)] | ^^^^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: cannot find derive macro `Send` in this scope +error: cannot find derive macro `Send` in the crate root --> $DIR/deriving-bounds.rs:1:10 | LL | #[derive(Send)] - | ^^^^ + | ^^^^ not found in the crate root | note: unsafe traits like `Send` should be implemented explicitly --> $DIR/deriving-bounds.rs:1:10 @@ -35,11 +35,11 @@ note: unsafe traits like `Send` should be implemented explicitly LL | #[derive(Send)] | ^^^^ -error: cannot find derive macro `Send` in this scope +error: cannot find derive macro `Send` in the crate root --> $DIR/deriving-bounds.rs:1:10 | LL | #[derive(Send)] - | ^^^^ + | ^^^^ not found in the crate root | note: unsafe traits like `Send` should be implemented explicitly --> $DIR/deriving-bounds.rs:1:10 diff --git a/tests/ui/derives/deriving-meta-unknown-trait.rs b/tests/ui/derives/deriving-meta-unknown-trait.rs index 6463a7664de93..d2f92120cb297 100644 --- a/tests/ui/derives/deriving-meta-unknown-trait.rs +++ b/tests/ui/derives/deriving-meta-unknown-trait.rs @@ -1,6 +1,6 @@ #[derive(Eqr)] -//~^ ERROR cannot find derive macro `Eqr` in this scope -//~| ERROR cannot find derive macro `Eqr` in this scope +//~^ ERROR cannot find derive macro `Eqr` +//~| ERROR cannot find derive macro `Eqr` struct Foo; pub fn main() {} diff --git a/tests/ui/derives/deriving-meta-unknown-trait.stderr b/tests/ui/derives/deriving-meta-unknown-trait.stderr index 28753b8f9f288..cd408668ba0fa 100644 --- a/tests/ui/derives/deriving-meta-unknown-trait.stderr +++ b/tests/ui/derives/deriving-meta-unknown-trait.stderr @@ -1,17 +1,23 @@ -error: cannot find derive macro `Eqr` in this scope +error: cannot find derive macro `Eqr` in the crate root --> $DIR/deriving-meta-unknown-trait.rs:1:10 | LL | #[derive(Eqr)] - | ^^^ help: a derive macro with a similar name exists: `Eq` + | ^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `Eq` --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named derive macro `Eq` defined here -error: cannot find derive macro `Eqr` in this scope +error: cannot find derive macro `Eqr` in the crate root --> $DIR/deriving-meta-unknown-trait.rs:1:10 | LL | #[derive(Eqr)] - | ^^^ help: a derive macro with a similar name exists: `Eq` + | ^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `Eq` --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named derive macro `Eq` defined here diff --git a/tests/ui/derives/deriving-primitive.rs b/tests/ui/derives/deriving-primitive.rs index 1173eca640fc3..a6de175c9cbc4 100644 --- a/tests/ui/derives/deriving-primitive.rs +++ b/tests/ui/derives/deriving-primitive.rs @@ -1,5 +1,5 @@ -#[derive(FromPrimitive)] //~ ERROR cannot find derive macro `FromPrimitive` in this scope - //~| ERROR cannot find derive macro `FromPrimitive` in this scope +#[derive(FromPrimitive)] //~ ERROR cannot find derive macro `FromPrimitive` + //~| ERROR cannot find derive macro `FromPrimitive` enum Foo {} fn main() {} diff --git a/tests/ui/derives/deriving-primitive.stderr b/tests/ui/derives/deriving-primitive.stderr index b39637825e56c..a6c3c0d80e2e4 100644 --- a/tests/ui/derives/deriving-primitive.stderr +++ b/tests/ui/derives/deriving-primitive.stderr @@ -1,14 +1,14 @@ -error: cannot find derive macro `FromPrimitive` in this scope +error: cannot find derive macro `FromPrimitive` in the crate root --> $DIR/deriving-primitive.rs:1:10 | LL | #[derive(FromPrimitive)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in the crate root -error: cannot find derive macro `FromPrimitive` in this scope +error: cannot find derive macro `FromPrimitive` in the crate root --> $DIR/deriving-primitive.rs:1:10 | LL | #[derive(FromPrimitive)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in the crate root | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/diagnostic_namespace/requires_path.rs b/tests/ui/diagnostic_namespace/requires_path.rs index 4f3a1319cafff..8c0cdc0f89af0 100644 --- a/tests/ui/diagnostic_namespace/requires_path.rs +++ b/tests/ui/diagnostic_namespace/requires_path.rs @@ -1,5 +1,5 @@ #[diagnostic] -//~^ERROR cannot find attribute `diagnostic` in this scope +//~^ERROR cannot find attribute `diagnostic` pub struct Bar; diff --git a/tests/ui/diagnostic_namespace/requires_path.stderr b/tests/ui/diagnostic_namespace/requires_path.stderr index e02aacac8c1a7..beb7f5cbf31d0 100644 --- a/tests/ui/diagnostic_namespace/requires_path.stderr +++ b/tests/ui/diagnostic_namespace/requires_path.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `diagnostic` in this scope +error: cannot find attribute `diagnostic` in the crate root --> $DIR/requires_path.rs:1:3 | LL | #[diagnostic] - | ^^^^^^^^^^ + | ^^^^^^^^^^ not found in the crate root error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/issue-103909.rs b/tests/ui/did_you_mean/issue-103909.rs index 20b67cd102d70..b7d5c32e5e087 100644 --- a/tests/ui/did_you_mean/issue-103909.rs +++ b/tests/ui/did_you_mean/issue-103909.rs @@ -3,7 +3,7 @@ use std::fs::File; fn main() { if Err(err) = File::open("hello.txt") { - //~^ ERROR: cannot find value `err` in this scope + //~^ ERROR: cannot find value `err` //~| ERROR: mismatched types } } diff --git a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs index 264cfa449942c..fa4f0bd8a95e2 100644 --- a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs +++ b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs @@ -7,8 +7,8 @@ enum Solidify { Set } enum UnorderedCollection { Set } fn setup() -> Set { Set } -//~^ ERROR cannot find type `Set` in this scope -//~| ERROR cannot find value `Set` in this scope +//~^ ERROR cannot find type `Set` +//~| ERROR cannot find value `Set` fn main() { setup(); diff --git a/tests/ui/did_you_mean/println-typo.rs b/tests/ui/did_you_mean/println-typo.rs index 685b5e1f28403..679fda3719332 100644 --- a/tests/ui/did_you_mean/println-typo.rs +++ b/tests/ui/did_you_mean/println-typo.rs @@ -1,6 +1,6 @@ // https://internals.rust-lang.org/t/18227 fn main() { - prinltn!(); //~ ERROR cannot find macro `prinltn` in this scope + prinltn!(); //~ ERROR cannot find macro `prinltn` //^ a macro with a similar name exists: `println` } diff --git a/tests/ui/did_you_mean/println-typo.stderr b/tests/ui/did_you_mean/println-typo.stderr index a1e0b1f1ba4f1..07fb577b3a4f8 100644 --- a/tests/ui/did_you_mean/println-typo.stderr +++ b/tests/ui/did_you_mean/println-typo.stderr @@ -2,7 +2,10 @@ error: cannot find macro `prinltn` in this scope --> $DIR/println-typo.rs:4:5 | LL | prinltn!(); - | ^^^^^^^ help: a macro with a similar name exists: `println` + | ^^^^^^^ + | | + | not found in this scope + | help: a macro with a similar name exists: `println` --> $SRC_DIR/std/src/macros.rs:LL:COL | = note: similarly named macro `println` defined here diff --git a/tests/ui/dollar-crate/dollar-crate-is-keyword-2.rs b/tests/ui/dollar-crate/dollar-crate-is-keyword-2.rs index bbab6f8774876..dc66ce5240732 100644 --- a/tests/ui/dollar-crate/dollar-crate-is-keyword-2.rs +++ b/tests/ui/dollar-crate/dollar-crate-is-keyword-2.rs @@ -3,8 +3,8 @@ mod a {} macro_rules! m { () => { use a::$crate; //~ ERROR unresolved import `a::$crate` - use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position - type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position + use a::$crate::b; //~ ERROR cannot find module `$crate` + type A = a::$crate; //~ ERROR cannot find module `$crate` } } diff --git a/tests/ui/dollar-crate/dollar-crate-is-keyword-2.stderr b/tests/ui/dollar-crate/dollar-crate-is-keyword-2.stderr index d46029710d6f7..8fedb484f5ecf 100644 --- a/tests/ui/dollar-crate/dollar-crate-is-keyword-2.stderr +++ b/tests/ui/dollar-crate/dollar-crate-is-keyword-2.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `$crate` in paths can only be used in start position +error[E0433]: cannot find module `$crate` in module `a` --> $DIR/dollar-crate-is-keyword-2.rs:6:16 | LL | use a::$crate::b; @@ -20,7 +20,7 @@ LL | m!(); | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0433]: failed to resolve: `$crate` in paths can only be used in start position +error[E0433]: cannot find module `$crate` in module `a` --> $DIR/dollar-crate-is-keyword-2.rs:7:21 | LL | type A = a::$crate; diff --git a/tests/ui/editions/async-block-2015.rs b/tests/ui/editions/async-block-2015.rs index 3daf4930c5b4b..3364eee59e8ef 100644 --- a/tests/ui/editions/async-block-2015.rs +++ b/tests/ui/editions/async-block-2015.rs @@ -5,7 +5,7 @@ async fn foo() { //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide let x = async {}; - //~^ ERROR cannot find struct, variant or union type `async` in this scope + //~^ ERROR cannot find struct, variant or union type `async` //~| NOTE `async` blocks are only allowed in Rust 2018 or later let y = async { //~ NOTE `async` blocks are only allowed in Rust 2018 or later let x = 42; diff --git a/tests/ui/empty/empty-macro-use.stderr b/tests/ui/empty/empty-macro-use.stderr index cdf3ff83cc38c..b64236023cb63 100644 --- a/tests/ui/empty/empty-macro-use.stderr +++ b/tests/ui/empty/empty-macro-use.stderr @@ -2,7 +2,7 @@ error: cannot find macro `macro_two` in this scope --> $DIR/empty-macro-use.rs:7:5 | LL | macro_two!(); - | ^^^^^^^^^ + | ^^^^^^^^^ not found in this scope | help: consider importing this macro | diff --git a/tests/ui/enum/suggest-default-attribute.rs b/tests/ui/enum/suggest-default-attribute.rs index 1d7567e60a57c..6dbc263e0a7a3 100644 --- a/tests/ui/enum/suggest-default-attribute.rs +++ b/tests/ui/enum/suggest-default-attribute.rs @@ -1,6 +1,6 @@ pub enum Test { //~ HELP consider adding a derive #[default] - //~^ ERROR cannot find attribute `default` in this scope + //~^ ERROR cannot find attribute `default` First, Second, } diff --git a/tests/ui/enum/suggest-default-attribute.stderr b/tests/ui/enum/suggest-default-attribute.stderr index fa72db6aaef9d..aa65a2ec8f8c4 100644 --- a/tests/ui/enum/suggest-default-attribute.stderr +++ b/tests/ui/enum/suggest-default-attribute.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `default` in this scope +error: cannot find attribute `default` in enum `Test` --> $DIR/suggest-default-attribute.rs:2:7 | LL | #[default] - | ^^^^^^^ + | ^^^^^^^ not found in enum `Test` | help: consider adding a derive | diff --git a/tests/ui/error-codes/E0432.stderr b/tests/ui/error-codes/E0432.stderr index 473e82f863437..17b07eac8d0af 100644 --- a/tests/ui/error-codes/E0432.stderr +++ b/tests/ui/error-codes/E0432.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `something` --> $DIR/E0432.rs:1:5 | LL | use something::Foo; - | ^^^^^^^^^ maybe a missing crate `something`? + | ^^^^^^^^^ you might be missing a crate named `something` | = help: consider adding `extern crate something` to use the `something` crate diff --git a/tests/ui/error-codes/E0433.stderr b/tests/ui/error-codes/E0433.stderr index 1ac8c3ebc4d40..04f7b41320cd9 100644 --- a/tests/ui/error-codes/E0433.stderr +++ b/tests/ui/error-codes/E0433.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `NonExistingMap` +error[E0433]: cannot find item `NonExistingMap` in this scope --> $DIR/E0433.rs:2:15 | LL | let map = NonExistingMap::new(); diff --git a/tests/ui/expr/if/bad-if-let-suggestion.rs b/tests/ui/expr/if/bad-if-let-suggestion.rs index b0d0676e1ea75..823013fd39c13 100644 --- a/tests/ui/expr/if/bad-if-let-suggestion.rs +++ b/tests/ui/expr/if/bad-if-let-suggestion.rs @@ -1,20 +1,20 @@ fn a() { if let x = 1 && i = 2 {} - //~^ ERROR cannot find value `i` in this scope + //~^ ERROR cannot find value `i` //~| ERROR mismatched types //~| ERROR expected expression, found `let` statement } fn b() { if (i + j) = i {} - //~^ ERROR cannot find value `i` in this scope - //~| ERROR cannot find value `i` in this scope - //~| ERROR cannot find value `j` in this scope + //~^ ERROR cannot find value `i` + //~| ERROR cannot find value `i` + //~| ERROR cannot find value `j` } fn c() { if x[0] = 1 {} - //~^ ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` } fn main() {} diff --git a/tests/ui/expr/malformed_closure/ruby_style_closure.rs b/tests/ui/expr/malformed_closure/ruby_style_closure.rs index fdec072b8a864..7f99d0bcc23c9 100644 --- a/tests/ui/expr/malformed_closure/ruby_style_closure.rs +++ b/tests/ui/expr/malformed_closure/ruby_style_closure.rs @@ -10,6 +10,6 @@ fn main() { let p = Some(45).and_then({ |x| println!("doubling {}", x); Some(x * 2) - //~^ ERROR: cannot find value `x` in this scope + //~^ ERROR: cannot find value `x` }); } diff --git a/tests/ui/ext-nonexistent.stderr b/tests/ui/ext-nonexistent.stderr index 8891e823e4af7..3be17859b5e39 100644 --- a/tests/ui/ext-nonexistent.stderr +++ b/tests/ui/ext-nonexistent.stderr @@ -2,7 +2,7 @@ error: cannot find macro `iamnotanextensionthatexists` in this scope --> $DIR/ext-nonexistent.rs:2:13 | LL | fn main() { iamnotanextensionthatexists!(""); } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope error: aborting due to 1 previous error diff --git a/tests/ui/extern-flag/multiple-opts.rs b/tests/ui/extern-flag/multiple-opts.rs index 091064a070c37..2f49c88a68f59 100644 --- a/tests/ui/extern-flag/multiple-opts.rs +++ b/tests/ui/extern-flag/multiple-opts.rs @@ -16,5 +16,5 @@ pub mod m { } fn main() { - somedep::somefun(); //~ ERROR failed to resolve + somedep::somefun(); //~ ERROR cannot find item `somedep` } diff --git a/tests/ui/extern-flag/multiple-opts.stderr b/tests/ui/extern-flag/multiple-opts.stderr index 0aaca5ee253e4..9b402eea7b844 100644 --- a/tests/ui/extern-flag/multiple-opts.stderr +++ b/tests/ui/extern-flag/multiple-opts.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `somedep` +error[E0433]: cannot find item `somedep` in this scope --> $DIR/multiple-opts.rs:19:5 | LL | somedep::somefun(); diff --git a/tests/ui/extern-flag/noprelude.rs b/tests/ui/extern-flag/noprelude.rs index 4af617a1d628b..de492408d7c9e 100644 --- a/tests/ui/extern-flag/noprelude.rs +++ b/tests/ui/extern-flag/noprelude.rs @@ -3,5 +3,5 @@ //@ edition:2018 fn main() { - somedep::somefun(); //~ ERROR failed to resolve + somedep::somefun(); //~ ERROR cannot find item `somedep` } diff --git a/tests/ui/extern-flag/noprelude.stderr b/tests/ui/extern-flag/noprelude.stderr index 23b9b2fd94b27..0445cda144098 100644 --- a/tests/ui/extern-flag/noprelude.stderr +++ b/tests/ui/extern-flag/noprelude.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `somedep` +error[E0433]: cannot find item `somedep` in this scope --> $DIR/noprelude.rs:6:5 | LL | somedep::somefun(); diff --git a/tests/ui/extern/extern-macro.rs b/tests/ui/extern/extern-macro.rs index ab974e628ff19..9b9ccfa066ef6 100644 --- a/tests/ui/extern/extern-macro.rs +++ b/tests/ui/extern/extern-macro.rs @@ -2,5 +2,5 @@ fn main() { enum Foo {} - let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro + let _ = Foo::bar!(); //~ ERROR cannot find item `bar` } diff --git a/tests/ui/extern/extern-macro.stderr b/tests/ui/extern/extern-macro.stderr index e4d767f0e8644..01060f4e51fa7 100644 --- a/tests/ui/extern/extern-macro.stderr +++ b/tests/ui/extern/extern-macro.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: partially resolved path in a macro +error[E0433]: cannot find item `bar` in this scope --> $DIR/extern-macro.rs:5:13 | LL | let _ = Foo::bar!(); diff --git a/tests/ui/extern/extern-with-type-bounds.rs b/tests/ui/extern/extern-with-type-bounds.rs index 99e9801fd4010..63856e4effbe9 100644 --- a/tests/ui/extern/extern-with-type-bounds.rs +++ b/tests/ui/extern/extern-with-type-bounds.rs @@ -16,7 +16,7 @@ extern "rust-intrinsic" { // Unresolved bounds should still error. fn align_of() -> usize; - //~^ ERROR cannot find trait `NoSuchTrait` in this scope + //~^ ERROR cannot find trait `NoSuchTrait` } fn main() {} diff --git a/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs b/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs index 17e08f511d71f..e25c9ea285ece 100644 --- a/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs +++ b/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs @@ -2,8 +2,8 @@ extern "C" { type Item = [T] where [T]: Sized; //~^ incorrect `type` inside `extern` block //~| `type`s inside `extern` blocks cannot have `where` clauses - //~| cannot find type `T` in this scope - //~| cannot find type `T` in this scope + //~| cannot find type `T` + //~| cannot find type `T` //~| extern types are experimental } diff --git a/tests/ui/extern/issue-80074.rs b/tests/ui/extern/issue-80074.rs index ba7b55a450f51..4d84f551beaf3 100644 --- a/tests/ui/extern/issue-80074.rs +++ b/tests/ui/extern/issue-80074.rs @@ -14,7 +14,7 @@ fn main() { //~^ WARN: macro `foo` is private //~| WARN: it will become a hard error in a future release! bar!(); - //~^ ERROR: cannot find macro `bar` in this scope + //~^ ERROR: cannot find macro `bar` m!(); - //~^ ERROR: cannot find macro `m` in this scope + //~^ ERROR: cannot find macro `m` } diff --git a/tests/ui/extern/issue-80074.stderr b/tests/ui/extern/issue-80074.stderr index b30b761593e88..8bdcb220e5b6f 100644 --- a/tests/ui/extern/issue-80074.stderr +++ b/tests/ui/extern/issue-80074.stderr @@ -8,13 +8,13 @@ error: cannot find macro `bar` in this scope --> $DIR/issue-80074.rs:16:5 | LL | bar!(); - | ^^^ + | ^^^ not found in this scope error: cannot find macro `m` in this scope --> $DIR/issue-80074.rs:18:5 | LL | m!(); - | ^ + | ^ not found in this scope warning: macro `foo` is private --> $DIR/issue-80074.rs:13:5 diff --git a/tests/ui/feature-gates/feature-gate-concat_idents2.rs b/tests/ui/feature-gates/feature-gate-concat_idents2.rs index 9660ffeafa518..0da02c72e5216 100644 --- a/tests/ui/feature-gates/feature-gate-concat_idents2.rs +++ b/tests/ui/feature-gates/feature-gate-concat_idents2.rs @@ -1,4 +1,4 @@ fn main() { concat_idents!(a, b); //~ ERROR `concat_idents` is not stable enough - //~| ERROR cannot find value `ab` in this scope + //~| ERROR cannot find value `ab` } diff --git a/tests/ui/feature-gates/feature-gate-custom_attribute.rs b/tests/ui/feature-gates/feature-gate-custom_attribute.rs index 936cab268d2c9..775e13114e51c 100644 --- a/tests/ui/feature-gates/feature-gate-custom_attribute.rs +++ b/tests/ui/feature-gates/feature-gate-custom_attribute.rs @@ -1,18 +1,18 @@ // Check that literals in attributes parse just fine. -#[fake_attr] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr(100)] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr(1, 2, 3)] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr("hello")] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr(name = "hello")] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR cannot find attribute `fake_attr` in th -#[fake_attr(key = "hello", val = 10)] //~ ERROR cannot find attribute `fake_attr` in this scop -#[fake_attr(key("hello"), val(10))] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr(enabled = true, disabled = false)] //~ ERROR cannot find attribute `fake_attr` in -#[fake_attr(true)] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr(pi = 3.14159)] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_attr(b"hi")] //~ ERROR cannot find attribute `fake_attr` in this scope -#[fake_doc(r"doc")] //~ ERROR cannot find attribute `fake_doc` in this scope +#[fake_attr] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(100)] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(1, 2, 3)] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr("hello")] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(name = "hello")] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(key = "hello", val = 10)] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(key("hello"), val(10))] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(enabled = true, disabled = false)] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(true)] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(pi = 3.14159)] //~ ERROR cannot find attribute `fake_attr` +#[fake_attr(b"hi")] //~ ERROR cannot find attribute `fake_attr` +#[fake_doc(r"doc")] //~ ERROR cannot find attribute `fake_doc` struct Q {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-custom_attribute.stderr b/tests/ui/feature-gates/feature-gate-custom_attribute.stderr index b7c45ec1fb7ea..c628a7bf72c26 100644 --- a/tests/ui/feature-gates/feature-gate-custom_attribute.stderr +++ b/tests/ui/feature-gates/feature-gate-custom_attribute.stderr @@ -1,80 +1,80 @@ -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:3:3 | LL | #[fake_attr] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:4:3 | LL | #[fake_attr(100)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:5:3 | LL | #[fake_attr(1, 2, 3)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:6:3 | LL | #[fake_attr("hello")] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:7:3 | LL | #[fake_attr(name = "hello")] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:8:3 | LL | #[fake_attr(1, "hi", key = 12, true, false)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:9:3 | LL | #[fake_attr(key = "hello", val = 10)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:10:3 | LL | #[fake_attr(key("hello"), val(10))] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:11:3 | LL | #[fake_attr(enabled = true, disabled = false)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:12:3 | LL | #[fake_attr(true)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:13:3 | LL | #[fake_attr(pi = 3.14159)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_attr` in this scope +error: cannot find attribute `fake_attr` in the crate root --> $DIR/feature-gate-custom_attribute.rs:14:3 | LL | #[fake_attr(b"hi")] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `fake_doc` in this scope +error: cannot find attribute `fake_doc` in the crate root --> $DIR/feature-gate-custom_attribute.rs:15:3 | LL | #[fake_doc(r"doc")] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root error: aborting due to 13 previous errors diff --git a/tests/ui/feature-gates/feature-gate-custom_attribute2.rs b/tests/ui/feature-gates/feature-gate-custom_attribute2.rs index 724e53debeb01..3b1dcdd697da9 100644 --- a/tests/ui/feature-gates/feature-gate-custom_attribute2.rs +++ b/tests/ui/feature-gates/feature-gate-custom_attribute2.rs @@ -2,54 +2,54 @@ // lists are included when we are checking for unstable attributes. struct StLt<#[lt_struct] 'a>(&'a u32); -//~^ ERROR cannot find attribute `lt_struct` in this scope +//~^ ERROR cannot find attribute `lt_struct` struct StTy<#[ty_struct] I>(I); -//~^ ERROR cannot find attribute `ty_struct` in this scope +//~^ ERROR cannot find attribute `ty_struct` enum EnLt<#[lt_enum] 'b> { A(&'b u32), B } -//~^ ERROR cannot find attribute `lt_enum` in this scope +//~^ ERROR cannot find attribute `lt_enum` enum EnTy<#[ty_enum] J> { A(J), B } -//~^ ERROR cannot find attribute `ty_enum` in this scope +//~^ ERROR cannot find attribute `ty_enum` trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; } -//~^ ERROR cannot find attribute `lt_trait` in this scope +//~^ ERROR cannot find attribute `lt_trait` trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); } -//~^ ERROR cannot find attribute `ty_trait` in this scope +//~^ ERROR cannot find attribute `ty_trait` type TyLt<#[lt_type] 'd> = &'d u32; -//~^ ERROR cannot find attribute `lt_type` in this scope +//~^ ERROR cannot find attribute `lt_type` type TyTy<#[ty_type] L> = (L, ); -//~^ ERROR cannot find attribute `ty_type` in this scope +//~^ ERROR cannot find attribute `ty_type` impl<#[lt_inherent] 'e> StLt<'e> { } -//~^ ERROR cannot find attribute `lt_inherent` in this scope +//~^ ERROR cannot find attribute `lt_inherent` impl<#[ty_inherent] M> StTy { } -//~^ ERROR cannot find attribute `ty_inherent` in this scope +//~^ ERROR cannot find attribute `ty_inherent` impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> { - //~^ ERROR cannot find attribute `lt_impl_for` in this scope + //~^ ERROR cannot find attribute `lt_impl_for` fn foo(&self, _: &'f [u32]) -> &'f u32 { loop { } } } impl<#[ty_impl_for] N> TrTy for StTy { - //~^ ERROR cannot find attribute `ty_impl_for` in this scope + //~^ ERROR cannot find attribute `ty_impl_for` fn foo(&self, _: N) { } } fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } } -//~^ ERROR cannot find attribute `lt_fn` in this scope +//~^ ERROR cannot find attribute `lt_fn` fn f_ty<#[ty_fn] O>(_: O) { } -//~^ ERROR cannot find attribute `ty_fn` in this scope +//~^ ERROR cannot find attribute `ty_fn` impl StTy { fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } } - //~^ ERROR cannot find attribute `lt_meth` in this scope + //~^ ERROR cannot find attribute `lt_meth` fn m_ty<#[ty_meth] P>(_: P) { } - //~^ ERROR cannot find attribute `ty_meth` in this scope + //~^ ERROR cannot find attribute `ty_meth` } fn hof_lt(_: Q) where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32 - //~^ ERROR cannot find attribute `lt_hof` in this scope + //~^ ERROR cannot find attribute `lt_hof` { } diff --git a/tests/ui/feature-gates/feature-gate-custom_attribute2.stderr b/tests/ui/feature-gates/feature-gate-custom_attribute2.stderr index f2287111719bc..3014af59cfe71 100644 --- a/tests/ui/feature-gates/feature-gate-custom_attribute2.stderr +++ b/tests/ui/feature-gates/feature-gate-custom_attribute2.stderr @@ -1,104 +1,104 @@ -error: cannot find attribute `lt_struct` in this scope +error: cannot find attribute `lt_struct` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:4:15 | LL | struct StLt<#[lt_struct] 'a>(&'a u32); - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `ty_struct` in this scope +error: cannot find attribute `ty_struct` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:6:15 | LL | struct StTy<#[ty_struct] I>(I); - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root -error: cannot find attribute `lt_enum` in this scope +error: cannot find attribute `lt_enum` in enum `EnLt` --> $DIR/feature-gate-custom_attribute2.rs:9:13 | LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B } - | ^^^^^^^ + | ^^^^^^^ not found in enum `EnLt` -error: cannot find attribute `ty_enum` in this scope +error: cannot find attribute `ty_enum` in enum `EnTy` --> $DIR/feature-gate-custom_attribute2.rs:11:13 | LL | enum EnTy<#[ty_enum] J> { A(J), B } - | ^^^^^^^ + | ^^^^^^^ not found in enum `EnTy` -error: cannot find attribute `lt_trait` in this scope +error: cannot find attribute `lt_trait` in trait `TrLt` --> $DIR/feature-gate-custom_attribute2.rs:14:14 | LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; } - | ^^^^^^^^ + | ^^^^^^^^ not found in trait `TrLt` -error: cannot find attribute `ty_trait` in this scope +error: cannot find attribute `ty_trait` in trait `TrTy` --> $DIR/feature-gate-custom_attribute2.rs:16:14 | LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); } - | ^^^^^^^^ + | ^^^^^^^^ not found in trait `TrTy` -error: cannot find attribute `lt_type` in this scope +error: cannot find attribute `lt_type` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:19:13 | LL | type TyLt<#[lt_type] 'd> = &'d u32; - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `ty_type` in this scope +error: cannot find attribute `ty_type` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:21:13 | LL | type TyTy<#[ty_type] L> = (L, ); - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `lt_inherent` in this scope +error: cannot find attribute `lt_inherent` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:24:8 | LL | impl<#[lt_inherent] 'e> StLt<'e> { } - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `ty_inherent` in this scope +error: cannot find attribute `ty_inherent` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:26:8 | LL | impl<#[ty_inherent] M> StTy { } - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `lt_impl_for` in this scope +error: cannot find attribute `lt_impl_for` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:29:8 | LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> { - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `ty_impl_for` in this scope +error: cannot find attribute `ty_impl_for` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:33:8 | LL | impl<#[ty_impl_for] N> TrTy for StTy { - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `lt_fn` in this scope +error: cannot find attribute `lt_fn` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:38:11 | LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } } - | ^^^^^ + | ^^^^^ not found in the crate root -error: cannot find attribute `ty_fn` in this scope +error: cannot find attribute `ty_fn` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:40:11 | LL | fn f_ty<#[ty_fn] O>(_: O) { } - | ^^^^^ + | ^^^^^ not found in the crate root -error: cannot find attribute `lt_meth` in this scope +error: cannot find attribute `lt_meth` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:44:15 | LL | fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } } - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `ty_meth` in this scope +error: cannot find attribute `ty_meth` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:46:15 | LL | fn m_ty<#[ty_meth] P>(_: P) { } - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find attribute `lt_hof` in this scope +error: cannot find attribute `lt_hof` in the crate root --> $DIR/feature-gate-custom_attribute2.rs:51:21 | LL | where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32 - | ^^^^^^ + | ^^^^^^ not found in the crate root error: aborting due to 17 previous errors diff --git a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs index cff273ce2c55a..07e9235039be5 100644 --- a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs +++ b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs @@ -1,5 +1,5 @@ use core::default; //~ ERROR unresolved import `core` fn main() { - let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve + let _: u8 = ::core::default::Default(); //~ ERROR cannot find item `core` } diff --git a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr index 2fcad98be9f73..d4a53f75c0868 100644 --- a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr +++ b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr @@ -4,14 +4,14 @@ error[E0432]: unresolved import `core` LL | use core::default; | ^^^^ | | - | maybe a missing crate `core`? + | you might be missing a crate named `core` | help: try using `std` instead of `core`: `std` -error[E0433]: failed to resolve: maybe a missing crate `core`? +error[E0433]: cannot find item `core` in the crate root --> $DIR/feature-gate-extern_absolute_paths.rs:4:19 | LL | let _: u8 = ::core::default::Default(); - | ^^^^ maybe a missing crate `core`? + | ^^^^ you might be missing a crate named `core` | help: try using `std` instead of `core` | diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs.rs b/tests/ui/feature-gates/feature-gate-rustc-attrs.rs index c985298a30aed..a1d2b00831f41 100644 --- a/tests/ui/feature-gates/feature-gate-rustc-attrs.rs +++ b/tests/ui/feature-gates/feature-gate-rustc-attrs.rs @@ -19,5 +19,5 @@ fn g() {} //~^ ERROR the `#[rustc_dummy]` attribute is just used for rustc unit tests #[rustc_unknown] //~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler -//~| ERROR cannot find attribute `rustc_unknown` in this scope +//~| ERROR cannot find attribute `rustc_unknown` fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr b/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr index c7a5ef3e44be7..4aaa657822e3f 100644 --- a/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr +++ b/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr @@ -28,11 +28,11 @@ error: attributes starting with `rustc` are reserved for use by the `rustc` comp LL | #[rustc_unknown] | ^^^^^^^^^^^^^ -error: cannot find attribute `rustc_unknown` in this scope +error: cannot find attribute `rustc_unknown` in the crate root --> $DIR/feature-gate-rustc-attrs.rs:20:3 | LL | #[rustc_unknown] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in the crate root error[E0658]: the `#[rustc_dummy]` attribute is just used for rustc unit tests and will never be stable --> $DIR/feature-gate-rustc-attrs.rs:18:1 diff --git a/tests/ui/feature-gates/issue-43106-gating-of-derive-2.rs b/tests/ui/feature-gates/issue-43106-gating-of-derive-2.rs index 3276309f745c2..0d9a6ea876d84 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-derive-2.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-derive-2.rs @@ -2,18 +2,18 @@ mod derive { #[derive(x3300)] - //~^ ERROR cannot find derive macro `x3300` in this scope - //~| ERROR cannot find derive macro `x3300` in this scope + //~^ ERROR cannot find derive macro `x3300` + //~| ERROR cannot find derive macro `x3300` union U { f: i32 } #[derive(x3300)] - //~^ ERROR cannot find derive macro `x3300` in this scope - //~| ERROR cannot find derive macro `x3300` in this scope + //~^ ERROR cannot find derive macro `x3300` + //~| ERROR cannot find derive macro `x3300` enum E { } #[derive(x3300)] - //~^ ERROR cannot find derive macro `x3300` in this scope - //~| ERROR cannot find derive macro `x3300` in this scope + //~^ ERROR cannot find derive macro `x3300` + //~| ERROR cannot find derive macro `x3300` struct S; } diff --git a/tests/ui/feature-gates/issue-43106-gating-of-derive-2.stderr b/tests/ui/feature-gates/issue-43106-gating-of-derive-2.stderr index 1e47259cb7ed5..f7f5114c11f01 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-derive-2.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-derive-2.stderr @@ -1,42 +1,42 @@ -error: cannot find derive macro `x3300` in this scope +error: cannot find derive macro `x3300` in module `derive` --> $DIR/issue-43106-gating-of-derive-2.rs:14:14 | LL | #[derive(x3300)] - | ^^^^^ + | ^^^^^ not found in module `derive` -error: cannot find derive macro `x3300` in this scope +error: cannot find derive macro `x3300` in module `derive` --> $DIR/issue-43106-gating-of-derive-2.rs:14:14 | LL | #[derive(x3300)] - | ^^^^^ + | ^^^^^ not found in module `derive` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: cannot find derive macro `x3300` in this scope +error: cannot find derive macro `x3300` in module `derive` --> $DIR/issue-43106-gating-of-derive-2.rs:9:14 | LL | #[derive(x3300)] - | ^^^^^ + | ^^^^^ not found in module `derive` -error: cannot find derive macro `x3300` in this scope +error: cannot find derive macro `x3300` in module `derive` --> $DIR/issue-43106-gating-of-derive-2.rs:9:14 | LL | #[derive(x3300)] - | ^^^^^ + | ^^^^^ not found in module `derive` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: cannot find derive macro `x3300` in this scope +error: cannot find derive macro `x3300` in module `derive` --> $DIR/issue-43106-gating-of-derive-2.rs:4:14 | LL | #[derive(x3300)] - | ^^^^^ + | ^^^^^ not found in module `derive` -error: cannot find derive macro `x3300` in this scope +error: cannot find derive macro `x3300` in module `derive` --> $DIR/issue-43106-gating-of-derive-2.rs:4:14 | LL | #[derive(x3300)] - | ^^^^^ + | ^^^^^ not found in module `derive` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/fmt/format-args-capture-issue-102057.rs b/tests/ui/fmt/format-args-capture-issue-102057.rs index b8089d49bcb3b..6e51afc643043 100644 --- a/tests/ui/fmt/format-args-capture-issue-102057.rs +++ b/tests/ui/fmt/format-args-capture-issue-102057.rs @@ -1,19 +1,19 @@ fn main() { format!("\x7Ba}"); - //~^ ERROR cannot find value `a` in this scope + //~^ ERROR cannot find value `a` format!("\x7Ba\x7D"); - //~^ ERROR cannot find value `a` in this scope + //~^ ERROR cannot find value `a` let a = 0; format!("\x7Ba} {b}"); - //~^ ERROR cannot find value `b` in this scope + //~^ ERROR cannot find value `b` format!("\x7Ba\x7D {b}"); - //~^ ERROR cannot find value `b` in this scope + //~^ ERROR cannot find value `b` format!("\x7Ba} \x7Bb}"); - //~^ ERROR cannot find value `b` in this scope + //~^ ERROR cannot find value `b` format!("\x7Ba\x7D \x7Bb}"); - //~^ ERROR cannot find value `b` in this scope + //~^ ERROR cannot find value `b` format!("\x7Ba\x7D \x7Bb\x7D"); - //~^ ERROR cannot find value `b` in this scope + //~^ ERROR cannot find value `b` } diff --git a/tests/ui/fmt/format-args-capture-issue-94010.rs b/tests/ui/fmt/format-args-capture-issue-94010.rs index bd03e9c93ae2a..2e925df188ebb 100644 --- a/tests/ui/fmt/format-args-capture-issue-94010.rs +++ b/tests/ui/fmt/format-args-capture-issue-94010.rs @@ -1,7 +1,7 @@ fn main() { const FOO: i32 = 123; println!("{foo:X}"); - //~^ ERROR: cannot find value `foo` in this scope + //~^ ERROR: cannot find value `foo` println!("{:.foo$}", 0); - //~^ ERROR: cannot find value `foo` in this scope + //~^ ERROR: cannot find value `foo` } diff --git a/tests/ui/fmt/format-args-capture-missing-variables.rs b/tests/ui/fmt/format-args-capture-missing-variables.rs index 46fc083cb7301..d1222c1d33447 100644 --- a/tests/ui/fmt/format-args-capture-missing-variables.rs +++ b/tests/ui/fmt/format-args-capture-missing-variables.rs @@ -1,12 +1,12 @@ fn main() { format!("{} {foo} {} {bar} {}", 1, 2, 3); - //~^ ERROR: cannot find value `foo` in this scope - //~^^ ERROR: cannot find value `bar` in this scope + //~^ ERROR: cannot find value `foo` + //~^^ ERROR: cannot find value `bar` - format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope + format!("{foo}"); //~ ERROR: cannot find value `foo` format!("{valuea} {valueb}", valuea=5, valuec=7); - //~^ ERROR cannot find value `valueb` in this scope + //~^ ERROR cannot find value `valueb` //~^^ ERROR named argument never used format!(r##" @@ -14,7 +14,7 @@ fn main() { {foo} "##); - //~^^^ ERROR: cannot find value `foo` in this scope + //~^^^ ERROR: cannot find value `foo` - panic!("{foo} {bar}", bar=1); //~ ERROR: cannot find value `foo` in this scope + panic!("{foo} {bar}", bar=1); //~ ERROR: cannot find value `foo` } diff --git a/tests/ui/fmt/ifmt-bad-arg.rs b/tests/ui/fmt/ifmt-bad-arg.rs index 68861d7bf3faf..7ca30cab494af 100644 --- a/tests/ui/fmt/ifmt-bad-arg.rs +++ b/tests/ui/fmt/ifmt-bad-arg.rs @@ -25,10 +25,10 @@ fn main() { //~^ ERROR: 6 positional arguments in format string, but there are 3 arguments format!("{} {foo} {} {bar} {}", 1, 2, 3); - //~^ ERROR: cannot find value `foo` in this scope - //~^^ ERROR: cannot find value `bar` in this scope + //~^ ERROR: cannot find value `foo` + //~^^ ERROR: cannot find value `bar` - format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope + format!("{foo}"); //~ ERROR: cannot find value `foo` format!("", 1, 2); //~ ERROR: multiple unused formatting arguments format!("{}", 1, 2); //~ ERROR: argument never used format!("{1}", 1, 2); //~ ERROR: argument never used @@ -43,7 +43,7 @@ fn main() { // bad named arguments, #35082 format!("{valuea} {valueb}", valuea=5, valuec=7); - //~^ ERROR cannot find value `valueb` in this scope + //~^ ERROR cannot find value `valueb` //~^^ ERROR named argument never used // bad syntax of the format string @@ -60,7 +60,7 @@ fn main() { {foo} "##); - //~^^^ ERROR: cannot find value `foo` in this scope + //~^^^ ERROR: cannot find value `foo` // bad syntax in format string with multiple newlines, #53836 format!("first number: {} diff --git a/tests/ui/for/for-expn.rs b/tests/ui/for/for-expn.rs index b9c4bbedac9f7..d5cf2aa33994d 100644 --- a/tests/ui/for/for-expn.rs +++ b/tests/ui/for/for-expn.rs @@ -3,7 +3,7 @@ fn main() { // Odd formatting to make sure we get the right span. for t in & - foo //~ ERROR cannot find value `foo` in this scope + foo //~ ERROR cannot find value `foo` { } } diff --git a/tests/ui/foreign/stashed-issue-121451.rs b/tests/ui/foreign/stashed-issue-121451.rs index 97a4af374758d..5735af9030105 100644 --- a/tests/ui/foreign/stashed-issue-121451.rs +++ b/tests/ui/foreign/stashed-issue-121451.rs @@ -1,4 +1,4 @@ extern "C" fn _f() -> libc::uintptr_t {} -//~^ ERROR failed to resolve: use of undeclared crate or module `libc` +//~^ ERROR cannot find item `libc` fn main() {} diff --git a/tests/ui/foreign/stashed-issue-121451.stderr b/tests/ui/foreign/stashed-issue-121451.stderr index 440d98d6f460d..c40665a97f2cd 100644 --- a/tests/ui/foreign/stashed-issue-121451.stderr +++ b/tests/ui/foreign/stashed-issue-121451.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `libc` +error[E0433]: cannot find item `libc` in this scope --> $DIR/stashed-issue-121451.rs:1:23 | LL | extern "C" fn _f() -> libc::uintptr_t {} diff --git a/tests/ui/functions-closures/fn-help-with-err-generic-is-not-function.rs b/tests/ui/functions-closures/fn-help-with-err-generic-is-not-function.rs index e48ab4aa96fb9..b9bb7f53b51ac 100644 --- a/tests/ui/functions-closures/fn-help-with-err-generic-is-not-function.rs +++ b/tests/ui/functions-closures/fn-help-with-err-generic-is-not-function.rs @@ -1,12 +1,12 @@ struct Struct(T); impl Struct -//~^ ERROR cannot find type `T` in this scope -//~| NOTE not found in this scope +//~^ ERROR cannot find type `T` +//~| NOTE not found //~| HELP you might be missing a type parameter where T: Copy, - //~^ ERROR cannot find type `T` in this scope - //~| NOTE not found in this scope + //~^ ERROR cannot find type `T` + //~| NOTE not found { fn method(v: Vec) { v.len(); } } diff --git a/tests/ui/functions-closures/fn-help-with-err.rs b/tests/ui/functions-closures/fn-help-with-err.rs index 612fe1b841918..01232d044339d 100644 --- a/tests/ui/functions-closures/fn-help-with-err.rs +++ b/tests/ui/functions-closures/fn-help-with-err.rs @@ -11,7 +11,7 @@ impl Bar for Foo {} fn main() { let arc = std::sync::Arc::new(oops); - //~^ ERROR cannot find value `oops` in this scope + //~^ ERROR cannot find value `oops` //~| NOTE not found arc.bar(); diff --git a/tests/ui/generic-associated-types/equality-bound.rs b/tests/ui/generic-associated-types/equality-bound.rs index be05181f5d09e..5ae4e435f8929 100644 --- a/tests/ui/generic-associated-types/equality-bound.rs +++ b/tests/ui/generic-associated-types/equality-bound.rs @@ -8,7 +8,7 @@ fn sum2(i: I) -> i32 where I::Item = i32 { } fn sum3(i: J) -> i32 where I::Item = i32 { //~^ ERROR equality constraints are not yet supported in `where` clauses -//~| ERROR failed to resolve: use of undeclared type `I` +//~| ERROR cannot find item `I` panic!() } @@ -19,7 +19,7 @@ struct X {} impl FromIterator for X { fn from_iter(_: T) -> Self where T: IntoIterator, IntoIterator::Item = A, //~^ ERROR equality constraints are not yet supported in `where` clauses - //~| ERROR cannot find type `A` in this scope + //~| ERROR cannot find type `A` { todo!() } @@ -30,7 +30,7 @@ struct Y {} impl FromIterator for Y { fn from_iter(_: T) -> Self where T: IntoIterator, T::Item = A, //~^ ERROR equality constraints are not yet supported in `where` clauses - //~| ERROR cannot find type `A` in this scope + //~| ERROR cannot find type `A` { todo!() } @@ -41,7 +41,7 @@ struct Z {} impl FromIterator for Z { fn from_iter(_: T) -> Self where IntoIterator::Item = A, //~^ ERROR equality constraints are not yet supported in `where` clauses - //~| ERROR cannot find type `A` in this scope + //~| ERROR cannot find type `A` { todo!() } @@ -52,7 +52,7 @@ struct K {} impl FromIterator for K { fn from_iter(_: T) -> Self where T::Item = A, //~^ ERROR equality constraints are not yet supported in `where` clauses - //~| ERROR cannot find type `A` in this scope + //~| ERROR cannot find type `A` { todo!() } @@ -63,7 +63,7 @@ struct L {} impl FromIterator for L { fn from_iter(_: T) -> Self where IntoIterator::Item = A, T: IntoIterator, //~^ ERROR equality constraints are not yet supported in `where` clauses - //~| ERROR cannot find type `A` in this scope + //~| ERROR cannot find type `A` { todo!() } @@ -74,7 +74,7 @@ struct M {} impl FromIterator for M { fn from_iter(_: T) -> Self where T::Item = A, T: IntoIterator, //~^ ERROR equality constraints are not yet supported in `where` clauses - //~| ERROR cannot find type `A` in this scope + //~| ERROR cannot find type `A` { todo!() } diff --git a/tests/ui/generic-associated-types/equality-bound.stderr b/tests/ui/generic-associated-types/equality-bound.stderr index a054c06caebde..194786cb482d0 100644 --- a/tests/ui/generic-associated-types/equality-bound.stderr +++ b/tests/ui/generic-associated-types/equality-bound.stderr @@ -164,7 +164,7 @@ LL | struct K {} LL | fn from_iter(_: T) -> Self where T::Item = A, T: IntoIterator, | ^ help: a struct with a similar name exists: `K` -error[E0433]: failed to resolve: use of undeclared type `I` +error[E0433]: cannot find item `I` in this scope --> $DIR/equality-bound.rs:9:41 | LL | fn sum3(i: J) -> i32 where I::Item = i32 { diff --git a/tests/ui/generics/issue-106694.rs b/tests/ui/generics/issue-106694.rs index c4b02ee81ec8f..5daa947bd466e 100644 --- a/tests/ui/generics/issue-106694.rs +++ b/tests/ui/generics/issue-106694.rs @@ -11,14 +11,14 @@ fn partially_correct_impl(_: impl &*const &Trait + Copy) {} fn foo_bad(_: impl &BadTrait) {} //~^ ERROR expected a trait, found type -//~^^ ERROR cannot find trait `BadTrait` in this scope +//~^^ ERROR cannot find trait `BadTrait` fn bar_bad(_: T) {} //~^ ERROR expected a trait, found type -//~^^ ERROR cannot find trait `BadTrait` in this scope +//~^^ ERROR cannot find trait `BadTrait` fn partially_correct_impl_bad(_: impl &*const &BadTrait + Copy) {} //~^ ERROR expected a trait, found type -//~^^ ERROR cannot find trait `BadTrait` in this scope +//~^^ ERROR cannot find trait `BadTrait` fn main() {} diff --git a/tests/ui/hygiene/arguments.rs b/tests/ui/hygiene/arguments.rs index ab58301d468b0..7490bda535157 100644 --- a/tests/ui/hygiene/arguments.rs +++ b/tests/ui/hygiene/arguments.rs @@ -11,5 +11,5 @@ macro m($t:ty, $e:expr) { fn main() { struct S; - m!(S, S); //~ ERROR cannot find type `S` in this scope + m!(S, S); //~ ERROR cannot find type `S` } diff --git a/tests/ui/hygiene/cross-crate-glob-hygiene.rs b/tests/ui/hygiene/cross-crate-glob-hygiene.rs index 81cc6927c1d28..f97010fbf8caf 100644 --- a/tests/ui/hygiene/cross-crate-glob-hygiene.rs +++ b/tests/ui/hygiene/cross-crate-glob-hygiene.rs @@ -19,5 +19,5 @@ use m::*; fn main() { let x = my_struct!(create); - //~^ ERROR cannot find struct, variant or union type `MyStruct` in this scope + //~^ ERROR cannot find struct, variant or union type `MyStruct` } diff --git a/tests/ui/hygiene/cross-crate-name-hiding-2.rs b/tests/ui/hygiene/cross-crate-name-hiding-2.rs index 2eae000b045e2..06019c5dd2bb9 100644 --- a/tests/ui/hygiene/cross-crate-name-hiding-2.rs +++ b/tests/ui/hygiene/cross-crate-name-hiding-2.rs @@ -11,5 +11,5 @@ my_struct!(define); fn main() { let x = MyStruct {}; - //~^ ERROR cannot find struct, variant or union type `MyStruct` in this scope + //~^ ERROR cannot find struct, variant or union type `MyStruct` } diff --git a/tests/ui/hygiene/cross-crate-name-hiding.rs b/tests/ui/hygiene/cross-crate-name-hiding.rs index 586e7647df74c..38cc83805cbd7 100644 --- a/tests/ui/hygiene/cross-crate-name-hiding.rs +++ b/tests/ui/hygiene/cross-crate-name-hiding.rs @@ -9,5 +9,5 @@ use pub_hygiene::*; fn main() { let x = MyStruct {}; - //~^ ERROR cannot find struct, variant or union type `MyStruct` in this scope + //~^ ERROR cannot find struct, variant or union type `MyStruct` } diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs index aaf831d1983e4..d66565074b1c6 100644 --- a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs +++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs @@ -10,7 +10,7 @@ macro a() { mod u { // Late resolution. fn f() { my_core::mem::drop(0); } - //~^ ERROR failed to resolve: use of undeclared crate or module `my_core` + //~^ ERROR cannot find item `my_core` } } @@ -23,7 +23,7 @@ mod v { mod u { // Late resolution. fn f() { my_core::mem::drop(0); } - //~^ ERROR failed to resolve: use of undeclared crate or module `my_core` + //~^ ERROR cannot find item `my_core` } fn main() {} diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr index cc229764ad3fb..3514eaad27613 100644 --- a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr +++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr @@ -15,7 +15,7 @@ LL | a!(); | = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0433]: failed to resolve: use of undeclared crate or module `my_core` +error[E0433]: cannot find item `my_core` in this scope --> $DIR/extern-prelude-from-opaque-fail-2018.rs:12:18 | LL | fn f() { my_core::mem::drop(0); } @@ -28,7 +28,7 @@ LL | a!(); std::mem = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0433]: failed to resolve: use of undeclared crate or module `my_core` +error[E0433]: cannot find item `my_core` in this scope --> $DIR/extern-prelude-from-opaque-fail-2018.rs:25:14 | LL | fn f() { my_core::mem::drop(0); } diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs b/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs index be3102aeab07f..d42d5ca5485f3 100644 --- a/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs +++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs @@ -10,7 +10,7 @@ macro a() { mod u { // Late resolution. fn f() { my_core::mem::drop(0); } - //~^ ERROR failed to resolve: use of undeclared crate or module `my_core` + //~^ ERROR cannot find item `my_core` } } @@ -23,7 +23,7 @@ mod v { mod u { // Late resolution. fn f() { my_core::mem::drop(0); } - //~^ ERROR failed to resolve: use of undeclared crate or module `my_core` + //~^ ERROR cannot find item `my_core` } fn main() {} diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr b/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr index 13b2827ef39b8..7b0ac9f31cfd5 100644 --- a/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr +++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr @@ -15,7 +15,7 @@ LL | a!(); | = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0433]: failed to resolve: use of undeclared crate or module `my_core` +error[E0433]: cannot find item `my_core` in this scope --> $DIR/extern-prelude-from-opaque-fail.rs:12:18 | LL | fn f() { my_core::mem::drop(0); } @@ -28,7 +28,7 @@ LL | a!(); my_core::mem = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0433]: failed to resolve: use of undeclared crate or module `my_core` +error[E0433]: cannot find item `my_core` in this scope --> $DIR/extern-prelude-from-opaque-fail.rs:25:14 | LL | fn f() { my_core::mem::drop(0); } diff --git a/tests/ui/hygiene/for-loop.rs b/tests/ui/hygiene/for-loop.rs index 2e5ae43a9ce47..40a3d2fb433ca 100644 --- a/tests/ui/hygiene/for-loop.rs +++ b/tests/ui/hygiene/for-loop.rs @@ -3,6 +3,6 @@ fn main() { for _ in 0..10 { - iter.next(); //~ ERROR cannot find value `iter` in this scope + iter.next(); //~ ERROR cannot find value `iter` } } diff --git a/tests/ui/hygiene/generate-mod.rs b/tests/ui/hygiene/generate-mod.rs index 8826293542c97..d7c9d41b20c7c 100644 --- a/tests/ui/hygiene/generate-mod.rs +++ b/tests/ui/hygiene/generate-mod.rs @@ -16,8 +16,8 @@ macro genmod_transparent() { type A = FromOutside; struct Outer; mod inner { - type A = FromOutside; //~ ERROR cannot find type `FromOutside` in this scope - type Inner = Outer; //~ ERROR cannot find type `Outer` in this scope + type A = FromOutside; //~ ERROR cannot find type `FromOutside` + type Inner = Outer; //~ ERROR cannot find type `Outer` } } @@ -25,15 +25,15 @@ macro_rules! genmod_legacy { () => { type A = FromOutside; struct Outer; mod inner { - type A = FromOutside; //~ ERROR cannot find type `FromOutside` in this scope - type Inner = Outer; //~ ERROR cannot find type `Outer` in this scope + type A = FromOutside; //~ ERROR cannot find type `FromOutside` + type Inner = Outer; //~ ERROR cannot find type `Outer` } }} fn check() { struct FromOutside; - genmod!(FromOutside, Outer); //~ ERROR cannot find type `FromOutside` in this scope - //~| ERROR cannot find type `Outer` in this scope + genmod!(FromOutside, Outer); //~ ERROR cannot find type `FromOutside` + //~| ERROR cannot find type `Outer` } fn check_transparent() { diff --git a/tests/ui/hygiene/globs.rs b/tests/ui/hygiene/globs.rs index a3f466ef435d3..507ec03ee9e97 100644 --- a/tests/ui/hygiene/globs.rs +++ b/tests/ui/hygiene/globs.rs @@ -12,14 +12,14 @@ macro m($($t:tt)*) { $($t)* use foo::*; f(); - g(); //~ ERROR cannot find function `g` in this scope + g(); //~ ERROR cannot find function `g` } fn main() { m! { use bar::*; g(); - f(); //~ ERROR cannot find function `f` in this scope + f(); //~ ERROR cannot find function `f` } } @@ -58,11 +58,11 @@ macro n($i:ident) { } } - n!(f); //~ ERROR cannot find function `f` in this scope + n!(f); //~ ERROR cannot find function `f` n_with_super!(f); mod test2 { super::n! { - f //~ ERROR cannot find function `f` in this scope + f //~ ERROR cannot find function `f` } super::n_with_super! { f diff --git a/tests/ui/hygiene/no_implicit_prelude-2018.rs b/tests/ui/hygiene/no_implicit_prelude-2018.rs index 015bff870908e..598b3a3dad200 100644 --- a/tests/ui/hygiene/no_implicit_prelude-2018.rs +++ b/tests/ui/hygiene/no_implicit_prelude-2018.rs @@ -4,7 +4,7 @@ mod bar { fn f() { ::std::print!(""); // OK - print!(); //~ ERROR cannot find macro `print` in this scope + print!(); //~ ERROR cannot find macro `print` } } diff --git a/tests/ui/hygiene/no_implicit_prelude-2018.stderr b/tests/ui/hygiene/no_implicit_prelude-2018.stderr index 7b124edf6f6db..40ca300a52939 100644 --- a/tests/ui/hygiene/no_implicit_prelude-2018.stderr +++ b/tests/ui/hygiene/no_implicit_prelude-2018.stderr @@ -2,7 +2,7 @@ error: cannot find macro `print` in this scope --> $DIR/no_implicit_prelude-2018.rs:7:9 | LL | print!(); - | ^^^^^ + | ^^^^^ not found in this scope | help: consider importing this macro | diff --git a/tests/ui/hygiene/no_implicit_prelude.rs b/tests/ui/hygiene/no_implicit_prelude.rs index e23826e9d4ef6..b1cdf081539a8 100644 --- a/tests/ui/hygiene/no_implicit_prelude.rs +++ b/tests/ui/hygiene/no_implicit_prelude.rs @@ -8,7 +8,7 @@ mod foo { #[no_implicit_prelude] mod bar { pub macro m() { - Vec::new(); //~ ERROR failed to resolve + Vec::new(); //~ ERROR cannot find item `Vec` ().clone() //~ ERROR no method named `clone` found } fn f() { diff --git a/tests/ui/hygiene/no_implicit_prelude.stderr b/tests/ui/hygiene/no_implicit_prelude.stderr index 5de6e3db327b1..461b2b7bc6f85 100644 --- a/tests/ui/hygiene/no_implicit_prelude.stderr +++ b/tests/ui/hygiene/no_implicit_prelude.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `Vec` +error[E0433]: cannot find item `Vec` in this scope --> $DIR/no_implicit_prelude.rs:11:9 | LL | fn f() { ::bar::m!(); } diff --git a/tests/ui/hygiene/pattern-macro.rs b/tests/ui/hygiene/pattern-macro.rs index e5d6a3aa1a0e6..e83287ec89d8c 100644 --- a/tests/ui/hygiene/pattern-macro.rs +++ b/tests/ui/hygiene/pattern-macro.rs @@ -2,5 +2,5 @@ macro_rules! foo { () => ( x ) } fn main() { let foo!() = 2; - x + 1; //~ ERROR cannot find value `x` in this scope + x + 1; //~ ERROR cannot find value `x` } diff --git a/tests/ui/hygiene/rustc-macro-transparency.rs b/tests/ui/hygiene/rustc-macro-transparency.rs index 5f36993af2f30..59c2faec40590 100644 --- a/tests/ui/hygiene/rustc-macro-transparency.rs +++ b/tests/ui/hygiene/rustc-macro-transparency.rs @@ -23,7 +23,7 @@ fn main() { Transparent; // OK SemiTransparent; // OK - Opaque; //~ ERROR cannot find value `Opaque` in this scope + Opaque; //~ ERROR cannot find value `Opaque` transparent; // OK semitransparent; //~ ERROR expected value, found macro `semitransparent` diff --git a/tests/ui/impl-trait/in-trait/ensure-rpitits-are-created-before-freezing.rs b/tests/ui/impl-trait/in-trait/ensure-rpitits-are-created-before-freezing.rs index 35a6acca52c7d..279b7f7a8b3d1 100644 --- a/tests/ui/impl-trait/in-trait/ensure-rpitits-are-created-before-freezing.rs +++ b/tests/ui/impl-trait/in-trait/ensure-rpitits-are-created-before-freezing.rs @@ -6,7 +6,7 @@ trait Iterable { // `ty::Error` in a trait ref will silence any missing item errors, but will also // prevent the `associated_items` query from being called before def ids are frozen. impl Iterable for Missing { -//~^ ERROR cannot find type `Missing` in this scope +//~^ ERROR cannot find type `Missing` fn iter(&self) -> Self::Item {} } diff --git a/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs index 4e46b7114c1a2..19225d527ffde 100644 --- a/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs +++ b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs @@ -4,7 +4,7 @@ use std::ops::Deref; pub trait Tr { fn w() -> impl Deref>; - //~^ ERROR cannot find type `Missing` in this scope + //~^ ERROR cannot find type `Missing` } impl Tr for () { diff --git a/tests/ui/impl-trait/issue-103181-2.rs b/tests/ui/impl-trait/issue-103181-2.rs index 72729e851e36b..08a014b788f56 100644 --- a/tests/ui/impl-trait/issue-103181-2.rs +++ b/tests/ui/impl-trait/issue-103181-2.rs @@ -10,7 +10,7 @@ impl SendFuture for Fut { async fn broken_fut() { ident_error; - //~^ ERROR cannot find value `ident_error` in this scope + //~^ ERROR cannot find value `ident_error` } // triggers normalization of `::Output`, diff --git a/tests/ui/impl-trait/issue-54966.rs b/tests/ui/impl-trait/issue-54966.rs index 0ed3c4b3ca945..f25f929084bb4 100644 --- a/tests/ui/impl-trait/issue-54966.rs +++ b/tests/ui/impl-trait/issue-54966.rs @@ -1,6 +1,6 @@ // issue-54966: ICE returning an unknown type with impl FnMut fn generate_duration() -> Oper {} -//~^ ERROR cannot find type `Oper` in this scope +//~^ ERROR cannot find type `Oper` fn main() {} diff --git a/tests/ui/impl-trait/issue-72911.rs b/tests/ui/impl-trait/issue-72911.rs index 63f4898f4306b..e1e22e2d9f4f5 100644 --- a/tests/ui/impl-trait/issue-72911.rs +++ b/tests/ui/impl-trait/issue-72911.rs @@ -9,12 +9,12 @@ pub fn gather_all() -> impl Iterator { } fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator { - //~^ ERROR: failed to resolve + //~^ ERROR: cannot find item `foo` unimplemented!() } fn lint_files() -> impl Iterator { - //~^ ERROR: failed to resolve + //~^ ERROR: cannot find item `foo` unimplemented!() } diff --git a/tests/ui/impl-trait/issue-72911.stderr b/tests/ui/impl-trait/issue-72911.stderr index 0e86561aa2779..2b879c26ce731 100644 --- a/tests/ui/impl-trait/issue-72911.stderr +++ b/tests/ui/impl-trait/issue-72911.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `foo` +error[E0433]: cannot find item `foo` in this scope --> $DIR/issue-72911.rs:11:33 | LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator { | ^^^ use of undeclared crate or module `foo` -error[E0433]: failed to resolve: use of undeclared crate or module `foo` +error[E0433]: cannot find item `foo` in this scope --> $DIR/issue-72911.rs:16:41 | LL | fn lint_files() -> impl Iterator { diff --git a/tests/ui/impl-trait/issues/issue-82139.rs b/tests/ui/impl-trait/issues/issue-82139.rs index 3f0b0f1a8dee0..056402e242860 100644 --- a/tests/ui/impl-trait/issues/issue-82139.rs +++ b/tests/ui/impl-trait/issues/issue-82139.rs @@ -12,7 +12,7 @@ impl Trait for Struct { type Associated = impl Bound; fn func() -> Self::Associated { - Some(42).map(|_| j) //~ ERROR cannot find value `j` in this scope + Some(42).map(|_| j) //~ ERROR cannot find value `j` } } diff --git a/tests/ui/impl-trait/precise-capturing/bad-params.rs b/tests/ui/impl-trait/precise-capturing/bad-params.rs index 08eee67c0e579..cbd6ec3ef5506 100644 --- a/tests/ui/impl-trait/precise-capturing/bad-params.rs +++ b/tests/ui/impl-trait/precise-capturing/bad-params.rs @@ -1,10 +1,10 @@ #![feature(precise_capturing)] fn missing() -> impl Sized + use {} -//~^ ERROR cannot find type `T` in this scope +//~^ ERROR cannot find type `T` fn missing_self() -> impl Sized + use {} -//~^ ERROR cannot find type `Self` in this scope +//~^ ERROR cannot find type `Self` struct MyType; impl MyType { diff --git a/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs b/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs index 15f2188262869..e0158626d587c 100644 --- a/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs +++ b/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs @@ -4,22 +4,22 @@ fn polarity() -> impl Sized + ?use<> {} //~^ ERROR expected identifier, found keyword `use` -//~| ERROR cannot find trait `r#use` in this scope +//~| ERROR cannot find trait `r#use` //~| WARN relaxing a default bound only does something for `?Sized` //~| WARN relaxing a default bound only does something for `?Sized` fn asyncness() -> impl Sized + async use<> {} //~^ ERROR expected identifier, found keyword `use` -//~| ERROR cannot find trait `r#use` in this scope +//~| ERROR cannot find trait `r#use` //~| ERROR async closures are unstable fn constness() -> impl Sized + const use<> {} //~^ ERROR expected identifier, found keyword `use` -//~| ERROR cannot find trait `r#use` in this scope +//~| ERROR cannot find trait `r#use` //~| ERROR const trait impls are experimental fn binder() -> impl Sized + for<'a> use<> {} //~^ ERROR expected identifier, found keyword `use` -//~| ERROR cannot find trait `r#use` in this scope +//~| ERROR cannot find trait `r#use` fn main() {} diff --git a/tests/ui/impl-trait/stashed-diag-issue-121504.rs b/tests/ui/impl-trait/stashed-diag-issue-121504.rs index 4ac8ffe8931c6..ec95ce89fad8f 100644 --- a/tests/ui/impl-trait/stashed-diag-issue-121504.rs +++ b/tests/ui/impl-trait/stashed-diag-issue-121504.rs @@ -4,7 +4,7 @@ trait MyTrait { async fn foo(self) -> (Self, i32); } -impl MyTrait for xyz::T { //~ ERROR failed to resolve: use of undeclared crate or module `xyz` +impl MyTrait for xyz::T { //~ ERROR cannot find item `xyz` async fn foo(self, key: i32) -> (u32, i32) { (self, key) } diff --git a/tests/ui/impl-trait/stashed-diag-issue-121504.stderr b/tests/ui/impl-trait/stashed-diag-issue-121504.stderr index 6a881dc7f9fbd..aa013b0d75371 100644 --- a/tests/ui/impl-trait/stashed-diag-issue-121504.stderr +++ b/tests/ui/impl-trait/stashed-diag-issue-121504.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `xyz` +error[E0433]: cannot find item `xyz` in this scope --> $DIR/stashed-diag-issue-121504.rs:7:18 | LL | impl MyTrait for xyz::T { diff --git a/tests/ui/implied-bounds/references-err.rs b/tests/ui/implied-bounds/references-err.rs index 203d512e39812..e059c2285eb89 100644 --- a/tests/ui/implied-bounds/references-err.rs +++ b/tests/ui/implied-bounds/references-err.rs @@ -12,7 +12,7 @@ trait Trait { impl Trait for () { type Assoc = DoesNotExist; - //~^ ERROR cannot find type `DoesNotExist` in this scope + //~^ ERROR cannot find type `DoesNotExist` fn tokenize(&self) -> ::Identity { unimplemented!() diff --git a/tests/ui/imports/absolute-paths-in-nested-use-groups.rs b/tests/ui/imports/absolute-paths-in-nested-use-groups.rs index 96b5131674c75..1c1f8fb359946 100644 --- a/tests/ui/imports/absolute-paths-in-nested-use-groups.rs +++ b/tests/ui/imports/absolute-paths-in-nested-use-groups.rs @@ -3,9 +3,12 @@ mod foo {} use foo::{ - ::bar, //~ ERROR crate root in paths can only be used in start position - super::bar, //~ ERROR `super` in paths can only be used in start position - self::bar, //~ ERROR `self` in paths can only be used in start position + ::bar, //~ ERROR cannot find module `{{root}}` + //~^ NOTE crate root in paths can only be used in start position + super::bar, //~ ERROR cannot find module `super` + //~^ NOTE `super` in paths can only be used in start position + self::bar, //~ ERROR cannot find module `self` + //~^ NOTE `self` in paths can only be used in start position }; fn main() {} diff --git a/tests/ui/imports/absolute-paths-in-nested-use-groups.stderr b/tests/ui/imports/absolute-paths-in-nested-use-groups.stderr index e41590ac45eed..7245f414c7ef2 100644 --- a/tests/ui/imports/absolute-paths-in-nested-use-groups.stderr +++ b/tests/ui/imports/absolute-paths-in-nested-use-groups.stderr @@ -1,17 +1,17 @@ -error[E0433]: failed to resolve: crate root in paths can only be used in start position +error[E0433]: cannot find module `{{root}}` in module `foo` --> $DIR/absolute-paths-in-nested-use-groups.rs:6:5 | LL | ::bar, | ^ crate root in paths can only be used in start position -error[E0433]: failed to resolve: `super` in paths can only be used in start position - --> $DIR/absolute-paths-in-nested-use-groups.rs:7:5 +error[E0433]: cannot find module `super` in module `foo` + --> $DIR/absolute-paths-in-nested-use-groups.rs:8:5 | LL | super::bar, | ^^^^^ `super` in paths can only be used in start position -error[E0433]: failed to resolve: `self` in paths can only be used in start position - --> $DIR/absolute-paths-in-nested-use-groups.rs:8:5 +error[E0433]: cannot find module `self` in module `foo` + --> $DIR/absolute-paths-in-nested-use-groups.rs:10:5 | LL | self::bar, | ^^^^ `self` in paths can only be used in start position diff --git a/tests/ui/imports/extern-prelude-extern-crate-fail.rs b/tests/ui/imports/extern-prelude-extern-crate-fail.rs index 2f018851d1936..5a73685ea7514 100644 --- a/tests/ui/imports/extern-prelude-extern-crate-fail.rs +++ b/tests/ui/imports/extern-prelude-extern-crate-fail.rs @@ -7,7 +7,7 @@ mod n { mod m { fn check() { - two_macros::m!(); //~ ERROR failed to resolve: use of undeclared crate or module `two_macros` + two_macros::m!(); //~ ERROR cannot find item `two_macros` } } diff --git a/tests/ui/imports/extern-prelude-extern-crate-fail.stderr b/tests/ui/imports/extern-prelude-extern-crate-fail.stderr index f7e37449eebe5..0887f5be77975 100644 --- a/tests/ui/imports/extern-prelude-extern-crate-fail.stderr +++ b/tests/ui/imports/extern-prelude-extern-crate-fail.stderr @@ -9,7 +9,7 @@ LL | define_std_as_non_existent!(); | = note: this error originates in the macro `define_std_as_non_existent` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0433]: failed to resolve: use of undeclared crate or module `two_macros` +error[E0433]: cannot find item `two_macros` in this scope --> $DIR/extern-prelude-extern-crate-fail.rs:10:9 | LL | two_macros::m!(); diff --git a/tests/ui/imports/glob-conflict-cross-crate-1.rs b/tests/ui/imports/glob-conflict-cross-crate-1.rs index 5f0433d13fcfd..4ff05a0fb0bab 100644 --- a/tests/ui/imports/glob-conflict-cross-crate-1.rs +++ b/tests/ui/imports/glob-conflict-cross-crate-1.rs @@ -3,10 +3,10 @@ extern crate glob_conflict; fn main() { - glob_conflict::f(); //~ ERROR cannot find function `f` in crate `glob_conflict` + glob_conflict::f(); //~ ERROR cannot find function `f` //^ FIXME: `glob_conflict::f` should raise an // ambiguity error instead of a not found error. - glob_conflict::glob::f(); //~ ERROR cannot find function `f` in module `glob_conflict::glob` + glob_conflict::glob::f(); //~ ERROR cannot find function `f` //^ FIXME: `glob_conflict::glob::f` should raise an // ambiguity error instead of a not found error. } diff --git a/tests/ui/imports/glob-conflict-cross-crate-1.stderr b/tests/ui/imports/glob-conflict-cross-crate-1.stderr index 758087107f397..83969fc70846e 100644 --- a/tests/ui/imports/glob-conflict-cross-crate-1.stderr +++ b/tests/ui/imports/glob-conflict-cross-crate-1.stderr @@ -2,13 +2,13 @@ error[E0425]: cannot find function `f` in crate `glob_conflict` --> $DIR/glob-conflict-cross-crate-1.rs:6:20 | LL | glob_conflict::f(); - | ^ not found in `glob_conflict` + | ^ not found in crate `glob_conflict` error[E0425]: cannot find function `f` in module `glob_conflict::glob` --> $DIR/glob-conflict-cross-crate-1.rs:9:26 | LL | glob_conflict::glob::f(); - | ^ not found in `glob_conflict::glob` + | ^ not found in module `glob_conflict::glob` error: aborting due to 2 previous errors diff --git a/tests/ui/imports/glob-conflict-cross-crate-2.rs b/tests/ui/imports/glob-conflict-cross-crate-2.rs index b764685dd5796..304fede3a6474 100644 --- a/tests/ui/imports/glob-conflict-cross-crate-2.rs +++ b/tests/ui/imports/glob-conflict-cross-crate-2.rs @@ -5,6 +5,6 @@ extern crate glob_conflict_cross_crate_2_extern; use glob_conflict_cross_crate_2_extern::*; fn main() { - let _a: C = 1; //~ ERROR cannot find type `C` in this scope + let _a: C = 1; //~ ERROR cannot find type `C` //^ FIXME: `C` should be identified as an ambiguous item. } diff --git a/tests/ui/imports/glob-resolve1.rs b/tests/ui/imports/glob-resolve1.rs index 904b77117dafc..79067bd9cfc7a 100644 --- a/tests/ui/imports/glob-resolve1.rs +++ b/tests/ui/imports/glob-resolve1.rs @@ -23,15 +23,15 @@ mod bar { fn foo() {} fn main() { - fpriv(); //~ ERROR cannot find function `fpriv` in this scope - epriv(); //~ ERROR cannot find function `epriv` in this scope + fpriv(); //~ ERROR cannot find function `fpriv` + epriv(); //~ ERROR cannot find function `epriv` B; //~ ERROR expected value, found enum `B` - C; //~ ERROR cannot find value `C` in this scope - import(); //~ ERROR: cannot find function `import` in this scope + C; //~ ERROR cannot find value `C` + import(); //~ ERROR: cannot find function `import` - foo::(); //~ ERROR: cannot find type `A` in this scope - foo::(); //~ ERROR: cannot find type `C` in this scope - foo::(); //~ ERROR: cannot find type `D` in this scope + foo::(); //~ ERROR: cannot find type `A` + foo::(); //~ ERROR: cannot find type `C` + foo::(); //~ ERROR: cannot find type `D` } mod other { diff --git a/tests/ui/imports/import-alias-issue-121168.rs b/tests/ui/imports/import-alias-issue-121168.rs index 826a6765b0399..393b83f0943a2 100644 --- a/tests/ui/imports/import-alias-issue-121168.rs +++ b/tests/ui/imports/import-alias-issue-121168.rs @@ -8,7 +8,7 @@ extern crate import_alias_issue_121168_extern as nice_crate_name; fn use_foo_from_another_crate_without_importing_it_first() { - let _: Foo = todo!(); //~ ERROR cannot find type `Foo` in this scope + let _: Foo = todo!(); //~ ERROR cannot find type `Foo` } fn main() {} diff --git a/tests/ui/imports/import-from-missing-star-2.stderr b/tests/ui/imports/import-from-missing-star-2.stderr index ea3876248c93f..06f6c854c6953 100644 --- a/tests/ui/imports/import-from-missing-star-2.stderr +++ b/tests/ui/imports/import-from-missing-star-2.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `spam` --> $DIR/import-from-missing-star-2.rs:2:9 | LL | use spam::*; - | ^^^^ maybe a missing crate `spam`? + | ^^^^ you might be missing a crate named `spam` | = help: consider adding `extern crate spam` to use the `spam` crate diff --git a/tests/ui/imports/import-from-missing-star-3.stderr b/tests/ui/imports/import-from-missing-star-3.stderr index 1fe5d4f19a97d..46b677c008af2 100644 --- a/tests/ui/imports/import-from-missing-star-3.stderr +++ b/tests/ui/imports/import-from-missing-star-3.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `spam` --> $DIR/import-from-missing-star-3.rs:2:9 | LL | use spam::*; - | ^^^^ maybe a missing crate `spam`? + | ^^^^ you might be missing a crate named `spam` | = help: consider adding `extern crate spam` to use the `spam` crate @@ -10,7 +10,7 @@ error[E0432]: unresolved import `spam` --> $DIR/import-from-missing-star-3.rs:27:13 | LL | use spam::*; - | ^^^^ maybe a missing crate `spam`? + | ^^^^ you might be missing a crate named `spam` | = help: consider adding `extern crate spam` to use the `spam` crate diff --git a/tests/ui/imports/import-from-missing-star.stderr b/tests/ui/imports/import-from-missing-star.stderr index f8e295078047f..c341ec81608b7 100644 --- a/tests/ui/imports/import-from-missing-star.stderr +++ b/tests/ui/imports/import-from-missing-star.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `spam` --> $DIR/import-from-missing-star.rs:1:5 | LL | use spam::*; - | ^^^^ maybe a missing crate `spam`? + | ^^^^ you might be missing a crate named `spam` | = help: consider adding `extern crate spam` to use the `spam` crate diff --git a/tests/ui/imports/import-glob-0.rs b/tests/ui/imports/import-glob-0.rs index 37a0d15456c67..36d8b2a221999 100644 --- a/tests/ui/imports/import-glob-0.rs +++ b/tests/ui/imports/import-glob-0.rs @@ -11,6 +11,6 @@ mod module_of_many_things { fn main() { f1(); f2(); - f999(); //~ ERROR cannot find function `f999` in this scope + f999(); //~ ERROR cannot find function `f999` f4(); } diff --git a/tests/ui/imports/import-glob-circular.rs b/tests/ui/imports/import-glob-circular.rs index e47fa870c0639..4dc45389e67c4 100644 --- a/tests/ui/imports/import-glob-circular.rs +++ b/tests/ui/imports/import-glob-circular.rs @@ -13,7 +13,7 @@ mod circ2 { mod test { use circ1::*; - fn test() { f1066(); } //~ ERROR cannot find function `f1066` in this scope + fn test() { f1066(); } //~ ERROR cannot find function `f1066` } fn main() {} diff --git a/tests/ui/imports/import3.stderr b/tests/ui/imports/import3.stderr index 80b0a7f061994..9fdc191e3c299 100644 --- a/tests/ui/imports/import3.stderr +++ b/tests/ui/imports/import3.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `main` --> $DIR/import3.rs:2:5 | LL | use main::bar; - | ^^^^ maybe a missing crate `main`? + | ^^^^ you might be missing a crate named `main` | = help: consider adding `extern crate main` to use the `main` crate diff --git a/tests/ui/imports/inaccessible_type_aliases.rs b/tests/ui/imports/inaccessible_type_aliases.rs index c3d4214e282d7..5adf459a448f7 100644 --- a/tests/ui/imports/inaccessible_type_aliases.rs +++ b/tests/ui/imports/inaccessible_type_aliases.rs @@ -8,7 +8,7 @@ mod b { } fn main() { - let x: Foo = 100; //~ ERROR: cannot find type `Foo` in this scope - let y: Bar = 100; //~ ERROR: cannot find type `Bar` in this scope + let x: Foo = 100; //~ ERROR: cannot find type `Foo` + let y: Bar = 100; //~ ERROR: cannot find type `Bar` println!("x: {}, y: {}", x, y); } diff --git a/tests/ui/imports/issue-109343.stderr b/tests/ui/imports/issue-109343.stderr index 1b95fcf55679f..a61d4af7848e4 100644 --- a/tests/ui/imports/issue-109343.stderr +++ b/tests/ui/imports/issue-109343.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `unresolved` --> $DIR/issue-109343.rs:4:9 | LL | pub use unresolved::f; - | ^^^^^^^^^^ maybe a missing crate `unresolved`? + | ^^^^^^^^^^ you might be missing a crate named `unresolved` | = help: consider adding `extern crate unresolved` to use the `unresolved` crate diff --git a/tests/ui/imports/issue-1697.rs b/tests/ui/imports/issue-1697.rs index 5cd76d21f91cf..5f7ef582c1aba 100644 --- a/tests/ui/imports/issue-1697.rs +++ b/tests/ui/imports/issue-1697.rs @@ -1,6 +1,6 @@ // Testing that we don't fail abnormally after hitting the errors use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432] - //~^ maybe a missing crate `unresolved`? + //~^ you might be missing a crate named `unresolved` fn main() {} diff --git a/tests/ui/imports/issue-1697.stderr b/tests/ui/imports/issue-1697.stderr index 840608ca2a14d..1d3d8c3a92f77 100644 --- a/tests/ui/imports/issue-1697.stderr +++ b/tests/ui/imports/issue-1697.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `unresolved` --> $DIR/issue-1697.rs:3:5 | LL | use unresolved::*; - | ^^^^^^^^^^ maybe a missing crate `unresolved`? + | ^^^^^^^^^^ you might be missing a crate named `unresolved` | = help: consider adding `extern crate unresolved` to use the `unresolved` crate diff --git a/tests/ui/imports/issue-33464.stderr b/tests/ui/imports/issue-33464.stderr index c4e5c55589914..a51e27916c3d7 100644 --- a/tests/ui/imports/issue-33464.stderr +++ b/tests/ui/imports/issue-33464.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `abc` --> $DIR/issue-33464.rs:3:5 | LL | use abc::one_el; - | ^^^ maybe a missing crate `abc`? + | ^^^ you might be missing a crate named `abc` | = help: consider adding `extern crate abc` to use the `abc` crate @@ -10,7 +10,7 @@ error[E0432]: unresolved import `abc` --> $DIR/issue-33464.rs:5:5 | LL | use abc::{a, bbb, cccccc}; - | ^^^ maybe a missing crate `abc`? + | ^^^ you might be missing a crate named `abc` | = help: consider adding `extern crate abc` to use the `abc` crate @@ -18,7 +18,7 @@ error[E0432]: unresolved import `a_very_long_name` --> $DIR/issue-33464.rs:7:5 | LL | use a_very_long_name::{el, el2}; - | ^^^^^^^^^^^^^^^^ maybe a missing crate `a_very_long_name`? + | ^^^^^^^^^^^^^^^^ you might be missing a crate named `a_very_long_name` | = help: consider adding `extern crate a_very_long_name` to use the `a_very_long_name` crate diff --git a/tests/ui/imports/issue-36881.stderr b/tests/ui/imports/issue-36881.stderr index e9b632d2718ce..fef0efe3d0f49 100644 --- a/tests/ui/imports/issue-36881.stderr +++ b/tests/ui/imports/issue-36881.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `issue_36881_aux` --> $DIR/issue-36881.rs:5:9 | LL | use issue_36881_aux::Foo; - | ^^^^^^^^^^^^^^^ maybe a missing crate `issue_36881_aux`? + | ^^^^^^^^^^^^^^^ you might be missing a crate named `issue_36881_aux` | = help: consider adding `extern crate issue_36881_aux` to use the `issue_36881_aux` crate diff --git a/tests/ui/imports/issue-37887.stderr b/tests/ui/imports/issue-37887.stderr index e7792ac0d159b..b06f71a916311 100644 --- a/tests/ui/imports/issue-37887.stderr +++ b/tests/ui/imports/issue-37887.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `test` --> $DIR/issue-37887.rs:3:9 | LL | use test::*; - | ^^^^ maybe a missing crate `test`? + | ^^^^ you might be missing a crate named `test` | = help: consider adding `extern crate test` to use the `test` crate diff --git a/tests/ui/imports/issue-4366-2.rs b/tests/ui/imports/issue-4366-2.rs index c777b750252c2..9f243d879c327 100644 --- a/tests/ui/imports/issue-4366-2.rs +++ b/tests/ui/imports/issue-4366-2.rs @@ -13,7 +13,7 @@ mod a { pub mod sub { use a::b::*; fn sub() -> Bar { 1 } - //~^ ERROR cannot find type `Bar` in this scope + //~^ ERROR cannot find type `Bar` } } diff --git a/tests/ui/imports/issue-4366.rs b/tests/ui/imports/issue-4366.rs index 9ec2e58ecadcb..aaec6c599d977 100644 --- a/tests/ui/imports/issue-4366.rs +++ b/tests/ui/imports/issue-4366.rs @@ -15,7 +15,7 @@ mod a { } pub mod sub { use a::b::*; - fn sub() -> isize { foo(); 1 } //~ ERROR cannot find function `foo` in this scope + fn sub() -> isize { foo(); 1 } //~ ERROR cannot find function `foo` } } diff --git a/tests/ui/imports/issue-53269.stderr b/tests/ui/imports/issue-53269.stderr index 29c7556dac432..67559f691b66a 100644 --- a/tests/ui/imports/issue-53269.stderr +++ b/tests/ui/imports/issue-53269.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `nonexistent_module` --> $DIR/issue-53269.rs:6:9 | LL | use nonexistent_module::mac; - | ^^^^^^^^^^^^^^^^^^ maybe a missing crate `nonexistent_module`? + | ^^^^^^^^^^^^^^^^^^ you might be missing a crate named `nonexistent_module` | = help: consider adding `extern crate nonexistent_module` to use the `nonexistent_module` crate diff --git a/tests/ui/imports/issue-55457.stderr b/tests/ui/imports/issue-55457.stderr index 09bb13a060478..0ca61b6160948 100644 --- a/tests/ui/imports/issue-55457.stderr +++ b/tests/ui/imports/issue-55457.stderr @@ -11,7 +11,7 @@ error[E0432]: unresolved import `non_existent` --> $DIR/issue-55457.rs:2:5 | LL | use non_existent::non_existent; - | ^^^^^^^^^^^^ maybe a missing crate `non_existent`? + | ^^^^^^^^^^^^ you might be missing a crate named `non_existent` | = help: consider adding `extern crate non_existent` to use the `non_existent` crate diff --git a/tests/ui/imports/issue-59764.rs b/tests/ui/imports/issue-59764.rs index 5f7a496117a6a..fb976792b9799 100644 --- a/tests/ui/imports/issue-59764.rs +++ b/tests/ui/imports/issue-59764.rs @@ -131,5 +131,5 @@ makro!(bar); fn main() { bar(); - //~^ ERROR cannot find function `bar` in this scope [E0425] + //~^ ERROR cannot find function `bar` } diff --git a/tests/ui/imports/issue-81413.stderr b/tests/ui/imports/issue-81413.stderr index c2a3212501181..b884f4807097e 100644 --- a/tests/ui/imports/issue-81413.stderr +++ b/tests/ui/imports/issue-81413.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `doesnt_exist` --> $DIR/issue-81413.rs:7:9 | LL | pub use doesnt_exist::*; - | ^^^^^^^^^^^^ maybe a missing crate `doesnt_exist`? + | ^^^^^^^^^^^^ you might be missing a crate named `doesnt_exist` | = help: consider adding `extern crate doesnt_exist` to use the `doesnt_exist` crate diff --git a/tests/ui/imports/suggest-import-issue-120074.rs b/tests/ui/imports/suggest-import-issue-120074.rs index a798e9eeeb809..feecc30e1db73 100644 --- a/tests/ui/imports/suggest-import-issue-120074.rs +++ b/tests/ui/imports/suggest-import-issue-120074.rs @@ -7,5 +7,5 @@ pub mod foo { } fn main() { - println!("Hello, {}!", crate::bar::do_the_thing); //~ ERROR failed to resolve: unresolved import + println!("Hello, {}!", crate::bar::do_the_thing); //~ ERROR cannot find item `bar` } diff --git a/tests/ui/imports/suggest-import-issue-120074.stderr b/tests/ui/imports/suggest-import-issue-120074.stderr index c1dff93bbdbff..3f8128e958ad7 100644 --- a/tests/ui/imports/suggest-import-issue-120074.stderr +++ b/tests/ui/imports/suggest-import-issue-120074.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: unresolved import +error[E0433]: cannot find item `bar` in the crate root --> $DIR/suggest-import-issue-120074.rs:10:35 | LL | println!("Hello, {}!", crate::bar::do_the_thing); diff --git a/tests/ui/imports/tool-mod-child.rs b/tests/ui/imports/tool-mod-child.rs index 4581dc2e2ad88..7b72a30606350 100644 --- a/tests/ui/imports/tool-mod-child.rs +++ b/tests/ui/imports/tool-mod-child.rs @@ -1,7 +1,7 @@ use clippy::a; //~ ERROR unresolved import `clippy` -use clippy::a::b; //~ ERROR failed to resolve: maybe a missing crate `clippy`? +use clippy::a::b; //~ ERROR cannot find item `clippy` use rustdoc::a; //~ ERROR unresolved import `rustdoc` -use rustdoc::a::b; //~ ERROR failed to resolve: maybe a missing crate `rustdoc`? +use rustdoc::a::b; //~ ERROR cannot find item `rustdoc` fn main() {} diff --git a/tests/ui/imports/tool-mod-child.stderr b/tests/ui/imports/tool-mod-child.stderr index 6caf15bc72401..015a08005d2d2 100644 --- a/tests/ui/imports/tool-mod-child.stderr +++ b/tests/ui/imports/tool-mod-child.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve: maybe a missing crate `clippy`? +error[E0433]: cannot find item `clippy` in the crate root --> $DIR/tool-mod-child.rs:2:5 | LL | use clippy::a::b; - | ^^^^^^ maybe a missing crate `clippy`? + | ^^^^^^ you might be missing a crate named `clippy` | = help: consider adding `extern crate clippy` to use the `clippy` crate @@ -10,15 +10,15 @@ error[E0432]: unresolved import `clippy` --> $DIR/tool-mod-child.rs:1:5 | LL | use clippy::a; - | ^^^^^^ maybe a missing crate `clippy`? + | ^^^^^^ you might be missing a crate named `clippy` | = help: consider adding `extern crate clippy` to use the `clippy` crate -error[E0433]: failed to resolve: maybe a missing crate `rustdoc`? +error[E0433]: cannot find item `rustdoc` in the crate root --> $DIR/tool-mod-child.rs:5:5 | LL | use rustdoc::a::b; - | ^^^^^^^ maybe a missing crate `rustdoc`? + | ^^^^^^^ you might be missing a crate named `rustdoc` | = help: consider adding `extern crate rustdoc` to use the `rustdoc` crate @@ -26,7 +26,7 @@ error[E0432]: unresolved import `rustdoc` --> $DIR/tool-mod-child.rs:4:5 | LL | use rustdoc::a; - | ^^^^^^^ maybe a missing crate `rustdoc`? + | ^^^^^^^ you might be missing a crate named `rustdoc` | = help: consider adding `extern crate rustdoc` to use the `rustdoc` crate diff --git a/tests/ui/imports/unresolved-imports-used.stderr b/tests/ui/imports/unresolved-imports-used.stderr index 73f9d1bfb6c61..a791efd715d3e 100644 --- a/tests/ui/imports/unresolved-imports-used.stderr +++ b/tests/ui/imports/unresolved-imports-used.stderr @@ -14,7 +14,7 @@ error[E0432]: unresolved import `foo` --> $DIR/unresolved-imports-used.rs:11:5 | LL | use foo::bar; - | ^^^ maybe a missing crate `foo`? + | ^^^ you might be missing a crate named `foo` | = help: consider adding `extern crate foo` to use the `foo` crate @@ -22,7 +22,7 @@ error[E0432]: unresolved import `baz` --> $DIR/unresolved-imports-used.rs:12:5 | LL | use baz::*; - | ^^^ maybe a missing crate `baz`? + | ^^^ you might be missing a crate named `baz` | = help: consider adding `extern crate baz` to use the `baz` crate @@ -30,7 +30,7 @@ error[E0432]: unresolved import `foo2` --> $DIR/unresolved-imports-used.rs:14:5 | LL | use foo2::bar2; - | ^^^^ maybe a missing crate `foo2`? + | ^^^^ you might be missing a crate named `foo2` | = help: consider adding `extern crate foo2` to use the `foo2` crate @@ -38,7 +38,7 @@ error[E0432]: unresolved import `baz2` --> $DIR/unresolved-imports-used.rs:15:5 | LL | use baz2::*; - | ^^^^ maybe a missing crate `baz2`? + | ^^^^ you might be missing a crate named `baz2` | = help: consider adding `extern crate baz2` to use the `baz2` crate diff --git a/tests/ui/issues-71798.rs b/tests/ui/issues-71798.rs index 14b6c0f35812f..500d137c3b85f 100644 --- a/tests/ui/issues-71798.rs +++ b/tests/ui/issues-71798.rs @@ -4,5 +4,5 @@ fn test_ref(x: &u32) -> impl std::future::Future + '_ { } fn main() { - let _ = test_ref & u; //~ ERROR cannot find value `u` in this scope + let _ = test_ref & u; //~ ERROR cannot find value `u` } diff --git a/tests/ui/issues/issue-15167.rs b/tests/ui/issues/issue-15167.rs index a2653c10ea4f7..64828cc8cab2f 100644 --- a/tests/ui/issues/issue-15167.rs +++ b/tests/ui/issues/issue-15167.rs @@ -1,10 +1,10 @@ // macro f should not be able to inject a reference to 'n'. macro_rules! f { () => (n) } -//~^ ERROR cannot find value `n` in this scope -//~| ERROR cannot find value `n` in this scope -//~| ERROR cannot find value `n` in this scope -//~| ERROR cannot find value `n` in this scope +//~^ ERROR cannot find value `n` +//~| ERROR cannot find value `n` +//~| ERROR cannot find value `n` +//~| ERROR cannot find value `n` fn main() -> (){ for n in 0..1 { diff --git a/tests/ui/issues/issue-18058.rs b/tests/ui/issues/issue-18058.rs index cced66717e1bf..959359c7ccd6c 100644 --- a/tests/ui/issues/issue-18058.rs +++ b/tests/ui/issues/issue-18058.rs @@ -1,4 +1,4 @@ impl Undefined {} -//~^ ERROR cannot find type `Undefined` in this scope +//~^ ERROR cannot find type `Undefined` fn main() {} diff --git a/tests/ui/issues/issue-19734.rs b/tests/ui/issues/issue-19734.rs index fe4a327aef49c..7b8394982290e 100644 --- a/tests/ui/issues/issue-19734.rs +++ b/tests/ui/issues/issue-19734.rs @@ -4,5 +4,5 @@ struct Type; impl Type { undef!(); - //~^ ERROR cannot find macro `undef` in this scope + //~^ ERROR cannot find macro `undef` } diff --git a/tests/ui/issues/issue-19734.stderr b/tests/ui/issues/issue-19734.stderr index ed48714fe5078..0b79d04ee349a 100644 --- a/tests/ui/issues/issue-19734.stderr +++ b/tests/ui/issues/issue-19734.stderr @@ -1,8 +1,8 @@ -error: cannot find macro `undef` in this scope +error: cannot find macro `undef` in the crate root --> $DIR/issue-19734.rs:6:5 | LL | undef!(); - | ^^^^^ + | ^^^^^ not found in the crate root error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-2281-part1.rs b/tests/ui/issues/issue-2281-part1.rs index 8340ade2239d1..a44fabaf47996 100644 --- a/tests/ui/issues/issue-2281-part1.rs +++ b/tests/ui/issues/issue-2281-part1.rs @@ -1 +1 @@ -fn main() { println!("{}", foobar); } //~ ERROR cannot find value `foobar` in this scope +fn main() { println!("{}", foobar); } //~ ERROR cannot find value `foobar` diff --git a/tests/ui/issues/issue-30589.rs b/tests/ui/issues/issue-30589.rs index 94eb5839958af..eb89925901ab6 100644 --- a/tests/ui/issues/issue-30589.rs +++ b/tests/ui/issues/issue-30589.rs @@ -1,6 +1,6 @@ use std::fmt; -impl fmt::Display for DecoderError { //~ ERROR cannot find type `DecoderError` in this scope +impl fmt::Display for DecoderError { //~ ERROR cannot find type `DecoderError` fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Missing data: {}", self.0) } diff --git a/tests/ui/issues/issue-32655.rs b/tests/ui/issues/issue-32655.rs index f52e092312968..f6b631d721ae1 100644 --- a/tests/ui/issues/issue-32655.rs +++ b/tests/ui/issues/issue-32655.rs @@ -1,6 +1,6 @@ macro_rules! foo ( () => ( - #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` in this scope + #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` struct T; ); ); @@ -12,7 +12,7 @@ macro_rules! bar ( foo!(); bar!( - #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` in this scope + #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` struct S; ); diff --git a/tests/ui/issues/issue-32655.stderr b/tests/ui/issues/issue-32655.stderr index b8362499b2d0a..fff7a9c687930 100644 --- a/tests/ui/issues/issue-32655.stderr +++ b/tests/ui/issues/issue-32655.stderr @@ -1,8 +1,11 @@ -error: cannot find attribute `derive_Clone` in this scope +error: cannot find attribute `derive_Clone` in the crate root --> $DIR/issue-32655.rs:3:11 | LL | #[derive_Clone] - | ^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `derive_const` + | ^^^^^^^^^^^^ + | | + | not found in the crate root + | help: an attribute macro with a similar name exists: `derive_const` ... LL | foo!(); | ------ in this macro invocation @@ -12,11 +15,14 @@ LL | foo!(); | = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) -error: cannot find attribute `derive_Clone` in this scope +error: cannot find attribute `derive_Clone` in the crate root --> $DIR/issue-32655.rs:15:7 | LL | #[derive_Clone] - | ^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `derive_const` + | ^^^^^^^^^^^^ + | | + | not found in the crate root + | help: an attribute macro with a similar name exists: `derive_const` --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | = note: similarly named attribute macro `derive_const` defined here diff --git a/tests/ui/issues/issue-32950.rs b/tests/ui/issues/issue-32950.rs index 27d68a11c1f16..18b45ca632bc1 100644 --- a/tests/ui/issues/issue-32950.rs +++ b/tests/ui/issues/issue-32950.rs @@ -3,7 +3,7 @@ #[derive(Debug)] struct Baz( concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros - //~^ ERROR cannot find type `FooBar` in this scope + //~^ ERROR cannot find type `FooBar` ); fn main() {} diff --git a/tests/ui/issues/issue-33293.rs b/tests/ui/issues/issue-33293.rs index a6ef007d51fb5..16bcc640a17e3 100644 --- a/tests/ui/issues/issue-33293.rs +++ b/tests/ui/issues/issue-33293.rs @@ -1,6 +1,6 @@ fn main() { match 0 { aaa::bbb(_) => () - //~^ ERROR failed to resolve: use of undeclared crate or module `aaa` + //~^ ERROR cannot find item `aaa` }; } diff --git a/tests/ui/issues/issue-33293.stderr b/tests/ui/issues/issue-33293.stderr index 5badaa153f2b1..38aa29949edb0 100644 --- a/tests/ui/issues/issue-33293.stderr +++ b/tests/ui/issues/issue-33293.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `aaa` +error[E0433]: cannot find item `aaa` in this scope --> $DIR/issue-33293.rs:3:9 | LL | aaa::bbb(_) => () diff --git a/tests/ui/issues/issue-33571.rs b/tests/ui/issues/issue-33571.rs index 2713f47ad2ff6..c452b14e98616 100644 --- a/tests/ui/issues/issue-33571.rs +++ b/tests/ui/issues/issue-33571.rs @@ -1,6 +1,6 @@ #[derive(Clone, - Sync, //~ ERROR cannot find derive macro `Sync` in this scope - //~| ERROR cannot find derive macro `Sync` in this scope + Sync, //~ ERROR cannot find derive macro `Sync` + //~| ERROR cannot find derive macro `Sync` Copy)] enum Foo {} diff --git a/tests/ui/issues/issue-33571.stderr b/tests/ui/issues/issue-33571.stderr index 819a533ddbe2f..b97dd30d34037 100644 --- a/tests/ui/issues/issue-33571.stderr +++ b/tests/ui/issues/issue-33571.stderr @@ -1,8 +1,8 @@ -error: cannot find derive macro `Sync` in this scope +error: cannot find derive macro `Sync` in the crate root --> $DIR/issue-33571.rs:2:10 | LL | Sync, - | ^^^^ + | ^^^^ not found in the crate root | note: unsafe traits like `Sync` should be implemented explicitly --> $DIR/issue-33571.rs:2:10 @@ -10,11 +10,11 @@ note: unsafe traits like `Sync` should be implemented explicitly LL | Sync, | ^^^^ -error: cannot find derive macro `Sync` in this scope +error: cannot find derive macro `Sync` in the crate root --> $DIR/issue-33571.rs:2:10 | LL | Sync, - | ^^^^ + | ^^^^ not found in the crate root | note: unsafe traits like `Sync` should be implemented explicitly --> $DIR/issue-33571.rs:2:10 diff --git a/tests/ui/issues/issue-36836.rs b/tests/ui/issues/issue-36836.rs index 99c56213153e4..67597a779d052 100644 --- a/tests/ui/issues/issue-36836.rs +++ b/tests/ui/issues/issue-36836.rs @@ -10,6 +10,6 @@ trait Foo {} -impl Foo for Bar {} //~ ERROR cannot find type `Bar` in this scope +impl Foo for Bar {} //~ ERROR cannot find type `Bar` fn main() {} diff --git a/tests/ui/issues/issue-38857.rs b/tests/ui/issues/issue-38857.rs index 81d881c100bb6..b2cc88515658c 100644 --- a/tests/ui/issues/issue-38857.rs +++ b/tests/ui/issues/issue-38857.rs @@ -1,5 +1,5 @@ fn main() { let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; - //~^ ERROR failed to resolve: could not find `imp` in `sys` [E0433] + //~^ ERROR cannot find item `imp` //~^^ ERROR module `sys` is private [E0603] } diff --git a/tests/ui/issues/issue-38857.stderr b/tests/ui/issues/issue-38857.stderr index 4d505784b8654..d7b2d0af95fb6 100644 --- a/tests/ui/issues/issue-38857.stderr +++ b/tests/ui/issues/issue-38857.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `imp` in `sys` +error[E0433]: cannot find item `imp` in module `sys` --> $DIR/issue-38857.rs:2:23 | LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; diff --git a/tests/ui/issues/issue-40845.rs b/tests/ui/issues/issue-40845.rs index a4ede6adfa3c2..76bbcca621001 100644 --- a/tests/ui/issues/issue-40845.rs +++ b/tests/ui/issues/issue-40845.rs @@ -1,6 +1,6 @@ -trait T { m!(); } //~ ERROR cannot find macro `m` in this scope +trait T { m!(); } //~ ERROR cannot find macro `m` struct S; -impl S { m!(); } //~ ERROR cannot find macro `m` in this scope +impl S { m!(); } //~ ERROR cannot find macro `m` fn main() {} diff --git a/tests/ui/issues/issue-40845.stderr b/tests/ui/issues/issue-40845.stderr index 66bf053204c08..9a01e749f6479 100644 --- a/tests/ui/issues/issue-40845.stderr +++ b/tests/ui/issues/issue-40845.stderr @@ -1,14 +1,14 @@ -error: cannot find macro `m` in this scope +error: cannot find macro `m` in trait `T` --> $DIR/issue-40845.rs:1:11 | LL | trait T { m!(); } - | ^ + | ^ not found in trait `T` -error: cannot find macro `m` in this scope +error: cannot find macro `m` in the crate root --> $DIR/issue-40845.rs:4:10 | LL | impl S { m!(); } - | ^ + | ^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-46101.rs b/tests/ui/issues/issue-46101.rs index ab3d30d401f06..9c93683a82016 100644 --- a/tests/ui/issues/issue-46101.rs +++ b/tests/ui/issues/issue-46101.rs @@ -1,6 +1,6 @@ trait Foo {} -#[derive(Foo::Anything)] //~ ERROR failed to resolve: partially resolved path in a derive macro - //~| ERROR failed to resolve: partially resolved path in a derive macro +#[derive(Foo::Anything)] //~ ERROR cannot find item `Anything` + //~| ERROR cannot find item `Anything` struct S; fn main() {} diff --git a/tests/ui/issues/issue-46101.stderr b/tests/ui/issues/issue-46101.stderr index a0cdd5d5f0532..952c265ea50f0 100644 --- a/tests/ui/issues/issue-46101.stderr +++ b/tests/ui/issues/issue-46101.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: partially resolved path in a derive macro +error[E0433]: cannot find item `Anything` in this scope --> $DIR/issue-46101.rs:2:10 | LL | #[derive(Foo::Anything)] | ^^^^^^^^^^^^^ partially resolved path in a derive macro -error[E0433]: failed to resolve: partially resolved path in a derive macro +error[E0433]: cannot find item `Anything` in this scope --> $DIR/issue-46101.rs:2:10 | LL | #[derive(Foo::Anything)] diff --git a/tests/ui/issues/issue-46332.rs b/tests/ui/issues/issue-46332.rs index bed74e3138a66..c4af03438ed82 100644 --- a/tests/ui/issues/issue-46332.rs +++ b/tests/ui/issues/issue-46332.rs @@ -7,5 +7,5 @@ struct TyInt {} fn main() { TyUInt {}; - //~^ ERROR cannot find struct, variant or union type `TyUInt` in this scope + //~^ ERROR cannot find struct, variant or union type `TyUInt` } diff --git a/tests/ui/issues/issue-53300.rs b/tests/ui/issues/issue-53300.rs index 09f0fe9d93553..cc63356fc76ef 100644 --- a/tests/ui/issues/issue-53300.rs +++ b/tests/ui/issues/issue-53300.rs @@ -5,7 +5,7 @@ pub trait A { } fn addition() -> Wrapper {} -//~^ ERROR cannot find type `Wrapper` in this scope [E0412] +//~^ ERROR cannot find type `Wrapper` fn main() { let res = addition(); diff --git a/tests/ui/issues/issue-58712.rs b/tests/ui/issues/issue-58712.rs index 930bec6889bce..1ec787819d893 100644 --- a/tests/ui/issues/issue-58712.rs +++ b/tests/ui/issues/issue-58712.rs @@ -4,9 +4,9 @@ struct AddrVec { } impl AddrVec { - //~^ ERROR cannot find type `DeviceId` in this scope + //~^ ERROR cannot find type `DeviceId` pub fn device(&self) -> DeviceId { - //~^ ERROR cannot find type `DeviceId` in this scope + //~^ ERROR cannot find type `DeviceId` self.tail() } } diff --git a/tests/ui/issues/issue-71406.rs b/tests/ui/issues/issue-71406.rs index 6266112c3a86c..d5a0165a69569 100644 --- a/tests/ui/issues/issue-71406.rs +++ b/tests/ui/issues/issue-71406.rs @@ -2,5 +2,6 @@ use std::sync::mpsc; fn main() { let (tx, rx) = mpsc::channel::new(1); - //~^ ERROR expected type, found function `channel` in `mpsc` + //~^ ERROR cannot find item `channel` + //~| NOTE expected type, found function `channel` in `mpsc` } diff --git a/tests/ui/issues/issue-71406.stderr b/tests/ui/issues/issue-71406.stderr index cd7921f550e5d..dd61b7882aac5 100644 --- a/tests/ui/issues/issue-71406.stderr +++ b/tests/ui/issues/issue-71406.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: expected type, found function `channel` in `mpsc` +error[E0433]: cannot find item `channel` in module `mpsc` --> $DIR/issue-71406.rs:4:26 | LL | let (tx, rx) = mpsc::channel::new(1); diff --git a/tests/ui/issues/issue-77919.rs b/tests/ui/issues/issue-77919.rs index bf603314977f9..1fbf5418f45a3 100644 --- a/tests/ui/issues/issue-77919.rs +++ b/tests/ui/issues/issue-77919.rs @@ -6,8 +6,8 @@ trait TypeVal { } struct Five; struct Multiply { - _n: PhantomData, //~ ERROR cannot find type `PhantomData` in this scope + _n: PhantomData, //~ ERROR cannot find type `PhantomData` } impl TypeVal for Multiply where N: TypeVal {} -//~^ ERROR cannot find type `VAL` in this scope +//~^ ERROR cannot find type `VAL` //~| ERROR not all trait items implemented diff --git a/tests/ui/issues/issue-86756.rs b/tests/ui/issues/issue-86756.rs index 7f864eb285074..1a181754f8e64 100644 --- a/tests/ui/issues/issue-86756.rs +++ b/tests/ui/issues/issue-86756.rs @@ -3,7 +3,7 @@ trait Foo {} fn eq() { eq:: - //~^ ERROR cannot find type `dyn` in this scope + //~^ ERROR cannot find type `dyn` //~| ERROR missing generics for trait `Foo` //~| WARN trait objects without an explicit `dyn` are deprecated //~| WARN this is accepted in the current edition diff --git a/tests/ui/issues/issue-8767.rs b/tests/ui/issues/issue-8767.rs index 972101a0bc3ee..806e8e7213243 100644 --- a/tests/ui/issues/issue-8767.rs +++ b/tests/ui/issues/issue-8767.rs @@ -1,4 +1,4 @@ -impl B { //~ ERROR cannot find type `B` in this scope +impl B { //~ ERROR cannot find type `B` } fn main() { diff --git a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr index 54ee45c28679a..8693616535e06 100644 --- a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr +++ b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr @@ -13,9 +13,7 @@ error[E0432]: unresolved import `r#extern` --> $DIR/keyword-extern-as-identifier-use.rs:1:5 | LL | use extern::foo; - | ^^^^^^ maybe a missing crate `r#extern`? - | - = help: consider adding `extern crate r#extern` to use the `r#extern` crate + | ^^^^^^ unresolved import error: aborting due to 2 previous errors diff --git a/tests/ui/keyword/keyword-self-as-identifier.rs b/tests/ui/keyword/keyword-self-as-identifier.rs index 72e4f01e21edd..712d0b462b24b 100644 --- a/tests/ui/keyword/keyword-self-as-identifier.rs +++ b/tests/ui/keyword/keyword-self-as-identifier.rs @@ -1,3 +1,3 @@ fn main() { - let Self = 22; //~ ERROR cannot find unit struct, unit variant or constant `Self` in this scope + let Self = 22; //~ ERROR cannot find unit struct, unit variant or constant `Self` } diff --git a/tests/ui/keyword/keyword-super-as-identifier.rs b/tests/ui/keyword/keyword-super-as-identifier.rs index 02c1b27b08a96..a28d99deedc0b 100644 --- a/tests/ui/keyword/keyword-super-as-identifier.rs +++ b/tests/ui/keyword/keyword-super-as-identifier.rs @@ -1,3 +1,3 @@ fn main() { - let super = 22; //~ ERROR failed to resolve: there are too many leading `super` keywords + let super = 22; //~ ERROR cannot find item `super` } diff --git a/tests/ui/keyword/keyword-super-as-identifier.stderr b/tests/ui/keyword/keyword-super-as-identifier.stderr index bfb27c143ff79..1e80dd5012423 100644 --- a/tests/ui/keyword/keyword-super-as-identifier.stderr +++ b/tests/ui/keyword/keyword-super-as-identifier.stderr @@ -1,8 +1,13 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords +error[E0433]: cannot find item `super` in this scope --> $DIR/keyword-super-as-identifier.rs:2:9 | LL | let super = 22; - | ^^^^^ there are too many leading `super` keywords + | ^^^^^ can't use `super` as an identifier + | +help: if you still want to call your identifier `super`, use the raw identifier format + | +LL | let r#super = 22; + | ++ error: aborting due to 1 previous error diff --git a/tests/ui/keyword/keyword-super.rs b/tests/ui/keyword/keyword-super.rs index c121a6c1050ea..4ddff441cfbb7 100644 --- a/tests/ui/keyword/keyword-super.rs +++ b/tests/ui/keyword/keyword-super.rs @@ -1,3 +1,3 @@ fn main() { - let super: isize; //~ ERROR failed to resolve: there are too many leading `super` keywords + let super: isize; //~ ERROR cannot find item `super` } diff --git a/tests/ui/keyword/keyword-super.stderr b/tests/ui/keyword/keyword-super.stderr index bf595442c3b8b..766a47a184b9c 100644 --- a/tests/ui/keyword/keyword-super.stderr +++ b/tests/ui/keyword/keyword-super.stderr @@ -1,8 +1,13 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords +error[E0433]: cannot find item `super` in this scope --> $DIR/keyword-super.rs:2:9 | LL | let super: isize; - | ^^^^^ there are too many leading `super` keywords + | ^^^^^ can't use `super` as an identifier + | +help: if you still want to call your identifier `super`, use the raw identifier format + | +LL | let r#super: isize; + | ++ error: aborting due to 1 previous error diff --git a/tests/ui/label/label_misspelled.rs b/tests/ui/label/label_misspelled.rs index e3180b06ecb2b..2134d9bfe6751 100644 --- a/tests/ui/label/label_misspelled.rs +++ b/tests/ui/label/label_misspelled.rs @@ -4,41 +4,41 @@ fn main() { 'while_loop: while true { //~ WARN denote infinite loops with //~^ WARN unused label while_loop; - //~^ ERROR cannot find value `while_loop` in this scope + //~^ ERROR cannot find value `while_loop` }; 'while_let: while let Some(_) = Some(()) { //~^ WARN unused label while_let; - //~^ ERROR cannot find value `while_let` in this scope + //~^ ERROR cannot find value `while_let` } 'for_loop: for _ in 0..3 { //~^ WARN unused label for_loop; - //~^ ERROR cannot find value `for_loop` in this scope + //~^ ERROR cannot find value `for_loop` }; 'LOOP: loop { //~^ WARN unused label LOOP; - //~^ ERROR cannot find value `LOOP` in this scope + //~^ ERROR cannot find value `LOOP` }; } fn foo() { 'LOOP: loop { break LOOP; - //~^ ERROR cannot find value `LOOP` in this scope + //~^ ERROR cannot find value `LOOP` }; 'while_loop: while true { //~ WARN denote infinite loops with break while_loop; - //~^ ERROR cannot find value `while_loop` in this scope + //~^ ERROR cannot find value `while_loop` }; 'while_let: while let Some(_) = Some(()) { break while_let; - //~^ ERROR cannot find value `while_let` in this scope + //~^ ERROR cannot find value `while_let` } 'for_loop: for _ in 0..3 { break for_loop; - //~^ ERROR cannot find value `for_loop` in this scope + //~^ ERROR cannot find value `for_loop` }; } diff --git a/tests/ui/label/label_misspelled_2.rs b/tests/ui/label/label_misspelled_2.rs index 55bbe6b30a593..92e2ad9df6c1f 100644 --- a/tests/ui/label/label_misspelled_2.rs +++ b/tests/ui/label/label_misspelled_2.rs @@ -5,12 +5,12 @@ fn main() { break 'a; } 'b: for _ in 0..1 { - break b; //~ ERROR cannot find value `b` in this scope + break b; //~ ERROR cannot find value `b` } c: for _ in 0..1 { //~ ERROR malformed loop label break 'c; } d: for _ in 0..1 { //~ ERROR malformed loop label - break d; //~ ERROR cannot find value `d` in this scope + break d; //~ ERROR cannot find value `d` } } diff --git a/tests/ui/layout/cannot-transmute-unnormalizable-type.rs b/tests/ui/layout/cannot-transmute-unnormalizable-type.rs index d2b6e1d8eba66..f7215dff2dd24 100644 --- a/tests/ui/layout/cannot-transmute-unnormalizable-type.rs +++ b/tests/ui/layout/cannot-transmute-unnormalizable-type.rs @@ -5,7 +5,7 @@ trait Trait { impl Trait for () where Missing: Trait, - //~^ ERROR cannot find type `Missing` in this scope + //~^ ERROR cannot find type `Missing` { type RefTarget = (); } diff --git a/tests/ui/layout/issue-84108.rs b/tests/ui/layout/issue-84108.rs index 974d5310f6bb8..6b086df248f8d 100644 --- a/tests/ui/layout/issue-84108.rs +++ b/tests/ui/layout/issue-84108.rs @@ -4,10 +4,10 @@ #![crate_type = "lib"] static FOO: (dyn AsRef, u8) = ("hello", 42); -//~^ ERROR cannot find type `OsStr` in this scope +//~^ ERROR cannot find type `OsStr` const BAR: (&Path, [u8], usize) = ("hello", [], 42); -//~^ ERROR cannot find type `Path` in this scope +//~^ ERROR cannot find type `Path` //~| ERROR the size for values of type `[u8]` cannot be known at compilation time //~| ERROR the size for values of type `[u8]` cannot be known at compilation time //~| ERROR mismatched types diff --git a/tests/ui/layout/malformed-unsized-type-in-union.rs b/tests/ui/layout/malformed-unsized-type-in-union.rs index 5d8ec576cf01b..2f04f74e5acac 100644 --- a/tests/ui/layout/malformed-unsized-type-in-union.rs +++ b/tests/ui/layout/malformed-unsized-type-in-union.rs @@ -1,7 +1,7 @@ // issue: 113760 union W { s: dyn Iterator } -//~^ ERROR cannot find type `Missing` in this scope +//~^ ERROR cannot find type `Missing` static ONCE: W = todo!(); diff --git a/tests/ui/layout/transmute-to-tail-with-err.rs b/tests/ui/layout/transmute-to-tail-with-err.rs index 6753ce15ed158..41f0f1d4cde0e 100644 --- a/tests/ui/layout/transmute-to-tail-with-err.rs +++ b/tests/ui/layout/transmute-to-tail-with-err.rs @@ -1,7 +1,7 @@ trait Trait {} struct Bar(Box>); -//~^ ERROR cannot find type `T` in this scope +//~^ ERROR cannot find type `T` fn main() { let x: Bar = unsafe { std::mem::transmute(()) }; diff --git a/tests/ui/let-else/let-else-scope.rs b/tests/ui/let-else/let-else-scope.rs index 78a67769ef284..40d7d35e01b9c 100644 --- a/tests/ui/let-else/let-else-scope.rs +++ b/tests/ui/let-else/let-else-scope.rs @@ -1,5 +1,5 @@ fn main() { let Some(x) = Some(2) else { - panic!("{}", x); //~ ERROR cannot find value `x` in this scope + panic!("{}", x); //~ ERROR cannot find value `x` }; } diff --git a/tests/ui/lifetimes/issue-97194.rs b/tests/ui/lifetimes/issue-97194.rs index 5f3560dbe946e..23518a2519626 100644 --- a/tests/ui/lifetimes/issue-97194.rs +++ b/tests/ui/lifetimes/issue-97194.rs @@ -2,7 +2,7 @@ extern "C" { fn bget(&self, index: [usize; Self::DIM]) -> bool { //~^ ERROR incorrect function inside `extern` block //~| ERROR `self` parameter is only allowed in associated functions - //~| ERROR failed to resolve: `Self` + //~| ERROR cannot find item `Self` type T<'a> = &'a str; } } diff --git a/tests/ui/lifetimes/issue-97194.stderr b/tests/ui/lifetimes/issue-97194.stderr index 93bde285a9901..29ee76b92c9a4 100644 --- a/tests/ui/lifetimes/issue-97194.stderr +++ b/tests/ui/lifetimes/issue-97194.stderr @@ -25,7 +25,7 @@ LL | fn bget(&self, index: [usize; Self::DIM]) -> bool { | = note: associated functions are those in `impl` or `trait` definitions -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> $DIR/issue-97194.rs:2:35 | LL | fn bget(&self, index: [usize; Self::DIM]) -> bool { diff --git a/tests/ui/lint/ice-array-into-iter-lint-issue-121532.rs b/tests/ui/lint/ice-array-into-iter-lint-issue-121532.rs index 92cab01fe48c8..7fae9223868a3 100644 --- a/tests/ui/lint/ice-array-into-iter-lint-issue-121532.rs +++ b/tests/ui/lint/ice-array-into-iter-lint-issue-121532.rs @@ -4,7 +4,7 @@ // Typeck fails for the arg type as // `Self` makes no sense here -fn func(a: Self::ItemsIterator) { //~ ERROR failed to resolve: `Self` is only available in impls, traits, and type definitions +fn func(a: Self::ItemsIterator) { //~ ERROR cannot find item `Self` a.into_iter(); } diff --git a/tests/ui/lint/ice-array-into-iter-lint-issue-121532.stderr b/tests/ui/lint/ice-array-into-iter-lint-issue-121532.stderr index 73ceddae940b2..bfa5e36aad3d2 100644 --- a/tests/ui/lint/ice-array-into-iter-lint-issue-121532.stderr +++ b/tests/ui/lint/ice-array-into-iter-lint-issue-121532.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> $DIR/ice-array-into-iter-lint-issue-121532.rs:7:12 | LL | fn func(a: Self::ItemsIterator) { diff --git a/tests/ui/lint/issue-35075.rs b/tests/ui/lint/issue-35075.rs index 0e54131c24560..c1b2b0c3a8018 100644 --- a/tests/ui/lint/issue-35075.rs +++ b/tests/ui/lint/issue-35075.rs @@ -1,9 +1,9 @@ struct Bar { - inner: Foo //~ ERROR cannot find type `Foo` in this scope + inner: Foo //~ ERROR cannot find type `Foo` } enum Baz { - Foo(Foo) //~ ERROR cannot find type `Foo` in this scope + Foo(Foo) //~ ERROR cannot find type `Foo` } fn main() {} diff --git a/tests/ui/lint/recommend-literal.rs b/tests/ui/lint/recommend-literal.rs index 453cbf28569e9..0c2003a52426b 100644 --- a/tests/ui/lint/recommend-literal.rs +++ b/tests/ui/lint/recommend-literal.rs @@ -1,42 +1,42 @@ type Real = double; -//~^ ERROR cannot find type `double` in this scope +//~^ ERROR cannot find type `double` //~| HELP perhaps you intended to use this type fn main() { let x: Real = 3.5; let y: long = 74802374902374923; - //~^ ERROR cannot find type `long` in this scope + //~^ ERROR cannot find type `long` //~| HELP perhaps you intended to use this type let v1: Boolean = true; - //~^ ERROR: cannot find type `Boolean` in this scope [E0412] + //~^ ERROR: cannot find type `Boolean` //~| HELP perhaps you intended to use this type let v2: Bool = true; - //~^ ERROR: cannot find type `Bool` in this scope [E0412] + //~^ ERROR: cannot find type `Bool` //~| HELP a builtin type with a similar name exists //~| HELP perhaps you intended to use this type } fn z(a: boolean) { - //~^ ERROR cannot find type `boolean` in this scope + //~^ ERROR cannot find type `boolean` //~| HELP perhaps you intended to use this type } fn a() -> byte { -//~^ ERROR cannot find type `byte` in this scope +//~^ ERROR cannot find type `byte` //~| HELP perhaps you intended to use this type 3 } struct Data { //~ HELP you might be missing a type parameter width: float, - //~^ ERROR cannot find type `float` in this scope + //~^ ERROR cannot find type `float` //~| HELP perhaps you intended to use this type depth: Option, - //~^ ERROR cannot find type `int` in this scope + //~^ ERROR cannot find type `int` //~| HELP perhaps you intended to use this type } trait Stuff {} impl Stuff for short {} -//~^ ERROR cannot find type `short` in this scope +//~^ ERROR cannot find type `short` //~| HELP perhaps you intended to use this type diff --git a/tests/ui/loops/loop-break-value.rs b/tests/ui/loops/loop-break-value.rs index d509fc1657054..ad7e943159ba6 100644 --- a/tests/ui/loops/loop-break-value.rs +++ b/tests/ui/loops/loop-break-value.rs @@ -97,7 +97,7 @@ fn main() { 'LOOP: for _ in 0 .. 9 { break LOOP; - //~^ ERROR cannot find value `LOOP` in this scope + //~^ ERROR cannot find value `LOOP` } let _ = 'a: loop { diff --git a/tests/ui/lowering/span-bug-issue-121431.rs b/tests/ui/lowering/span-bug-issue-121431.rs index b855577bcfbff..0a54b523be720 100644 --- a/tests/ui/lowering/span-bug-issue-121431.rs +++ b/tests/ui/lowering/span-bug-issue-121431.rs @@ -1,4 +1,4 @@ fn bug() -> impl CallbackMarker< Item = [(); { |_: &mut ()| 3; 4 }] > {} -//~^ ERROR cannot find trait `CallbackMarker` in this scope +//~^ ERROR cannot find trait `CallbackMarker` fn main() {} diff --git a/tests/ui/macros/builtin-prelude-no-accidents.rs b/tests/ui/macros/builtin-prelude-no-accidents.rs index 01691a82dd772..c806b68400943 100644 --- a/tests/ui/macros/builtin-prelude-no-accidents.rs +++ b/tests/ui/macros/builtin-prelude-no-accidents.rs @@ -2,7 +2,7 @@ // because macros with the same names are in prelude. fn main() { - env::current_dir; //~ ERROR use of undeclared crate or module `env` - type A = panic::PanicInfo; //~ ERROR use of undeclared crate or module `panic` - type B = vec::Vec; //~ ERROR use of undeclared crate or module `vec` + env::current_dir; //~ ERROR cannot find item `env` + type A = panic::PanicInfo; //~ ERROR cannot find item `panic` + type B = vec::Vec; //~ ERROR cannot find item `vec` } diff --git a/tests/ui/macros/builtin-prelude-no-accidents.stderr b/tests/ui/macros/builtin-prelude-no-accidents.stderr index c1054230bc9a5..6e576ecefdca3 100644 --- a/tests/ui/macros/builtin-prelude-no-accidents.stderr +++ b/tests/ui/macros/builtin-prelude-no-accidents.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `env` +error[E0433]: cannot find item `env` in this scope --> $DIR/builtin-prelude-no-accidents.rs:5:5 | LL | env::current_dir; @@ -9,7 +9,7 @@ help: consider importing this module LL + use std::env; | -error[E0433]: failed to resolve: use of undeclared crate or module `panic` +error[E0433]: cannot find item `panic` in this scope --> $DIR/builtin-prelude-no-accidents.rs:6:14 | LL | type A = panic::PanicInfo; @@ -20,7 +20,7 @@ help: consider importing this module LL + use std::panic; | -error[E0433]: failed to resolve: use of undeclared crate or module `vec` +error[E0433]: cannot find item `vec` in this scope --> $DIR/builtin-prelude-no-accidents.rs:7:14 | LL | type B = vec::Vec; diff --git a/tests/ui/macros/builtin-std-paths-fail.rs b/tests/ui/macros/builtin-std-paths-fail.rs index c1a4e32a6dcbc..087d5a1bf075a 100644 --- a/tests/ui/macros/builtin-std-paths-fail.rs +++ b/tests/ui/macros/builtin-std-paths-fail.rs @@ -1,25 +1,25 @@ #[derive( - core::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `core` - //~| ERROR could not find `RustcDecodable` in `core` - core::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `core` - //~| ERROR could not find `RustcDecodable` in `core` + core::RustcDecodable, //~ ERROR cannot find macro `RustcDecodable` + //~| ERROR cannot find macro `RustcDecodable` + core::RustcDecodable, //~ ERROR cannot find macro `RustcDecodable` + //~| ERROR cannot find macro `RustcDecodable` )] -#[core::bench] //~ ERROR could not find `bench` in `core` -#[core::global_allocator] //~ ERROR could not find `global_allocator` in `core` -#[core::test_case] //~ ERROR could not find `test_case` in `core` -#[core::test] //~ ERROR could not find `test` in `core` +#[core::bench] //~ ERROR cannot find macro `bench` +#[core::global_allocator] //~ ERROR cannot find macro `global_allocator` +#[core::test_case] //~ ERROR cannot find macro `test_case` +#[core::test] //~ ERROR cannot find macro `test` struct Core; #[derive( - std::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `std` - //~| ERROR could not find `RustcDecodable` in `std` - std::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `std` - //~| ERROR could not find `RustcDecodable` in `std` + std::RustcDecodable, //~ ERROR cannot find macro `RustcDecodable` + //~| ERROR cannot find macro `RustcDecodable` + std::RustcDecodable, //~ ERROR cannot find macro `RustcDecodable` + //~| ERROR cannot find macro `RustcDecodable` )] -#[std::bench] //~ ERROR could not find `bench` in `std` -#[std::global_allocator] //~ ERROR could not find `global_allocator` in `std` -#[std::test_case] //~ ERROR could not find `test_case` in `std` -#[std::test] //~ ERROR could not find `test` in `std` +#[std::bench] //~ ERROR cannot find macro `bench` +#[std::global_allocator] //~ ERROR cannot find macro `global_allocator` +#[std::test_case] //~ ERROR cannot find macro `test_case` +#[std::test] //~ ERROR cannot find macro `test` struct Std; fn main() {} diff --git a/tests/ui/macros/builtin-std-paths-fail.stderr b/tests/ui/macros/builtin-std-paths-fail.stderr index 331943843c02a..8bc929debcdc3 100644 --- a/tests/ui/macros/builtin-std-paths-fail.stderr +++ b/tests/ui/macros/builtin-std-paths-fail.stderr @@ -1,16 +1,16 @@ -error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` +error[E0433]: cannot find macro `RustcDecodable` in crate `core` --> $DIR/builtin-std-paths-fail.rs:2:11 | LL | core::RustcDecodable, | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `core` -error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` +error[E0433]: cannot find macro `RustcDecodable` in crate `core` --> $DIR/builtin-std-paths-fail.rs:4:11 | LL | core::RustcDecodable, | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `core` -error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` +error[E0433]: cannot find macro `RustcDecodable` in crate `core` --> $DIR/builtin-std-paths-fail.rs:2:11 | LL | core::RustcDecodable, @@ -18,7 +18,7 @@ LL | core::RustcDecodable, | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` +error[E0433]: cannot find macro `RustcDecodable` in crate `core` --> $DIR/builtin-std-paths-fail.rs:4:11 | LL | core::RustcDecodable, @@ -26,43 +26,43 @@ LL | core::RustcDecodable, | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0433]: failed to resolve: could not find `bench` in `core` +error[E0433]: cannot find macro `bench` in crate `core` --> $DIR/builtin-std-paths-fail.rs:7:9 | LL | #[core::bench] | ^^^^^ could not find `bench` in `core` -error[E0433]: failed to resolve: could not find `global_allocator` in `core` +error[E0433]: cannot find macro `global_allocator` in crate `core` --> $DIR/builtin-std-paths-fail.rs:8:9 | LL | #[core::global_allocator] | ^^^^^^^^^^^^^^^^ could not find `global_allocator` in `core` -error[E0433]: failed to resolve: could not find `test_case` in `core` +error[E0433]: cannot find macro `test_case` in crate `core` --> $DIR/builtin-std-paths-fail.rs:9:9 | LL | #[core::test_case] | ^^^^^^^^^ could not find `test_case` in `core` -error[E0433]: failed to resolve: could not find `test` in `core` +error[E0433]: cannot find macro `test` in crate `core` --> $DIR/builtin-std-paths-fail.rs:10:9 | LL | #[core::test] | ^^^^ could not find `test` in `core` -error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` +error[E0433]: cannot find macro `RustcDecodable` in crate `std` --> $DIR/builtin-std-paths-fail.rs:14:10 | LL | std::RustcDecodable, | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `std` -error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` +error[E0433]: cannot find macro `RustcDecodable` in crate `std` --> $DIR/builtin-std-paths-fail.rs:16:10 | LL | std::RustcDecodable, | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `std` -error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` +error[E0433]: cannot find macro `RustcDecodable` in crate `std` --> $DIR/builtin-std-paths-fail.rs:14:10 | LL | std::RustcDecodable, @@ -70,7 +70,7 @@ LL | std::RustcDecodable, | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` +error[E0433]: cannot find macro `RustcDecodable` in crate `std` --> $DIR/builtin-std-paths-fail.rs:16:10 | LL | std::RustcDecodable, @@ -78,25 +78,25 @@ LL | std::RustcDecodable, | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0433]: failed to resolve: could not find `bench` in `std` +error[E0433]: cannot find macro `bench` in crate `std` --> $DIR/builtin-std-paths-fail.rs:19:8 | LL | #[std::bench] | ^^^^^ could not find `bench` in `std` -error[E0433]: failed to resolve: could not find `global_allocator` in `std` +error[E0433]: cannot find macro `global_allocator` in crate `std` --> $DIR/builtin-std-paths-fail.rs:20:8 | LL | #[std::global_allocator] | ^^^^^^^^^^^^^^^^ could not find `global_allocator` in `std` -error[E0433]: failed to resolve: could not find `test_case` in `std` +error[E0433]: cannot find macro `test_case` in crate `std` --> $DIR/builtin-std-paths-fail.rs:21:8 | LL | #[std::test_case] | ^^^^^^^^^ could not find `test_case` in `std` -error[E0433]: failed to resolve: could not find `test` in `std` +error[E0433]: cannot find macro `test` in crate `std` --> $DIR/builtin-std-paths-fail.rs:22:8 | LL | #[std::test] diff --git a/tests/ui/macros/defined-later-issue-121061-2.rs b/tests/ui/macros/defined-later-issue-121061-2.rs index 3db76c281ec87..cde369a47491d 100644 --- a/tests/ui/macros/defined-later-issue-121061-2.rs +++ b/tests/ui/macros/defined-later-issue-121061-2.rs @@ -1,6 +1,6 @@ mod demo { fn hello() { - something_later!(); //~ ERROR cannot find macro `something_later` in this scope + something_later!(); //~ ERROR cannot find macro `something_later` } macro_rules! something_later { diff --git a/tests/ui/macros/defined-later-issue-121061-2.stderr b/tests/ui/macros/defined-later-issue-121061-2.stderr index aa6ef33853193..e2da60f35d591 100644 --- a/tests/ui/macros/defined-later-issue-121061-2.stderr +++ b/tests/ui/macros/defined-later-issue-121061-2.stderr @@ -2,7 +2,10 @@ error: cannot find macro `something_later` in this scope --> $DIR/defined-later-issue-121061-2.rs:3:9 | LL | something_later!(); - | ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call + | ^^^^^^^^^^^^^^^ + | | + | not found in this scope + | consider moving the definition of `something_later` before this call | note: a macro with the same name exists, but it appears later at here --> $DIR/defined-later-issue-121061-2.rs:6:18 diff --git a/tests/ui/macros/defined-later-issue-121061.rs b/tests/ui/macros/defined-later-issue-121061.rs index 07c6d406f03c5..1b0a39f457606 100644 --- a/tests/ui/macros/defined-later-issue-121061.rs +++ b/tests/ui/macros/defined-later-issue-121061.rs @@ -1,5 +1,5 @@ fn main() { - something_later!(); //~ ERROR cannot find macro `something_later` in this scope + something_later!(); //~ ERROR cannot find macro `something_later` } macro_rules! something_later { diff --git a/tests/ui/macros/defined-later-issue-121061.stderr b/tests/ui/macros/defined-later-issue-121061.stderr index 65cb53432a932..fd835902f397d 100644 --- a/tests/ui/macros/defined-later-issue-121061.stderr +++ b/tests/ui/macros/defined-later-issue-121061.stderr @@ -2,7 +2,10 @@ error: cannot find macro `something_later` in this scope --> $DIR/defined-later-issue-121061.rs:2:5 | LL | something_later!(); - | ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call + | ^^^^^^^^^^^^^^^ + | | + | not found in this scope + | consider moving the definition of `something_later` before this call | note: a macro with the same name exists, but it appears later at here --> $DIR/defined-later-issue-121061.rs:5:14 diff --git a/tests/ui/macros/expand-full-no-resolution.rs b/tests/ui/macros/expand-full-no-resolution.rs index 4d90b8e2a531a..caa223f03a9e6 100644 --- a/tests/ui/macros/expand-full-no-resolution.rs +++ b/tests/ui/macros/expand-full-no-resolution.rs @@ -15,6 +15,6 @@ macro_rules! wrap { wrap!(); fn main() { - format_args!(a!()); //~ ERROR: cannot find macro `a` in this scope - env!(a!()); //~ ERROR: cannot find macro `a` in this scope + format_args!(a!()); //~ ERROR: cannot find macro `a` + env!(a!()); //~ ERROR: cannot find macro `a` } diff --git a/tests/ui/macros/expand-full-no-resolution.stderr b/tests/ui/macros/expand-full-no-resolution.stderr index df6f20332bfd8..0e8747390e344 100644 --- a/tests/ui/macros/expand-full-no-resolution.stderr +++ b/tests/ui/macros/expand-full-no-resolution.stderr @@ -5,7 +5,7 @@ LL | macro_rules! _a { | --------------- similarly named macro `_a` defined here ... LL | format_args!(a!()); - | ^ + | ^ not found in this scope | help: the leading underscore in `_a` marks it as unused, consider renaming it to `a` | @@ -19,7 +19,7 @@ LL | macro_rules! _a { | --------------- similarly named macro `_a` defined here ... LL | env!(a!()); - | ^ + | ^ not found in this scope | help: the leading underscore in `_a` marks it as unused, consider renaming it to `a` | diff --git a/tests/ui/macros/issue-100199.rs b/tests/ui/macros/issue-100199.rs index b1bcc535d74af..a43af3db4f274 100644 --- a/tests/ui/macros/issue-100199.rs +++ b/tests/ui/macros/issue-100199.rs @@ -1,4 +1,4 @@ -#[issue_100199::struct_with_bound] //~ ERROR cannot find trait `MyTrait` in the crate root +#[issue_100199::struct_with_bound] //~ ERROR cannot find trait `MyTrait` struct Foo {} // The above must be on the first line so that it's span points to pos 0. // This used to trigger an ICE because the diagnostic emitter would get diff --git a/tests/ui/macros/issue-11692-1.rs b/tests/ui/macros/issue-11692-1.rs index b6f3bb8ef0549..5b1ec3e5650e2 100644 --- a/tests/ui/macros/issue-11692-1.rs +++ b/tests/ui/macros/issue-11692-1.rs @@ -1,3 +1,3 @@ fn main() { - print!(testo!()); //~ ERROR cannot find macro `testo` in this scope + print!(testo!()); //~ ERROR cannot find macro `testo` } diff --git a/tests/ui/macros/issue-11692-1.stderr b/tests/ui/macros/issue-11692-1.stderr index 46382f6521841..54dd6f5574ab9 100644 --- a/tests/ui/macros/issue-11692-1.stderr +++ b/tests/ui/macros/issue-11692-1.stderr @@ -2,7 +2,7 @@ error: cannot find macro `testo` in this scope --> $DIR/issue-11692-1.rs:2:12 | LL | print!(testo!()); - | ^^^^^ + | ^^^^^ not found in this scope error: aborting due to 1 previous error diff --git a/tests/ui/macros/issue-11692-2.rs b/tests/ui/macros/issue-11692-2.rs index 5957ed338f4e7..71591974c1d97 100644 --- a/tests/ui/macros/issue-11692-2.rs +++ b/tests/ui/macros/issue-11692-2.rs @@ -1,3 +1,3 @@ fn main() { - concat!(test!()); //~ ERROR cannot find macro `test` in this scope + concat!(test!()); //~ ERROR cannot find macro `test` } diff --git a/tests/ui/macros/issue-11692-2.stderr b/tests/ui/macros/issue-11692-2.stderr index 53add509ca56d..948d688518269 100644 --- a/tests/ui/macros/issue-11692-2.stderr +++ b/tests/ui/macros/issue-11692-2.stderr @@ -2,7 +2,7 @@ error: cannot find macro `test` in this scope --> $DIR/issue-11692-2.rs:2:13 | LL | concat!(test!()); - | ^^^^ + | ^^^^ not found in this scope | = note: `test` is in scope, but it is an attribute: `#[test]` diff --git a/tests/ui/macros/issue-118786.rs b/tests/ui/macros/issue-118786.rs index 97454c9de0798..ba48cbb68e7ac 100644 --- a/tests/ui/macros/issue-118786.rs +++ b/tests/ui/macros/issue-118786.rs @@ -6,7 +6,7 @@ macro_rules! make_macro { ($macro_name:tt) => { macro_rules! $macro_name { //~^ ERROR macro expansion ignores token `{` and any following - //~| ERROR cannot find macro `macro_rules` in this scope + //~| ERROR cannot find macro `macro_rules` () => {} } } diff --git a/tests/ui/macros/issue-118786.stderr b/tests/ui/macros/issue-118786.stderr index 03e65c94ba739..0b0e1ae563d08 100644 --- a/tests/ui/macros/issue-118786.stderr +++ b/tests/ui/macros/issue-118786.stderr @@ -24,11 +24,11 @@ LL | make_macro!((meow)); | = note: the usage of `make_macro!` is likely invalid in item context -error: cannot find macro `macro_rules` in this scope +error: cannot find macro `macro_rules` in the crate root --> $DIR/issue-118786.rs:7:9 | LL | macro_rules! $macro_name { - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root ... LL | make_macro!((meow)); | ------------------- in this macro invocation diff --git a/tests/ui/macros/issue-88206.rs b/tests/ui/macros/issue-88206.rs index abf58fdcbc815..3da5f1b4a971a 100644 --- a/tests/ui/macros/issue-88206.rs +++ b/tests/ui/macros/issue-88206.rs @@ -21,46 +21,57 @@ use hey::{Serialize, Deserialize, X}; #[derive(Serialize)] //~^ ERROR cannot find derive macro `Serialize` +//~| NOTE not found struct A; #[derive(from_utf8_mut)] //~^ ERROR cannot find derive macro `from_utf8_mut` +//~| NOTE not found struct B; #[derive(println)] //~^ ERROR cannot find derive macro `println` //~| NOTE `println` is in scope, but it is a function-like macro +//~| NOTE not found struct C; #[Deserialize] //~^ ERROR cannot find attribute `Deserialize` +//~| NOTE not found struct D; #[from_utf8_unchecked] //~^ ERROR cannot find attribute `from_utf8_unchecked` +//~| NOTE not found struct E; #[println] //~^ ERROR cannot find attribute `println` //~| NOTE `println` is in scope, but it is a function-like macro +//~| NOTE not found struct F; fn main() { from_utf8!(); //~^ ERROR cannot find macro `from_utf8` + //~| NOTE not found Box!(); //~^ ERROR cannot find macro `Box` //~| NOTE `Box` is in scope, but it is a struct + //~| NOTE not found Copy!(); //~^ ERROR cannot find macro `Copy` //~| NOTE `Copy` is in scope, but it is a derive macro + //~| NOTE not found test!(); //~^ ERROR cannot find macro `test` //~| NOTE `test` is in scope, but it is an attribute + //~| NOTE not found X!(); //~^ ERROR cannot find macro `X` + //~| NOTE not found } diff --git a/tests/ui/macros/issue-88206.stderr b/tests/ui/macros/issue-88206.stderr index f7f5b56488007..f5ed308ca59ac 100644 --- a/tests/ui/macros/issue-88206.stderr +++ b/tests/ui/macros/issue-88206.stderr @@ -1,8 +1,8 @@ error: cannot find macro `X` in this scope - --> $DIR/issue-88206.rs:64:5 + --> $DIR/issue-88206.rs:74:5 | LL | X!(); - | ^ + | ^ not found in this scope | note: `X` is imported here, but it is a struct, not a macro --> $DIR/issue-88206.rs:17:35 @@ -11,34 +11,34 @@ LL | use hey::{Serialize, Deserialize, X}; | ^ error: cannot find macro `test` in this scope - --> $DIR/issue-88206.rs:60:5 + --> $DIR/issue-88206.rs:69:5 | LL | test!(); - | ^^^^ + | ^^^^ not found in this scope | = note: `test` is in scope, but it is an attribute: `#[test]` error: cannot find macro `Copy` in this scope - --> $DIR/issue-88206.rs:56:5 + --> $DIR/issue-88206.rs:64:5 | LL | Copy!(); - | ^^^^ + | ^^^^ not found in this scope | = note: `Copy` is in scope, but it is a derive macro: `#[derive(Copy)]` error: cannot find macro `Box` in this scope - --> $DIR/issue-88206.rs:52:5 + --> $DIR/issue-88206.rs:59:5 | LL | Box!(); - | ^^^ + | ^^^ not found in this scope | = note: `Box` is in scope, but it is a struct, not a macro error: cannot find macro `from_utf8` in this scope - --> $DIR/issue-88206.rs:49:5 + --> $DIR/issue-88206.rs:55:5 | LL | from_utf8!(); - | ^^^^^^^^^ + | ^^^^^^^^^ not found in this scope | note: `from_utf8` is imported here, but it is a function, not a macro --> $DIR/issue-88206.rs:5:5 @@ -46,19 +46,19 @@ note: `from_utf8` is imported here, but it is a function, not a macro LL | use std::str::*; | ^^^^^^^^^^^ -error: cannot find attribute `println` in this scope - --> $DIR/issue-88206.rs:43:3 +error: cannot find attribute `println` in the crate root + --> $DIR/issue-88206.rs:48:3 | LL | #[println] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root | = note: `println` is in scope, but it is a function-like macro -error: cannot find attribute `from_utf8_unchecked` in this scope - --> $DIR/issue-88206.rs:39:3 +error: cannot find attribute `from_utf8_unchecked` in the crate root + --> $DIR/issue-88206.rs:43:3 | LL | #[from_utf8_unchecked] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ not found in the crate root | note: `from_utf8_unchecked` is imported here, but it is a function, not an attribute --> $DIR/issue-88206.rs:5:5 @@ -66,11 +66,11 @@ note: `from_utf8_unchecked` is imported here, but it is a function, not an attri LL | use std::str::*; | ^^^^^^^^^^^ -error: cannot find attribute `Deserialize` in this scope - --> $DIR/issue-88206.rs:35:3 +error: cannot find attribute `Deserialize` in the crate root + --> $DIR/issue-88206.rs:38:3 | LL | #[Deserialize] - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root | note: `Deserialize` is imported here, but it is a trait, not an attribute --> $DIR/issue-88206.rs:17:22 @@ -78,19 +78,19 @@ note: `Deserialize` is imported here, but it is a trait, not an attribute LL | use hey::{Serialize, Deserialize, X}; | ^^^^^^^^^^^ -error: cannot find derive macro `println` in this scope - --> $DIR/issue-88206.rs:30:10 +error: cannot find derive macro `println` in the crate root + --> $DIR/issue-88206.rs:32:10 | LL | #[derive(println)] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root | = note: `println` is in scope, but it is a function-like macro -error: cannot find derive macro `from_utf8_mut` in this scope - --> $DIR/issue-88206.rs:26:10 +error: cannot find derive macro `from_utf8_mut` in the crate root + --> $DIR/issue-88206.rs:27:10 | LL | #[derive(from_utf8_mut)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in the crate root | note: `from_utf8_mut` is imported here, but it is a function, not a derive macro --> $DIR/issue-88206.rs:5:5 @@ -98,11 +98,11 @@ note: `from_utf8_mut` is imported here, but it is a function, not a derive macro LL | use std::str::*; | ^^^^^^^^^^^ -error: cannot find derive macro `Serialize` in this scope +error: cannot find derive macro `Serialize` in the crate root --> $DIR/issue-88206.rs:22:10 | LL | #[derive(Serialize)] - | ^^^^^^^^^ + | ^^^^^^^^^ not found in the crate root | note: `Serialize` is imported here, but it is only a trait, without a derive macro --> $DIR/issue-88206.rs:17:11 diff --git a/tests/ui/macros/issue-88228.stderr b/tests/ui/macros/issue-88228.stderr index f9d0ac95da756..2b2a181d5b554 100644 --- a/tests/ui/macros/issue-88228.stderr +++ b/tests/ui/macros/issue-88228.stderr @@ -2,26 +2,26 @@ error: cannot find macro `bla` in this scope --> $DIR/issue-88228.rs:20:5 | LL | bla!(); - | ^^^ + | ^^^ not found in this scope | help: consider importing this macro through its public re-export | LL + use crate::hey::bla; | -error: cannot find derive macro `println` in this scope +error: cannot find derive macro `println` in the crate root --> $DIR/issue-88228.rs:14:10 | LL | #[derive(println)] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root | = note: `println` is in scope, but it is a function-like macro -error: cannot find derive macro `Bla` in this scope +error: cannot find derive macro `Bla` in the crate root --> $DIR/issue-88228.rs:10:10 | LL | #[derive(Bla)] - | ^^^ + | ^^^ not found in the crate root | help: consider importing this derive macro through its public re-export | diff --git a/tests/ui/macros/macro-context.rs b/tests/ui/macros/macro-context.rs index d09fdf118e6f4..766da567eff7a 100644 --- a/tests/ui/macros/macro-context.rs +++ b/tests/ui/macros/macro-context.rs @@ -4,8 +4,8 @@ macro_rules! m { //~| ERROR macro expansion ignores token `typeof` //~| ERROR macro expansion ignores token `;` //~| ERROR macro expansion ignores token `;` - //~| ERROR cannot find type `i` in this scope - //~| ERROR cannot find value `i` in this scope + //~| ERROR cannot find type `i` + //~| ERROR cannot find value `i` //~| WARN trailing semicolon in macro //~| WARN this was previously } diff --git a/tests/ui/macros/macro-expand-within-generics-in-path.rs b/tests/ui/macros/macro-expand-within-generics-in-path.rs index 017d5152221bf..1ba32afee5c5f 100644 --- a/tests/ui/macros/macro-expand-within-generics-in-path.rs +++ b/tests/ui/macros/macro-expand-within-generics-in-path.rs @@ -14,6 +14,6 @@ macro_rules! p { m!(generic); //~^ ERROR: unexpected generic arguments in path -//~| ERROR: cannot find attribute `generic` in this scope +//~| ERROR: cannot find attribute `generic` fn main() {} diff --git a/tests/ui/macros/macro-expand-within-generics-in-path.stderr b/tests/ui/macros/macro-expand-within-generics-in-path.stderr index 72026c41050a2..70801fd8077ea 100644 --- a/tests/ui/macros/macro-expand-within-generics-in-path.stderr +++ b/tests/ui/macros/macro-expand-within-generics-in-path.stderr @@ -4,11 +4,11 @@ error: unexpected generic arguments in path LL | m!(generic); | ^^^^^^ -error: cannot find attribute `generic` in this scope +error: cannot find attribute `generic` in the crate root --> $DIR/macro-expand-within-generics-in-path.rs:15:4 | LL | m!(generic); - | ^^^^^^^ + | ^^^^^^^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/macros/macro-expansion-tests.stderr b/tests/ui/macros/macro-expansion-tests.stderr index 8b3f7ca88171c..dea12de8774cc 100644 --- a/tests/ui/macros/macro-expansion-tests.stderr +++ b/tests/ui/macros/macro-expansion-tests.stderr @@ -1,16 +1,16 @@ -error: cannot find macro `m` in this scope +error: cannot find macro `m` in module `macros_cant_escape_fns` --> $DIR/macro-expansion-tests.rs:7:21 | LL | fn g() -> i32 { m!() } - | ^ + | ^ not found in module `macros_cant_escape_fns` | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find macro `m` in this scope +error: cannot find macro `m` in module `macros_cant_escape_mods` --> $DIR/macro-expansion-tests.rs:15:21 | LL | fn g() -> i32 { m!() } - | ^ + | ^ not found in module `macros_cant_escape_mods` | = help: have you added the `#[macro_use]` on the module/import? diff --git a/tests/ui/macros/macro-inner-attributes.rs b/tests/ui/macros/macro-inner-attributes.rs index 6dbfce2135989..8cfc73f5928d5 100644 --- a/tests/ui/macros/macro-inner-attributes.rs +++ b/tests/ui/macros/macro-inner-attributes.rs @@ -15,6 +15,6 @@ test!(b, #[rustc_dummy] fn main() { a::bar(); - //~^ ERROR failed to resolve: use of undeclared crate or module `a` + //~^ ERROR cannot find item `a` b::bar(); } diff --git a/tests/ui/macros/macro-inner-attributes.stderr b/tests/ui/macros/macro-inner-attributes.stderr index b6e10f45e3810..39944b949b8a9 100644 --- a/tests/ui/macros/macro-inner-attributes.stderr +++ b/tests/ui/macros/macro-inner-attributes.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `a` +error[E0433]: cannot find item `a` in this scope --> $DIR/macro-inner-attributes.rs:17:5 | LL | a::bar(); diff --git a/tests/ui/macros/macro-metavar-expr-concat/hygiene.rs b/tests/ui/macros/macro-metavar-expr-concat/hygiene.rs index 24b0e36498a3e..17397dc3a3e89 100644 --- a/tests/ui/macros/macro-metavar-expr-concat/hygiene.rs +++ b/tests/ui/macros/macro-metavar-expr-concat/hygiene.rs @@ -3,7 +3,7 @@ macro_rules! join { ($lhs:ident, $rhs:ident) => { ${concat($lhs, $rhs)} - //~^ ERROR cannot find value `abcdef` in this scope + //~^ ERROR cannot find value `abcdef` }; } diff --git a/tests/ui/macros/macro-name-typo.stderr b/tests/ui/macros/macro-name-typo.stderr index 9059b10faaacd..8ec855c7f4865 100644 --- a/tests/ui/macros/macro-name-typo.stderr +++ b/tests/ui/macros/macro-name-typo.stderr @@ -2,7 +2,10 @@ error: cannot find macro `printlx` in this scope --> $DIR/macro-name-typo.rs:2:5 | LL | printlx!("oh noes!"); - | ^^^^^^^ help: a macro with a similar name exists: `println` + | ^^^^^^^ + | | + | not found in this scope + | help: a macro with a similar name exists: `println` --> $SRC_DIR/std/src/macros.rs:LL:COL | = note: similarly named macro `println` defined here diff --git a/tests/ui/macros/macro-outer-attributes.rs b/tests/ui/macros/macro-outer-attributes.rs index 8c79683f49a96..186353f133f9b 100644 --- a/tests/ui/macros/macro-outer-attributes.rs +++ b/tests/ui/macros/macro-outer-attributes.rs @@ -15,6 +15,6 @@ test!(b, // test1!(#[bar]) #[rustc_dummy] fn main() { - a::bar(); //~ ERROR cannot find function `bar` in module `a` + a::bar(); //~ ERROR cannot find function `bar` b::bar(); } diff --git a/tests/ui/macros/macro-outer-attributes.stderr b/tests/ui/macros/macro-outer-attributes.stderr index 87c0655a422d6..14f621029ca83 100644 --- a/tests/ui/macros/macro-outer-attributes.stderr +++ b/tests/ui/macros/macro-outer-attributes.stderr @@ -2,7 +2,7 @@ error[E0425]: cannot find function `bar` in module `a` --> $DIR/macro-outer-attributes.rs:18:8 | LL | a::bar(); - | ^^^ not found in `a` + | ^^^ not found in module `a` | note: found an item that was configured out --> $DIR/macro-outer-attributes.rs:9:14 diff --git a/tests/ui/macros/macro-parameter-span.rs b/tests/ui/macros/macro-parameter-span.rs index 5609f84e141b6..8aa9b405aa35e 100644 --- a/tests/ui/macros/macro-parameter-span.rs +++ b/tests/ui/macros/macro-parameter-span.rs @@ -8,6 +8,6 @@ macro_rules! foo { // not to the macro variable '$id' fn main() { foo!( - x //~ ERROR cannot find value `x` in this scope + x //~ ERROR cannot find value `x` ); } diff --git a/tests/ui/macros/macro-path-prelude-fail-1.rs b/tests/ui/macros/macro-path-prelude-fail-1.rs index d93792bdfe38d..a47f7cda0e19e 100644 --- a/tests/ui/macros/macro-path-prelude-fail-1.rs +++ b/tests/ui/macros/macro-path-prelude-fail-1.rs @@ -1,7 +1,7 @@ mod m { fn check() { - Vec::clone!(); //~ ERROR failed to resolve: `Vec` is a struct, not a module - u8::clone!(); //~ ERROR failed to resolve: `u8` is a builtin type, not a module + Vec::clone!(); //~ ERROR cannot find module `Vec` + u8::clone!(); //~ ERROR cannot find module `u8` } } diff --git a/tests/ui/macros/macro-path-prelude-fail-1.stderr b/tests/ui/macros/macro-path-prelude-fail-1.stderr index f8377ffb35556..b8ace6d631551 100644 --- a/tests/ui/macros/macro-path-prelude-fail-1.stderr +++ b/tests/ui/macros/macro-path-prelude-fail-1.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: `Vec` is a struct, not a module +error[E0433]: cannot find module `Vec` in this scope --> $DIR/macro-path-prelude-fail-1.rs:3:9 | LL | Vec::clone!(); | ^^^ `Vec` is a struct, not a module -error[E0433]: failed to resolve: `u8` is a builtin type, not a module +error[E0433]: cannot find module `u8` in this scope --> $DIR/macro-path-prelude-fail-1.rs:4:9 | LL | u8::clone!(); diff --git a/tests/ui/macros/macro-path-prelude-fail-2.rs b/tests/ui/macros/macro-path-prelude-fail-2.rs index 816a3c4ccc004..42b60bdc934d3 100644 --- a/tests/ui/macros/macro-path-prelude-fail-2.rs +++ b/tests/ui/macros/macro-path-prelude-fail-2.rs @@ -1,6 +1,6 @@ mod m { fn check() { - Result::Ok!(); //~ ERROR failed to resolve: partially resolved path in a macro + Result::Ok!(); //~ ERROR cannot find item `Ok` } } diff --git a/tests/ui/macros/macro-path-prelude-fail-2.stderr b/tests/ui/macros/macro-path-prelude-fail-2.stderr index 87646031cdb82..8ba338f33253b 100644 --- a/tests/ui/macros/macro-path-prelude-fail-2.stderr +++ b/tests/ui/macros/macro-path-prelude-fail-2.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: partially resolved path in a macro +error[E0433]: cannot find item `Ok` in this scope --> $DIR/macro-path-prelude-fail-2.rs:3:9 | LL | Result::Ok!(); diff --git a/tests/ui/macros/macro-path-prelude-fail-3.rs b/tests/ui/macros/macro-path-prelude-fail-3.rs index 68eb350a95614..959a0286fbbd9 100644 --- a/tests/ui/macros/macro-path-prelude-fail-3.rs +++ b/tests/ui/macros/macro-path-prelude-fail-3.rs @@ -1,3 +1,3 @@ fn main() { - inline!(); //~ ERROR cannot find macro `inline` in this scope + inline!(); //~ ERROR cannot find macro `inline` } diff --git a/tests/ui/macros/macro-path-prelude-fail-3.stderr b/tests/ui/macros/macro-path-prelude-fail-3.stderr index 485d7b7869a9a..99292289f9233 100644 --- a/tests/ui/macros/macro-path-prelude-fail-3.stderr +++ b/tests/ui/macros/macro-path-prelude-fail-3.stderr @@ -2,7 +2,10 @@ error: cannot find macro `inline` in this scope --> $DIR/macro-path-prelude-fail-3.rs:2:5 | LL | inline!(); - | ^^^^^^ help: a macro with a similar name exists: `line` + | ^^^^^^ + | | + | not found in this scope + | help: a macro with a similar name exists: `line` --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | = note: similarly named macro `line` defined here diff --git a/tests/ui/macros/macro-reexport-removed.rs b/tests/ui/macros/macro-reexport-removed.rs index 4a054686d7767..e9e1c52da3749 100644 --- a/tests/ui/macros/macro-reexport-removed.rs +++ b/tests/ui/macros/macro-reexport-removed.rs @@ -2,7 +2,7 @@ #![feature(macro_reexport)] //~ ERROR feature has been removed -#[macro_reexport(macro_one)] //~ ERROR cannot find attribute `macro_reexport` in this scope +#[macro_reexport(macro_one)] //~ ERROR cannot find attribute `macro_reexport` extern crate two_macros; fn main() {} diff --git a/tests/ui/macros/macro-reexport-removed.stderr b/tests/ui/macros/macro-reexport-removed.stderr index 475a586ddc083..918fde10cc134 100644 --- a/tests/ui/macros/macro-reexport-removed.stderr +++ b/tests/ui/macros/macro-reexport-removed.stderr @@ -6,11 +6,14 @@ LL | #![feature(macro_reexport)] | = note: subsumed by `pub use` -error: cannot find attribute `macro_reexport` in this scope +error: cannot find attribute `macro_reexport` in the crate root --> $DIR/macro-reexport-removed.rs:5:3 | LL | #[macro_reexport(macro_one)] - | ^^^^^^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_export` + | ^^^^^^^^^^^^^^ + | | + | not found in the crate root + | help: a built-in attribute with a similar name exists: `macro_export` error: aborting due to 2 previous errors diff --git a/tests/ui/macros/macro-use-wrong-name.stderr b/tests/ui/macros/macro-use-wrong-name.stderr index 89345866be804..2db09f1e2226c 100644 --- a/tests/ui/macros/macro-use-wrong-name.stderr +++ b/tests/ui/macros/macro-use-wrong-name.stderr @@ -2,7 +2,7 @@ error: cannot find macro `macro_two` in this scope --> $DIR/macro-use-wrong-name.rs:7:5 | LL | macro_two!(); - | ^^^^^^^^^ + | ^^^^^^^^^ not found in this scope | ::: $DIR/auxiliary/two_macros.rs:2:1 | diff --git a/tests/ui/macros/macro_path_as_generic_bound.rs b/tests/ui/macros/macro_path_as_generic_bound.rs index 663f85688ec9a..b1a07d3dfdde0 100644 --- a/tests/ui/macros/macro_path_as_generic_bound.rs +++ b/tests/ui/macros/macro_path_as_generic_bound.rs @@ -4,6 +4,6 @@ macro_rules! foo(($t:path) => { impl Foo for T {} }); -foo!(m::m2::A); //~ ERROR failed to resolve +foo!(m::m2::A); //~ ERROR cannot find item `m` fn main() {} diff --git a/tests/ui/macros/macro_path_as_generic_bound.stderr b/tests/ui/macros/macro_path_as_generic_bound.stderr index e25ff57e57f36..3b469b5166a1d 100644 --- a/tests/ui/macros/macro_path_as_generic_bound.stderr +++ b/tests/ui/macros/macro_path_as_generic_bound.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `m` +error[E0433]: cannot find item `m` in this scope --> $DIR/macro_path_as_generic_bound.rs:7:6 | LL | foo!(m::m2::A); diff --git a/tests/ui/macros/macro_undefined.stderr b/tests/ui/macros/macro_undefined.stderr index cc3efacbc5415..dccdd754606f2 100644 --- a/tests/ui/macros/macro_undefined.stderr +++ b/tests/ui/macros/macro_undefined.stderr @@ -5,7 +5,10 @@ LL | macro_rules! kl { | --------------- similarly named macro `kl` defined here ... LL | k!(); - | ^ help: a macro with a similar name exists: `kl` + | ^ + | | + | not found in this scope + | help: a macro with a similar name exists: `kl` error: aborting due to 1 previous error diff --git a/tests/ui/macros/macros-nonfatal-errors.stderr b/tests/ui/macros/macros-nonfatal-errors.stderr index abf43e2a009d7..0ab29a20525d4 100644 --- a/tests/ui/macros/macros-nonfatal-errors.stderr +++ b/tests/ui/macros/macros-nonfatal-errors.stderr @@ -242,7 +242,7 @@ error: cannot find macro `llvm_asm` in this scope --> $DIR/macros-nonfatal-errors.rs:99:5 | LL | llvm_asm!(invalid); - | ^^^^^^^^ + | ^^^^^^^^ not found in this scope error: aborting due to 28 previous errors diff --git a/tests/ui/macros/meta-item-absolute-path.rs b/tests/ui/macros/meta-item-absolute-path.rs index 8ed911cbca718..04a52fa791c7b 100644 --- a/tests/ui/macros/meta-item-absolute-path.rs +++ b/tests/ui/macros/meta-item-absolute-path.rs @@ -1,5 +1,5 @@ -#[derive(::Absolute)] //~ ERROR failed to resolve - //~| ERROR failed to resolve +#[derive(::Absolute)] //~ ERROR cannot find macro `Absolute` + //~| ERROR cannot find macro `Absolute` struct S; fn main() {} diff --git a/tests/ui/macros/meta-item-absolute-path.stderr b/tests/ui/macros/meta-item-absolute-path.stderr index f0d763d7abbaa..d6786e88d233b 100644 --- a/tests/ui/macros/meta-item-absolute-path.stderr +++ b/tests/ui/macros/meta-item-absolute-path.stderr @@ -1,14 +1,14 @@ -error[E0433]: failed to resolve: maybe a missing crate `Absolute`? +error[E0433]: cannot find macro `Absolute` in the crate root --> $DIR/meta-item-absolute-path.rs:1:12 | LL | #[derive(::Absolute)] - | ^^^^^^^^ maybe a missing crate `Absolute`? + | ^^^^^^^^ you might be missing a crate named `Absolute` -error[E0433]: failed to resolve: maybe a missing crate `Absolute`? +error[E0433]: cannot find macro `Absolute` in the crate root --> $DIR/meta-item-absolute-path.rs:1:12 | LL | #[derive(::Absolute)] - | ^^^^^^^^ maybe a missing crate `Absolute`? + | ^^^^^^^^ you might be missing a crate named `Absolute` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs index 1eda5f5bb6bc3..89acf6ffdddf5 100644 --- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs +++ b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs @@ -21,15 +21,15 @@ macro_rules! curly__rhs_dollar__no_round { #[rustfmt::skip] // autoformatters can break a few of the error traces macro_rules! no_curly__no_rhs_dollar__round { ( $( $i:ident ),* ) => { count(i) }; - //~^ ERROR cannot find function `count` in this scope - //~| ERROR cannot find value `i` in this scope + //~^ ERROR cannot find function `count` + //~| ERROR cannot find value `i` } #[rustfmt::skip] // autoformatters can break a few of the error traces macro_rules! no_curly__no_rhs_dollar__no_round { ( $i:ident ) => { count(i) }; - //~^ ERROR cannot find function `count` in this scope - //~| ERROR cannot find value `i` in this scope + //~^ ERROR cannot find function `count` + //~| ERROR cannot find value `i` } #[rustfmt::skip] // autoformatters can break a few of the error traces @@ -41,7 +41,7 @@ macro_rules! no_curly__rhs_dollar__round { #[rustfmt::skip] // autoformatters can break a few of the error traces macro_rules! no_curly__rhs_dollar__no_round { ( $i:ident ) => { count($i) }; - //~^ ERROR cannot find function `count` in this scope + //~^ ERROR cannot find function `count` } // Other scenarios @@ -150,7 +150,7 @@ fn main() { no_curly__no_rhs_dollar__no_round!(a); no_curly__rhs_dollar__round!(a, b, c); no_curly__rhs_dollar__no_round!(a); - //~^ ERROR cannot find value `a` in this scope + //~^ ERROR cannot find value `a` extra_garbage_after_metavar!(a); metavar_depth_is_not_literal!(a); diff --git a/tests/ui/match/expr_before_ident_pat.rs b/tests/ui/match/expr_before_ident_pat.rs index 27ef3d05a2954..02f053a05bc70 100644 --- a/tests/ui/match/expr_before_ident_pat.rs +++ b/tests/ui/match/expr_before_ident_pat.rs @@ -8,6 +8,6 @@ macro_rules! funny { fn main() { funny!(a, a); - //~^ ERROR cannot find value `a` in this scope + //~^ ERROR cannot find value `a` //~| ERROR arbitrary expressions aren't allowed in patterns } diff --git a/tests/ui/match/issue-82866.rs b/tests/ui/match/issue-82866.rs index 95cd62261f109..042a2611c0880 100644 --- a/tests/ui/match/issue-82866.rs +++ b/tests/ui/match/issue-82866.rs @@ -1,7 +1,7 @@ fn main() { match x { - //~^ ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` Some::(v) => (), - //~^ ERROR cannot find type `v` in this scope + //~^ ERROR cannot find type `v` } } diff --git a/tests/ui/match/issue-92100.rs b/tests/ui/match/issue-92100.rs index baac570dd8a9d..1fb151d2895d9 100644 --- a/tests/ui/match/issue-92100.rs +++ b/tests/ui/match/issue-92100.rs @@ -2,6 +2,6 @@ fn main() { match [1, 2] { - [a.., a] => {} //~ ERROR cannot find value `a` in this scope + [a.., a] => {} //~ ERROR cannot find value `a` } } diff --git a/tests/ui/match/match-join.rs b/tests/ui/match/match-join.rs index b0f2593c85364..3ba7b3363fd21 100644 --- a/tests/ui/match/match-join.rs +++ b/tests/ui/match/match-join.rs @@ -6,6 +6,6 @@ fn my_panic() -> ! { panic!(); } fn main() { match true { false => { my_panic(); } true => { } } - println!("{}", x); //~ ERROR cannot find value `x` in this scope + println!("{}", x); //~ ERROR cannot find value `x` let x: isize; } diff --git a/tests/ui/methods/suggest-method-on-call-for-ambig-receiver.rs b/tests/ui/methods/suggest-method-on-call-for-ambig-receiver.rs index fc2c15ee8c66d..58ba6d8f261a1 100644 --- a/tests/ui/methods/suggest-method-on-call-for-ambig-receiver.rs +++ b/tests/ui/methods/suggest-method-on-call-for-ambig-receiver.rs @@ -8,7 +8,7 @@ fn separate_arms() { } Some(right) => { consume(right); - //~^ ERROR cannot find function `consume` in this scope + //~^ ERROR cannot find function `consume` } } } diff --git a/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs index 93b7ddf5e9e09..eb5812bce53b0 100644 --- a/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs +++ b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs @@ -2,5 +2,5 @@ fn main() { let hello = len(vec![]); - //~^ ERROR cannot find function `len` in this scope + //~^ ERROR cannot find function `len` } diff --git a/tests/ui/mir/issue-121103.rs b/tests/ui/mir/issue-121103.rs index e06361a6964c0..879ec31c2ae2b 100644 --- a/tests/ui/mir/issue-121103.rs +++ b/tests/ui/mir/issue-121103.rs @@ -1,3 +1,3 @@ fn main(_: as lib2::TypeFn>::Output) {} -//~^ ERROR failed to resolve: use of undeclared crate or module `lib2` -//~| ERROR failed to resolve: use of undeclared crate or module `lib2` +//~^ ERROR cannot find item `lib2` +//~| ERROR cannot find item `lib2` diff --git a/tests/ui/mir/issue-121103.stderr b/tests/ui/mir/issue-121103.stderr index 913eee9e0c503..1e58a15f26e5e 100644 --- a/tests/ui/mir/issue-121103.stderr +++ b/tests/ui/mir/issue-121103.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `lib2` +error[E0433]: cannot find item `lib2` in this scope --> $DIR/issue-121103.rs:1:38 | LL | fn main(_: as lib2::TypeFn>::Output) {} | ^^^^ use of undeclared crate or module `lib2` -error[E0433]: failed to resolve: use of undeclared crate or module `lib2` +error[E0433]: cannot find item `lib2` in this scope --> $DIR/issue-121103.rs:1:13 | LL | fn main(_: as lib2::TypeFn>::Output) {} diff --git a/tests/ui/mir/issue-83499-input-output-iteration-ice.rs b/tests/ui/mir/issue-83499-input-output-iteration-ice.rs index 78e5c96180285..7a298ad7a2f6a 100644 --- a/tests/ui/mir/issue-83499-input-output-iteration-ice.rs +++ b/tests/ui/mir/issue-83499-input-output-iteration-ice.rs @@ -6,5 +6,5 @@ fn main() {} fn foo(_: Bar, ...) -> impl {} //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg -//~| ERROR cannot find type `Bar` in this scope +//~| ERROR cannot find type `Bar` //~| ERROR at least one trait must be specified diff --git a/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-1.rs b/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-1.rs index 0b2e63bfcf772..311dc77e1db7b 100644 --- a/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-1.rs +++ b/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-1.rs @@ -10,7 +10,7 @@ pub fn a() -> B { B } mod handlers { pub struct C(B); - //~^ ERROR cannot find type `B` in this scope + //~^ ERROR cannot find type `B` pub fn c() -> impl Fn() -> C { let a1 = (); || C((crate::a(), a1).into()) diff --git a/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-2.rs b/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-2.rs index d63ccc6651c7b..4e45d1eabc6c9 100644 --- a/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-2.rs +++ b/tests/ui/mir/mir-build-2021-closure-capture-ice-110453-2.rs @@ -6,6 +6,6 @@ #![crate_type="lib"] pub fn dup(f: impl Fn(i32) -> i32) -> impl Fn(as_str) -> i32 { -//~^ ERROR cannot find type `as_str` in this scope +//~^ ERROR cannot find type `as_str` move |a| f(a * 2) } diff --git a/tests/ui/mir/validate/error-body.rs b/tests/ui/mir/validate/error-body.rs index e77867ddfd421..4025d048afd03 100644 --- a/tests/ui/mir/validate/error-body.rs +++ b/tests/ui/mir/validate/error-body.rs @@ -3,7 +3,7 @@ fn _test() { let x = || 45; missing(); - //~^ ERROR cannot find function `missing` in this scope + //~^ ERROR cannot find function `missing` } fn main() {} diff --git a/tests/ui/missing/missing-items/missing-const-parameter.rs b/tests/ui/missing/missing-items/missing-const-parameter.rs index a3af88f263331..c688a7ddb77e9 100644 --- a/tests/ui/missing/missing-items/missing-const-parameter.rs +++ b/tests/ui/missing/missing-items/missing-const-parameter.rs @@ -1,23 +1,23 @@ struct Struct; impl Struct<{ N }> {} -//~^ ERROR cannot find value `N` in this scope +//~^ ERROR cannot find value `N` //~| HELP you might be missing a const parameter fn func0(_: Struct<{ N }>) {} -//~^ ERROR cannot find value `N` in this scope +//~^ ERROR cannot find value `N` //~| HELP you might be missing a const parameter fn func1(_: [u8; N]) {} -//~^ ERROR cannot find value `N` in this scope +//~^ ERROR cannot find value `N` //~| HELP you might be missing a const parameter fn func2(_: [T; N]) {} -//~^ ERROR cannot find value `N` in this scope +//~^ ERROR cannot find value `N` //~| HELP you might be missing a const parameter struct Image([[u32; C]; R]); -//~^ ERROR cannot find value `C` in this scope +//~^ ERROR cannot find value `C` //~| HELP a const parameter with a similar name exists //~| HELP you might be missing a const parameter diff --git a/tests/ui/missing/missing-items/missing-type-parameter2.rs b/tests/ui/missing/missing-items/missing-type-parameter2.rs index e9b32fb7198d4..7c302127a5d54 100644 --- a/tests/ui/missing/missing-items/missing-type-parameter2.rs +++ b/tests/ui/missing/missing-items/missing-type-parameter2.rs @@ -1,19 +1,19 @@ struct X(); impl X {} -//~^ ERROR cannot find type `N` in this scope +//~^ ERROR cannot find type `N` //~| ERROR unresolved item provided when a constant was expected impl X {} -//~^ ERROR cannot find type `N` in this scope +//~^ ERROR cannot find type `N` //~| ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions //~| ERROR unresolved item provided when a constant was expected fn foo(_: T) where T: Send {} -//~^ ERROR cannot find type `T` in this scope -//~| ERROR cannot find type `T` in this scope +//~^ ERROR cannot find type `T` +//~| ERROR cannot find type `T` fn bar(_: A) {} -//~^ ERROR cannot find type `A` in this scope +//~^ ERROR cannot find type `A` fn main() { } diff --git a/tests/ui/missing/missing-macro-use.rs b/tests/ui/missing/missing-macro-use.rs index a761c9a5ffd27..d7ddda7332852 100644 --- a/tests/ui/missing/missing-macro-use.rs +++ b/tests/ui/missing/missing-macro-use.rs @@ -4,5 +4,5 @@ extern crate two_macros; pub fn main() { macro_two!(); - //~^ ERROR cannot find macro `macro_two` in this scope + //~^ ERROR cannot find macro `macro_two` } diff --git a/tests/ui/missing/missing-macro-use.stderr b/tests/ui/missing/missing-macro-use.stderr index 5d8ff486e06a3..d83c0680571c5 100644 --- a/tests/ui/missing/missing-macro-use.stderr +++ b/tests/ui/missing/missing-macro-use.stderr @@ -2,7 +2,7 @@ error: cannot find macro `macro_two` in this scope --> $DIR/missing-macro-use.rs:6:5 | LL | macro_two!(); - | ^^^^^^^^^ + | ^^^^^^^^^ not found in this scope | help: consider importing this macro | diff --git a/tests/ui/modules_and_files_visibility/mod_file_correct_spans.rs b/tests/ui/modules_and_files_visibility/mod_file_correct_spans.rs index c42d2eaa7bd6d..1e00523abc20b 100644 --- a/tests/ui/modules_and_files_visibility/mod_file_correct_spans.rs +++ b/tests/ui/modules_and_files_visibility/mod_file_correct_spans.rs @@ -4,5 +4,5 @@ mod mod_file_aux; fn main() { assert!(mod_file_aux::bar() == 10); - //~^ ERROR cannot find function `bar` in module `mod_file_aux` + //~^ ERROR cannot find function `bar` } diff --git a/tests/ui/modules_and_files_visibility/mod_file_correct_spans.stderr b/tests/ui/modules_and_files_visibility/mod_file_correct_spans.stderr index 3426505cd1105..1d368e94baa23 100644 --- a/tests/ui/modules_and_files_visibility/mod_file_correct_spans.stderr +++ b/tests/ui/modules_and_files_visibility/mod_file_correct_spans.stderr @@ -2,7 +2,7 @@ error[E0425]: cannot find function `bar` in module `mod_file_aux` --> $DIR/mod_file_correct_spans.rs:6:27 | LL | assert!(mod_file_aux::bar() == 10); - | ^^^ not found in `mod_file_aux` + | ^^^ not found in module `mod_file_aux` error: aborting due to 1 previous error diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig.rs b/tests/ui/modules_and_files_visibility/mod_file_disambig.rs index e5958af173b66..8478004486b3a 100644 --- a/tests/ui/modules_and_files_visibility/mod_file_disambig.rs +++ b/tests/ui/modules_and_files_visibility/mod_file_disambig.rs @@ -2,5 +2,5 @@ mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` fou fn main() { assert_eq!(mod_file_aux::bar(), 10); - //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux` + //~^ ERROR cannot find item `mod_file_aux` } diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr b/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr index a2c99396987ef..0d319be52dd7c 100644 --- a/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr +++ b/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr @@ -6,7 +6,7 @@ LL | mod mod_file_disambig_aux; | = help: delete or rename one of them to remove the ambiguity -error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux` +error[E0433]: cannot find item `mod_file_aux` in this scope --> $DIR/mod_file_disambig.rs:4:16 | LL | assert_eq!(mod_file_aux::bar(), 10); diff --git a/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.rs b/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.rs index 6b92f4101948a..32ce8fbeafcfb 100644 --- a/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.rs +++ b/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.rs @@ -8,8 +8,8 @@ mod m { pub fn main() { use namespaced_enums::Foo::*; - foo(); //~ ERROR cannot find function `foo` in this scope - m::foo(); //~ ERROR cannot find function `foo` in module `m` - bar(); //~ ERROR cannot find function `bar` in this scope - m::bar(); //~ ERROR cannot find function `bar` in module `m` + foo(); //~ ERROR cannot find function `foo` + m::foo(); //~ ERROR cannot find function `foo` + bar(); //~ ERROR cannot find function `bar` + m::bar(); //~ ERROR cannot find function `bar` } diff --git a/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr b/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr index 227d30282b1ea..5425a76bd4b7d 100644 --- a/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr +++ b/tests/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr @@ -2,13 +2,13 @@ error[E0425]: cannot find function `foo` in module `m` --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:12:8 | LL | m::foo(); - | ^^^ not found in `m` + | ^^^ not found in module `m` error[E0425]: cannot find function `bar` in module `m` --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:14:8 | LL | m::bar(); - | ^^^ not found in `m` + | ^^^ not found in module `m` error[E0425]: cannot find function `foo` in this scope --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:11:5 diff --git a/tests/ui/namespace/namespaced-enum-glob-import-no-impls.rs b/tests/ui/namespace/namespaced-enum-glob-import-no-impls.rs index ab24f36f9a156..368c261b23ab8 100644 --- a/tests/ui/namespace/namespaced-enum-glob-import-no-impls.rs +++ b/tests/ui/namespace/namespaced-enum-glob-import-no-impls.rs @@ -18,8 +18,8 @@ mod m { pub fn main() { use m2::Foo::*; - foo(); //~ ERROR cannot find function `foo` in this scope - m::foo(); //~ ERROR cannot find function `foo` in module `m` - bar(); //~ ERROR cannot find function `bar` in this scope - m::bar(); //~ ERROR cannot find function `bar` in module `m` + foo(); //~ ERROR cannot find function `foo` + m::foo(); //~ ERROR cannot find function `foo` + bar(); //~ ERROR cannot find function `bar` + m::bar(); //~ ERROR cannot find function `bar` } diff --git a/tests/ui/namespace/namespaced-enum-glob-import-no-impls.stderr b/tests/ui/namespace/namespaced-enum-glob-import-no-impls.stderr index 111ac7ab0f0bb..7b9a2ed6c33a0 100644 --- a/tests/ui/namespace/namespaced-enum-glob-import-no-impls.stderr +++ b/tests/ui/namespace/namespaced-enum-glob-import-no-impls.stderr @@ -2,13 +2,13 @@ error[E0425]: cannot find function `foo` in module `m` --> $DIR/namespaced-enum-glob-import-no-impls.rs:22:8 | LL | m::foo(); - | ^^^ not found in `m` + | ^^^ not found in module `m` error[E0425]: cannot find function `bar` in module `m` --> $DIR/namespaced-enum-glob-import-no-impls.rs:24:8 | LL | m::bar(); - | ^^^ not found in `m` + | ^^^ not found in module `m` error[E0425]: cannot find function `foo` in this scope --> $DIR/namespaced-enum-glob-import-no-impls.rs:21:5 diff --git a/tests/ui/nested-cfg-attrs.rs b/tests/ui/nested-cfg-attrs.rs index 0af28fc3d8ec6..05570dd9862a8 100644 --- a/tests/ui/nested-cfg-attrs.rs +++ b/tests/ui/nested-cfg-attrs.rs @@ -1,4 +1,4 @@ #[cfg_attr(all(), cfg_attr(all(), cfg(FALSE)))] fn f() {} -fn main() { f() } //~ ERROR cannot find function `f` in this scope +fn main() { f() } //~ ERROR cannot find function `f` diff --git a/tests/ui/object-safety/avoid-ice-on-warning.rs b/tests/ui/object-safety/avoid-ice-on-warning.rs index b90d8911d500b..468bced514cbe 100644 --- a/tests/ui/object-safety/avoid-ice-on-warning.rs +++ b/tests/ui/object-safety/avoid-ice-on-warning.rs @@ -3,7 +3,7 @@ //@[new] edition:2021 fn call_this(f: F) : Fn(&str) + call_that {} //~^ ERROR return types are denoted using `->` -//~| ERROR cannot find trait `call_that` in this scope +//~| ERROR cannot find trait `call_that` //[old]~| WARN trait objects without an explicit `dyn` are deprecated //[old]~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! fn main() {} diff --git a/tests/ui/object-safety/erroneous_signature.rs b/tests/ui/object-safety/erroneous_signature.rs index cc1841cc4b2a1..cf98df869c2a0 100644 --- a/tests/ui/object-safety/erroneous_signature.rs +++ b/tests/ui/object-safety/erroneous_signature.rs @@ -1,11 +1,11 @@ trait Foo { fn err(&self) -> MissingType; - //~^ ERROR cannot find type `MissingType` in this scope + //~^ ERROR cannot find type `MissingType` } impl Foo for i32 { fn err(&self) -> MissingType { - //~^ ERROR cannot find type `MissingType` in this scope + //~^ ERROR cannot find type `MissingType` 0 } } diff --git a/tests/ui/offset-of/offset-of-enum.rs b/tests/ui/offset-of/offset-of-enum.rs index cb2f04786ac5c..6a20d0dfaa2ef 100644 --- a/tests/ui/offset-of/offset-of-enum.rs +++ b/tests/ui/offset-of/offset-of-enum.rs @@ -14,5 +14,5 @@ fn main() { offset_of!(Alpha, Two.1); //~ ERROR no field named `1` on enum variant `Alpha::Two` offset_of!(Alpha, Two.foo); //~ ERROR no field named `foo` on enum variant `Alpha::Two` offset_of!(Alpha, NonExistent); //~ ERROR no variant named `NonExistent` found for enum `Alpha` - offset_of!(Beta, One); //~ ERROR cannot find type `Beta` in this scope + offset_of!(Beta, One); //~ ERROR cannot find type `Beta` } diff --git a/tests/ui/offset-of/offset-of-self.rs b/tests/ui/offset-of/offset-of-self.rs index 1558e13b53095..1396f0de07c42 100644 --- a/tests/ui/offset-of/offset-of-self.rs +++ b/tests/ui/offset-of/offset-of-self.rs @@ -31,7 +31,7 @@ impl S { mod m { use std::mem::offset_of; fn off() { - offset_of!(self::S, v); //~ ERROR cannot find type `S` in module + offset_of!(self::S, v); //~ ERROR cannot find type `S` offset_of!(super::S, v); offset_of!(crate::S, v); } @@ -48,7 +48,7 @@ mod n { fn main() { offset_of!(self::S, v); - offset_of!(Self, v); //~ ERROR cannot find type `Self` in this scope + offset_of!(Self, v); //~ ERROR cannot find type `Self` offset_of!(S, self); //~ no field `self` on type `S` offset_of!(S, v.self); //~ no field `self` on type `u8` diff --git a/tests/ui/offset-of/offset-of-self.stderr b/tests/ui/offset-of/offset-of-self.stderr index 7c7576e066b6f..89bec86a2a96c 100644 --- a/tests/ui/offset-of/offset-of-self.stderr +++ b/tests/ui/offset-of/offset-of-self.stderr @@ -8,7 +8,7 @@ error[E0412]: cannot find type `S` in module `self` --> $DIR/offset-of-self.rs:34:26 | LL | offset_of!(self::S, v); - | ^ not found in `self` + | ^ not found in module `self` | help: consider importing this struct | diff --git a/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.rs b/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.rs index 33671df949280..e31b6bf527563 100644 --- a/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.rs +++ b/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.rs @@ -10,7 +10,7 @@ fn foo() -> String { fn bar() -> String { #[attr] [1, 2, 3].iter().map(|c| c.to_string()).collect::() //~ ERROR expected `;`, found `#` - #[attr] //~ ERROR cannot find attribute `attr` in this scope + #[attr] //~ ERROR cannot find attribute `attr` String::new() } diff --git a/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.stderr b/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.stderr index 6266718162f8e..70f3c1de199c0 100644 --- a/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.stderr +++ b/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.stderr @@ -44,11 +44,11 @@ help: alternatively, consider surrounding the expression with a block LL | { [1, 2, 3].iter().map(|c| c.to_string()).collect::() } | + + -error: cannot find attribute `attr` in this scope +error: cannot find attribute `attr` in the crate root --> $DIR/multiple-tail-expr-behind-cfg.rs:13:7 | LL | #[attr] - | ^^^^ + | ^^^^ not found in the crate root error: aborting due to 3 previous errors diff --git a/tests/ui/parser/circular_modules_main.stderr b/tests/ui/parser/circular_modules_main.stderr index 2de70789358b0..7310a71d6ee85 100644 --- a/tests/ui/parser/circular_modules_main.stderr +++ b/tests/ui/parser/circular_modules_main.stderr @@ -8,7 +8,7 @@ error[E0425]: cannot find function `hi_str` in module `circular_modules_main` --> $DIR/circular_modules_hello.rs:7:43 | LL | println!("{}", circular_modules_main::hi_str()); - | ^^^^^^ not found in `circular_modules_main` + | ^^^^^^ not found in module `circular_modules_main` | help: consider importing this function | diff --git a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs index 53e3c6f960500..4549f9a7d1353 100644 --- a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs +++ b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs @@ -7,9 +7,9 @@ fn main() { fn banana(a: >::BAR) {} //~^ ERROR unexpected `const` parameter declaration -//~| ERROR cannot find type `T` in this scope +//~| ERROR cannot find type `T` fn chaenomeles() { path::path::Struct::() //~^ ERROR unexpected `const` parameter declaration - //~| ERROR failed to resolve: use of undeclared crate or module `path` + //~| ERROR cannot find item `path` } diff --git a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr index 96885d11ee07f..f96779e4969ac 100644 --- a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr +++ b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr @@ -21,7 +21,7 @@ error: unexpected `const` parameter declaration LL | path::path::Struct::() | ^^^^^^^^^^^^^^ expected a `const` expression, not a parameter declaration -error[E0433]: failed to resolve: use of undeclared crate or module `path` +error[E0433]: cannot find item `path` in this scope --> $DIR/const-param-decl-on-type-instead-of-impl.rs:12:5 | LL | path::path::Struct::() diff --git a/tests/ui/parser/default-unmatched-assoc.rs b/tests/ui/parser/default-unmatched-assoc.rs index 168ea3e76f648..81c966e0beee8 100644 --- a/tests/ui/parser/default-unmatched-assoc.rs +++ b/tests/ui/parser/default-unmatched-assoc.rs @@ -1,7 +1,7 @@ fn main() {} trait Foo { - default!(); //~ ERROR cannot find macro `default` in this scope + default!(); //~ ERROR cannot find macro `default` default do //~^ ERROR `default` is not followed by an item //~| ERROR non-item in item list @@ -9,7 +9,7 @@ trait Foo { struct S; impl S { - default!(); //~ ERROR cannot find macro `default` in this scope + default!(); //~ ERROR cannot find macro `default` default do //~^ ERROR `default` is not followed by an item //~| ERROR non-item in item list diff --git a/tests/ui/parser/default-unmatched-assoc.stderr b/tests/ui/parser/default-unmatched-assoc.stderr index ee35fded99ec9..511371555a954 100644 --- a/tests/ui/parser/default-unmatched-assoc.stderr +++ b/tests/ui/parser/default-unmatched-assoc.stderr @@ -38,17 +38,17 @@ LL | default do LL | } | - item list ends here -error: cannot find macro `default` in this scope +error: cannot find macro `default` in trait `Foo` --> $DIR/default-unmatched-assoc.rs:4:5 | LL | default!(); - | ^^^^^^^ + | ^^^^^^^ not found in trait `Foo` -error: cannot find macro `default` in this scope +error: cannot find macro `default` in the crate root --> $DIR/default-unmatched-assoc.rs:12:5 | LL | default!(); - | ^^^^^^^ + | ^^^^^^^ not found in the crate root error: aborting due to 6 previous errors diff --git a/tests/ui/parser/default-unmatched-extern.rs b/tests/ui/parser/default-unmatched-extern.rs index 8d0ea590f573f..d1527bba9caa2 100644 --- a/tests/ui/parser/default-unmatched-extern.rs +++ b/tests/ui/parser/default-unmatched-extern.rs @@ -1,7 +1,7 @@ fn main() {} extern "C" { - default!(); //~ ERROR cannot find macro `default` in this scope + default!(); //~ ERROR cannot find macro `default` default do //~^ ERROR `default` is not followed by an item //~| ERROR non-item in item list diff --git a/tests/ui/parser/default-unmatched-extern.stderr b/tests/ui/parser/default-unmatched-extern.stderr index bb4efd51631e4..9a01a80b9a1fe 100644 --- a/tests/ui/parser/default-unmatched-extern.stderr +++ b/tests/ui/parser/default-unmatched-extern.stderr @@ -18,11 +18,11 @@ LL | default do LL | } | - item list ends here -error: cannot find macro `default` in this scope +error: cannot find macro `default` in the crate root --> $DIR/default-unmatched-extern.rs:4:5 | LL | default!(); - | ^^^^^^^ + | ^^^^^^^ not found in the crate root error: aborting due to 3 previous errors diff --git a/tests/ui/parser/dyn-trait-compatibility.rs b/tests/ui/parser/dyn-trait-compatibility.rs index 6341e05327754..3cecad46be6db 100644 --- a/tests/ui/parser/dyn-trait-compatibility.rs +++ b/tests/ui/parser/dyn-trait-compatibility.rs @@ -1,14 +1,14 @@ type A0 = dyn; -//~^ ERROR cannot find type `dyn` in this scope +//~^ ERROR cannot find type `dyn` type A1 = dyn::dyn; -//~^ ERROR use of undeclared crate or module `dyn` +//~^ ERROR cannot find item `dyn` type A2 = dyn; -//~^ ERROR cannot find type `dyn` in this scope -//~| ERROR cannot find type `dyn` in this scope -//~| ERROR cannot find type `dyn` in this scope +//~^ ERROR cannot find type `dyn` +//~| ERROR cannot find type `dyn` +//~| ERROR cannot find type `dyn` type A3 = dyn<::dyn>; -//~^ ERROR cannot find type `dyn` in this scope -//~| ERROR cannot find type `dyn` in this scope -//~| ERROR cannot find trait `dyn` in this scope +//~^ ERROR cannot find type `dyn` +//~| ERROR cannot find type `dyn` +//~| ERROR cannot find trait `dyn` fn main() {} diff --git a/tests/ui/parser/dyn-trait-compatibility.stderr b/tests/ui/parser/dyn-trait-compatibility.stderr index e34d855a9d4f9..9a3d3d98337f4 100644 --- a/tests/ui/parser/dyn-trait-compatibility.stderr +++ b/tests/ui/parser/dyn-trait-compatibility.stderr @@ -40,7 +40,7 @@ error[E0412]: cannot find type `dyn` in this scope LL | type A3 = dyn<::dyn>; | ^^^ not found in this scope -error[E0433]: failed to resolve: use of undeclared crate or module `dyn` +error[E0433]: cannot find item `dyn` in this scope --> $DIR/dyn-trait-compatibility.rs:3:11 | LL | type A1 = dyn::dyn; diff --git a/tests/ui/parser/emoji-identifiers.rs b/tests/ui/parser/emoji-identifiers.rs index b50c046bcb204..faabab8a3c749 100644 --- a/tests/ui/parser/emoji-identifiers.rs +++ b/tests/ui/parser/emoji-identifiers.rs @@ -10,7 +10,7 @@ fn i_like_to_😅_a_lot() -> 👀 { //~ ERROR identifiers cannot contain emoji //~^ ERROR identifiers cannot contain emoji } fn main() { - let _ = i_like_to_😄_a_lot() ➖ 4; //~ ERROR cannot find function `i_like_to_😄_a_lot` in this scope + let _ = i_like_to_😄_a_lot() ➖ 4; //~ ERROR cannot find function `i_like_to_😄_a_lot` //~^ ERROR identifiers cannot contain emoji //~| ERROR unknown start of token: \u{2796} diff --git a/tests/ui/parser/fn-field-parse-error-ice.rs b/tests/ui/parser/fn-field-parse-error-ice.rs index 188257ea53a31..d5a2b37ace118 100644 --- a/tests/ui/parser/fn-field-parse-error-ice.rs +++ b/tests/ui/parser/fn-field-parse-error-ice.rs @@ -4,7 +4,7 @@ struct Baz { inner : dyn fn () //~^ ERROR expected `,`, or `}`, found keyword `fn` //~| ERROR expected identifier, found keyword `fn` - //~| ERROR cannot find type `dyn` in this scope + //~| ERROR cannot find type `dyn` } fn main() {} diff --git a/tests/ui/parser/issues/issue-103143.rs b/tests/ui/parser/issues/issue-103143.rs index a584274c40514..e7b04df05fd94 100644 --- a/tests/ui/parser/issues/issue-103143.rs +++ b/tests/ui/parser/issues/issue-103143.rs @@ -1,5 +1,5 @@ fn main() { x::<#[a]y::> //~^ ERROR invalid const generic expression - //~| ERROR cannot find value `x` in this scope + //~| ERROR cannot find value `x` } diff --git a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs index 1c28c0632fa84..88df8d77c9cb9 100644 --- a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs +++ b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs @@ -3,6 +3,6 @@ struct Apple((Apple, Option(Banana ? Citron))); //~^ ERROR invalid `?` in type //~| ERROR expected one of `)` or `,`, found `Citron` -//~| ERROR cannot find type `Citron` in this scope [E0412] +//~| ERROR cannot find type `Citron` //~| ERROR parenthesized type parameters may only be used with a `Fn` trait [E0214] //~| ERROR `Apple` has infinite size diff --git a/tests/ui/parser/issues/issue-112458.rs b/tests/ui/parser/issues/issue-112458.rs index 36895450cd94f..bc6cf32a90db4 100644 --- a/tests/ui/parser/issues/issue-112458.rs +++ b/tests/ui/parser/issues/issue-112458.rs @@ -1,4 +1,4 @@ fn main() { println!("{}", x.); //~ ERROR unexpected token: `)` - //~^ ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` } diff --git a/tests/ui/parser/issues/issue-118531-ice.rs b/tests/ui/parser/issues/issue-118531-ice.rs index 24794f06052c9..eeed679027b70 100644 --- a/tests/ui/parser/issues/issue-118531-ice.rs +++ b/tests/ui/parser/issues/issue-118531-ice.rs @@ -3,7 +3,7 @@ fn bar() -> String { [1, 2, 3].iter().map().collect::() //~ ERROR expected `;`, found `#` #[attr] //~ ERROR attributes on expressions are experimental [E0658] - //~^ ERROR cannot find attribute `attr` in this scope + //~^ ERROR cannot find attribute `attr` String::new() } diff --git a/tests/ui/parser/issues/issue-118531-ice.stderr b/tests/ui/parser/issues/issue-118531-ice.stderr index 68c7ad47b9dec..b838cb031201e 100644 --- a/tests/ui/parser/issues/issue-118531-ice.stderr +++ b/tests/ui/parser/issues/issue-118531-ice.stderr @@ -28,11 +28,11 @@ LL | #[attr] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: cannot find attribute `attr` in this scope +error: cannot find attribute `attr` in the crate root --> $DIR/issue-118531-ice.rs:5:7 | LL | #[attr] - | ^^^^ + | ^^^^ not found in the crate root error: aborting due to 3 previous errors diff --git a/tests/ui/parser/issues/issue-32505.rs b/tests/ui/parser/issues/issue-32505.rs index d95e7dc7d9eff..b91a95f376595 100644 --- a/tests/ui/parser/issues/issue-32505.rs +++ b/tests/ui/parser/issues/issue-32505.rs @@ -1,6 +1,6 @@ pub fn test() { foo(|_|) //~ ERROR expected expression, found `)` - //~^ ERROR cannot find function `foo` in this scope + //~^ ERROR cannot find function `foo` } fn main() { } diff --git a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs index 30f3781bf7743..ef61d902f2644 100644 --- a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs +++ b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs @@ -18,9 +18,9 @@ macro_rules! mac2 { fn foo() { mac1! { does_not_exist!() } - //~^ ERROR cannot find macro `does_not_exist` in this scope + //~^ ERROR cannot find macro `does_not_exist` mac2! { does_not_exist!() } - //~^ ERROR cannot find macro `does_not_exist` in this scope + //~^ ERROR cannot find macro `does_not_exist` } fn main() {} diff --git a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr index 2bd87ee0c38fa..908b4f75833e1 100644 --- a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr +++ b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr @@ -37,13 +37,13 @@ error: cannot find macro `does_not_exist` in this scope --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:22:13 | LL | mac2! { does_not_exist!() } - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ not found in this scope error: cannot find macro `does_not_exist` in this scope --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:20:13 | LL | mac1! { does_not_exist!() } - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ not found in this scope error: aborting due to 5 previous errors diff --git a/tests/ui/parser/kw-in-trait-bounds.rs b/tests/ui/parser/kw-in-trait-bounds.rs index 16d23672ca3c6..0baf0a45a4876 100644 --- a/tests/ui/parser/kw-in-trait-bounds.rs +++ b/tests/ui/parser/kw-in-trait-bounds.rs @@ -17,9 +17,9 @@ fn _g(_: impl struct, _: &dyn struct) //~^ ERROR expected identifier, found keyword `struct` //~| ERROR expected identifier, found keyword `struct` //~| ERROR expected identifier, found keyword `struct` -//~| ERROR cannot find trait `r#struct` in this scope -//~| ERROR cannot find trait `r#struct` in this scope -//~| ERROR cannot find trait `r#struct` in this scope +//~| ERROR cannot find trait `r#struct` +//~| ERROR cannot find trait `r#struct` +//~| ERROR cannot find trait `r#struct` //~| HELP a trait with a similar name exists //~| HELP a trait with a similar name exists //~| HELP a trait with a similar name exists @@ -29,7 +29,7 @@ fn _g(_: impl struct, _: &dyn struct) where B: struct, //~^ ERROR expected identifier, found keyword `struct` - //~| ERROR cannot find trait `r#struct` in this scope + //~| ERROR cannot find trait `r#struct` //~| HELP a trait with a similar name exists //~| HELP escape `struct` to use it as an identifier {} diff --git a/tests/ui/parser/mod_file_not_exist.rs b/tests/ui/parser/mod_file_not_exist.rs index 80a17163087c9..57363c2d1ea74 100644 --- a/tests/ui/parser/mod_file_not_exist.rs +++ b/tests/ui/parser/mod_file_not_exist.rs @@ -5,5 +5,5 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` fn main() { assert_eq!(mod_file_aux::bar(), 10); - //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux` + //~^ ERROR cannot find item `mod_file_aux` } diff --git a/tests/ui/parser/mod_file_not_exist.stderr b/tests/ui/parser/mod_file_not_exist.stderr index c2f9d30d9ec40..5ca938e913abe 100644 --- a/tests/ui/parser/mod_file_not_exist.stderr +++ b/tests/ui/parser/mod_file_not_exist.stderr @@ -7,7 +7,7 @@ LL | mod not_a_real_file; = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead -error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux` +error[E0433]: cannot find item `mod_file_aux` in this scope --> $DIR/mod_file_not_exist.rs:7:16 | LL | assert_eq!(mod_file_aux::bar(), 10); diff --git a/tests/ui/parser/mod_file_not_exist_windows.rs b/tests/ui/parser/mod_file_not_exist_windows.rs index 88780c0c24e94..f193d46dedbea 100644 --- a/tests/ui/parser/mod_file_not_exist_windows.rs +++ b/tests/ui/parser/mod_file_not_exist_windows.rs @@ -5,5 +5,5 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` fn main() { assert_eq!(mod_file_aux::bar(), 10); - //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux` + //~^ ERROR cannot find item `mod_file_aux` } diff --git a/tests/ui/parser/mod_file_not_exist_windows.stderr b/tests/ui/parser/mod_file_not_exist_windows.stderr index 53b09d8ca53a0..da1e43f21f744 100644 --- a/tests/ui/parser/mod_file_not_exist_windows.stderr +++ b/tests/ui/parser/mod_file_not_exist_windows.stderr @@ -7,7 +7,7 @@ LL | mod not_a_real_file; = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead -error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux` +error[E0433]: cannot find item `mod_file_aux` --> $DIR/mod_file_not_exist_windows.rs:7:16 | LL | assert_eq!(mod_file_aux::bar(), 10); diff --git a/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs b/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs index 7e7995d6724eb..09ec6a6b08bcc 100644 --- a/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs +++ b/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs @@ -3,8 +3,8 @@ fn main() { (()é); //~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator - //~| ERROR: cannot find value `é` in this scope + //~| ERROR: cannot find value `é` (()氷); //~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator - //~| ERROR: cannot find value `氷` in this scope + //~| ERROR: cannot find value `氷` } diff --git a/tests/ui/parser/not-a-pred.rs b/tests/ui/parser/not-a-pred.rs index 5518b554d8e53..15cb1c805ede4 100644 --- a/tests/ui/parser/not-a-pred.rs +++ b/tests/ui/parser/not-a-pred.rs @@ -10,6 +10,6 @@ fn main() { let a: isize = 10; let b: isize = 23; check (lt(a, b)); - //~^ ERROR cannot find function `check` in this scope [E0425] + //~^ ERROR cannot find function `check` f(a, b); } diff --git a/tests/ui/parser/pat-lt-bracket-5.rs b/tests/ui/parser/pat-lt-bracket-5.rs index 6d784494d56a3..1972752386430 100644 --- a/tests/ui/parser/pat-lt-bracket-5.rs +++ b/tests/ui/parser/pat-lt-bracket-5.rs @@ -1,5 +1,5 @@ fn main() { let v[0] = v[1]; //~^ error: expected a pattern, found an expression - //~| error: cannot find value `v` in this scope + //~| error: cannot find value `v` } diff --git a/tests/ui/parser/raw/raw-literal-keywords.rs b/tests/ui/parser/raw/raw-literal-keywords.rs index a986980fab97b..4679526a3e06a 100644 --- a/tests/ui/parser/raw/raw-literal-keywords.rs +++ b/tests/ui/parser/raw/raw-literal-keywords.rs @@ -11,15 +11,15 @@ fn test_union() { } fn test_if_2() { - let _ = r#if; //~ ERROR cannot find value `r#if` in this scope + let _ = r#if; //~ ERROR cannot find value `r#if` } fn test_struct_2() { - let _ = r#struct; //~ ERROR cannot find value `r#struct` in this scope + let _ = r#struct; //~ ERROR cannot find value `r#struct` } fn test_union_2() { - let _ = r#union; //~ ERROR cannot find value `union` in this scope + let _ = r#union; //~ ERROR cannot find value `union` } fn main() {} diff --git a/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs b/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs index 76c56a715d2a4..64bb0f973b4a6 100644 --- a/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs +++ b/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs @@ -4,8 +4,8 @@ fn main() { type Identity = fn(T) -> T; //~^ ERROR function pointer types may not have generic parameters - //~| ERROR cannot find type `T` in this scope - //~| ERROR cannot find type `T` in this scope + //~| ERROR cannot find type `T` + //~| ERROR cannot find type `T` let _: fn(); //~^ ERROR function pointer types may not have generic parameters diff --git a/tests/ui/parser/recover/recover-ref-dyn-mut.rs b/tests/ui/parser/recover/recover-ref-dyn-mut.rs index 3016275cc0fd2..820b6d1ef9631 100644 --- a/tests/ui/parser/recover/recover-ref-dyn-mut.rs +++ b/tests/ui/parser/recover/recover-ref-dyn-mut.rs @@ -5,5 +5,5 @@ fn main() { let r: &dyn mut Trait; //~^ ERROR: `mut` must precede `dyn` //~| HELP: place `mut` before `dyn` - //~| ERROR: cannot find trait `Trait` in this scope [E0405] + //~| ERROR: cannot find trait `Trait` } diff --git a/tests/ui/parser/recover/recover-unticked-labels.fixed b/tests/ui/parser/recover/recover-unticked-labels.fixed index f003550cbc222..074b047db91f6 100644 --- a/tests/ui/parser/recover/recover-unticked-labels.fixed +++ b/tests/ui/parser/recover/recover-unticked-labels.fixed @@ -1,7 +1,7 @@ //@ run-rustfix fn main() { - 'label: loop { break 'label }; //~ error: cannot find value `label` in this scope + 'label: loop { break 'label }; //~ error: cannot find value `label` 'label: loop { break 'label 0 }; //~ error: expected a label, found an identifier 'label: loop { continue 'label }; //~ error: expected a label, found an identifier } diff --git a/tests/ui/parser/recover/recover-unticked-labels.rs b/tests/ui/parser/recover/recover-unticked-labels.rs index 2b864f16b8412..629cc31509b35 100644 --- a/tests/ui/parser/recover/recover-unticked-labels.rs +++ b/tests/ui/parser/recover/recover-unticked-labels.rs @@ -1,7 +1,7 @@ //@ run-rustfix fn main() { - 'label: loop { break label }; //~ error: cannot find value `label` in this scope + 'label: loop { break label }; //~ error: cannot find value `label` 'label: loop { break label 0 }; //~ error: expected a label, found an identifier 'label: loop { continue label }; //~ error: expected a label, found an identifier } diff --git a/tests/ui/parser/trailing-question-in-macro-type.rs b/tests/ui/parser/trailing-question-in-macro-type.rs index e2a681ddd1115..eb1f47d7df972 100644 --- a/tests/ui/parser/trailing-question-in-macro-type.rs +++ b/tests/ui/parser/trailing-question-in-macro-type.rs @@ -10,5 +10,5 @@ macro_rules! fn_expr { fn main() { fn_expr!{ o?.when(|&i| i > 0)?.when(|&i| i%2 == 0) }; - //~^ ERROR cannot find value `o` in this scope + //~^ ERROR cannot find value `o` } diff --git a/tests/ui/parser/unmatched-langle-1.rs b/tests/ui/parser/unmatched-langle-1.rs index fdf2ae398014b..489b20dd7b4e6 100644 --- a/tests/ui/parser/unmatched-langle-1.rs +++ b/tests/ui/parser/unmatched-langle-1.rs @@ -4,6 +4,6 @@ fn main() { foo::<<<>(); //~^ ERROR: unmatched angle brackets - //~| ERROR: cannot find function `foo` in this scope [E0425] - //~| ERROR: cannot find type `Ty` in this scope [E0412] + //~| ERROR: cannot find function `foo` + //~| ERROR: cannot find type `Ty` } diff --git a/tests/ui/parser/where_with_bound.rs b/tests/ui/parser/where_with_bound.rs index 3ca45f1889c9c..c5a00a1001701 100644 --- a/tests/ui/parser/where_with_bound.rs +++ b/tests/ui/parser/where_with_bound.rs @@ -1,5 +1,5 @@ fn foo() where ::Item: ToString, T: Iterator { } //~^ ERROR generic parameters on `where` clauses are reserved for future use -//~| ERROR cannot find type `Item` in the crate root +//~| ERROR cannot find type `Item` fn main() {} diff --git a/tests/ui/pattern/pattern-error-continue.rs b/tests/ui/pattern/pattern-error-continue.rs index bed949439237a..80da1b6699283 100644 --- a/tests/ui/pattern/pattern-error-continue.rs +++ b/tests/ui/pattern/pattern-error-continue.rs @@ -30,6 +30,6 @@ fn main() { //~| expected `char`, found `bool` match () { - E::V => {} //~ ERROR failed to resolve: use of undeclared type `E` + E::V => {} //~ ERROR cannot find item `E` } } diff --git a/tests/ui/pattern/pattern-error-continue.stderr b/tests/ui/pattern/pattern-error-continue.stderr index 10fcccb030162..f07dd399c154b 100644 --- a/tests/ui/pattern/pattern-error-continue.stderr +++ b/tests/ui/pattern/pattern-error-continue.stderr @@ -50,7 +50,7 @@ note: function defined here LL | fn f(_c: char) {} | ^ -------- -error[E0433]: failed to resolve: use of undeclared type `E` +error[E0433]: cannot find item `E` in this scope --> $DIR/pattern-error-continue.rs:33:9 | LL | E::V => {} diff --git a/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs index fe7655c2c4e1c..32c0e858fd296 100644 --- a/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs +++ b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs @@ -1,22 +1,22 @@ fn main() { match &[1, 2, 3][..] { [1, rest..] => println!("{rest}"), - //~^ ERROR cannot find value `rest` in this scope - //~| ERROR cannot find value `rest` in this scope + //~^ ERROR cannot find value `rest` + //~| ERROR cannot find value `rest` //~| ERROR `X..` patterns in slices are experimental _ => {} } match &[4, 5, 6][..] { [] => {} [_, ..tail] => println!("{tail}"), - //~^ ERROR cannot find value `tail` in this scope - //~| ERROR cannot find value `tail` in this scope + //~^ ERROR cannot find value `tail` + //~| ERROR cannot find value `tail` } match &[7, 8, 9][..] { [] => {} [_, ...tail] => println!("{tail}"), - //~^ ERROR cannot find value `tail` in this scope - //~| ERROR cannot find value `tail` in this scope + //~^ ERROR cannot find value `tail` + //~| ERROR cannot find value `tail` //~| ERROR range-to patterns with `...` are not allowed } } diff --git a/tests/ui/privacy/privacy-ns1.rs b/tests/ui/privacy/privacy-ns1.rs index 1af5b857e9df6..4ef1ba5c1f52a 100644 --- a/tests/ui/privacy/privacy-ns1.rs +++ b/tests/ui/privacy/privacy-ns1.rs @@ -48,8 +48,8 @@ pub mod foo3 { fn test_glob3() { use foo3::*; - Bar(); //~ ERROR cannot find function, tuple struct or tuple variant `Bar` in this scope - let _x: Box; //~ ERROR cannot find type `Bar` in this scope + Bar(); //~ ERROR cannot find function, tuple struct or tuple variant `Bar` + let _x: Box; //~ ERROR cannot find type `Bar` } fn main() { diff --git a/tests/ui/privacy/restricted/test.rs b/tests/ui/privacy/restricted/test.rs index e1d87cfcd88c8..b459057777177 100644 --- a/tests/ui/privacy/restricted/test.rs +++ b/tests/ui/privacy/restricted/test.rs @@ -47,6 +47,6 @@ fn main() { } mod pathological { - pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing crate `bad`? + pub(in bad::path) mod m1 {} //~ ERROR cannot find item `bad` pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules } diff --git a/tests/ui/privacy/restricted/test.stderr b/tests/ui/privacy/restricted/test.stderr index 76f19525df532..6e8d6a5843b5a 100644 --- a/tests/ui/privacy/restricted/test.stderr +++ b/tests/ui/privacy/restricted/test.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve: maybe a missing crate `bad`? +error[E0433]: cannot find item `bad` in this scope --> $DIR/test.rs:50:12 | LL | pub(in bad::path) mod m1 {} - | ^^^ maybe a missing crate `bad`? + | ^^^ you might be missing a crate named `bad` | = help: consider adding `extern crate bad` to use the `bad` crate diff --git a/tests/ui/privacy/unreachable-issue-121455.rs b/tests/ui/privacy/unreachable-issue-121455.rs index 5da30d6ed6397..05fcacc73d2d0 100644 --- a/tests/ui/privacy/unreachable-issue-121455.rs +++ b/tests/ui/privacy/unreachable-issue-121455.rs @@ -1,5 +1,5 @@ fn test(s: &Self::Id) { -//~^ ERROR failed to resolve: `Self` is only available in impls, traits, and type definitions +//~^ ERROR cannot find item `Self` match &s[0..3] {} } diff --git a/tests/ui/privacy/unreachable-issue-121455.stderr b/tests/ui/privacy/unreachable-issue-121455.stderr index 864e950a98eb2..c371f793bf2b0 100644 --- a/tests/ui/privacy/unreachable-issue-121455.stderr +++ b/tests/ui/privacy/unreachable-issue-121455.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> $DIR/unreachable-issue-121455.rs:1:13 | LL | fn test(s: &Self::Id) { diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs index 3f191cba74583..19fd4cdac9d04 100644 --- a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs +++ b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs @@ -16,5 +16,5 @@ fn bench(b: &mut test::Bencher) {} fn not_main() { Test; Bench; - NonExistent; //~ ERROR cannot find value `NonExistent` in this scope + NonExistent; //~ ERROR cannot find value `NonExistent` } diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs.rs b/tests/ui/proc-macro/ambiguous-builtin-attrs.rs index c82663541a795..2917bff9e2181 100644 --- a/tests/ui/proc-macro/ambiguous-builtin-attrs.rs +++ b/tests/ui/proc-macro/ambiguous-builtin-attrs.rs @@ -31,7 +31,7 @@ fn non_macro_expanded_location<#[repr(C)] T>() { fn main() { Test; Bench; - NonExistent; //~ ERROR cannot find value `NonExistent` in this scope + NonExistent; //~ ERROR cannot find value `NonExistent` } use deny as allow; diff --git a/tests/ui/proc-macro/amputate-span.stderr b/tests/ui/proc-macro/amputate-span.stderr index aa797339be467..d21a6413b87d0 100644 --- a/tests/ui/proc-macro/amputate-span.stderr +++ b/tests/ui/proc-macro/amputate-span.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `Command` +error[E0433]: cannot find item `Command` in this scope --> $DIR/amputate-span.rs:49:5 | LL | Command::new("git"); @@ -9,7 +9,7 @@ help: consider importing this struct LL + use std::process::Command; | -error[E0433]: failed to resolve: use of undeclared type `Command` +error[E0433]: cannot find item `Command` in this scope --> $DIR/amputate-span.rs:63:9 | LL | Command::new("git"); diff --git a/tests/ui/proc-macro/attributes-on-modules-fail.rs b/tests/ui/proc-macro/attributes-on-modules-fail.rs index 9b2eb703eacca..a68a7911f6108 100644 --- a/tests/ui/proc-macro/attributes-on-modules-fail.rs +++ b/tests/ui/proc-macro/attributes-on-modules-fail.rs @@ -7,11 +7,11 @@ extern crate test_macros; mod m { pub struct X; - type A = Y; //~ ERROR cannot find type `Y` in this scope + type A = Y; //~ ERROR cannot find type `Y` } struct Y; -type A = X; //~ ERROR cannot find type `X` in this scope +type A = X; //~ ERROR cannot find type `X` #[derive(Copy)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s mod n {} diff --git a/tests/ui/proc-macro/derive-helper-legacy-limits.rs b/tests/ui/proc-macro/derive-helper-legacy-limits.rs index ff09095a60f9d..ce8bdf8c245db 100644 --- a/tests/ui/proc-macro/derive-helper-legacy-limits.rs +++ b/tests/ui/proc-macro/derive-helper-legacy-limits.rs @@ -14,7 +14,7 @@ use derive as my_derive; struct S1; // Legacy helper detection doesn't see through `derive` renaming. -#[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope +#[empty_helper] //~ ERROR cannot find attribute `empty_helper` #[my_derive(Empty)] struct S2; diff --git a/tests/ui/proc-macro/derive-helper-legacy-limits.stderr b/tests/ui/proc-macro/derive-helper-legacy-limits.stderr index f5cd455435d4a..aaf9ef1d34291 100644 --- a/tests/ui/proc-macro/derive-helper-legacy-limits.stderr +++ b/tests/ui/proc-macro/derive-helper-legacy-limits.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `empty_helper` in this scope +error: cannot find attribute `empty_helper` in the crate root --> $DIR/derive-helper-legacy-limits.rs:17:3 | LL | #[empty_helper] - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ not found in the crate root error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/derive-helper-legacy-spurious.rs b/tests/ui/proc-macro/derive-helper-legacy-spurious.rs index 2b5bb905e8302..1d20ac5004f60 100644 --- a/tests/ui/proc-macro/derive-helper-legacy-spurious.rs +++ b/tests/ui/proc-macro/derive-helper-legacy-spurious.rs @@ -1,12 +1,12 @@ //@ aux-build:test-macros.rs -#![dummy] //~ ERROR cannot find attribute `dummy` in this scope +#![dummy] //~ ERROR cannot find attribute `dummy` #[macro_use] extern crate test_macros; #[derive(Empty)] -#[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope +#[empty_helper] //~ ERROR cannot find attribute `empty_helper` struct Foo {} fn main() {} diff --git a/tests/ui/proc-macro/derive-helper-legacy-spurious.stderr b/tests/ui/proc-macro/derive-helper-legacy-spurious.stderr index b34713b8ca68e..58e47eb8cb170 100644 --- a/tests/ui/proc-macro/derive-helper-legacy-spurious.stderr +++ b/tests/ui/proc-macro/derive-helper-legacy-spurious.stderr @@ -1,14 +1,14 @@ -error: cannot find attribute `dummy` in this scope +error: cannot find attribute `dummy` in the crate root --> $DIR/derive-helper-legacy-spurious.rs:3:4 | LL | #![dummy] - | ^^^^^ + | ^^^^^ not found in the crate root -error: cannot find attribute `empty_helper` in this scope +error: cannot find attribute `empty_helper` in the crate root --> $DIR/derive-helper-legacy-spurious.rs:9:3 | LL | #[empty_helper] - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/proc-macro/derive-helper-shadowing.rs b/tests/ui/proc-macro/derive-helper-shadowing.rs index 1c66a60b294b8..f1b7b13583ecf 100644 --- a/tests/ui/proc-macro/derive-helper-shadowing.rs +++ b/tests/ui/proc-macro/derive-helper-shadowing.rs @@ -11,7 +11,7 @@ use test_macros::empty_attr as empty_helper; macro_rules! gen_helper_use { () => { - #[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope + #[empty_helper] //~ ERROR cannot find attribute `empty_helper` struct W; } } @@ -35,7 +35,7 @@ struct S { gen_helper_use!(); - #[derive(GenHelperUse)] //~ ERROR cannot find attribute `empty_helper` in this scope + #[derive(GenHelperUse)] //~ ERROR cannot find attribute `empty_helper` struct Owo; use empty_helper as renamed; diff --git a/tests/ui/proc-macro/derive-helper-shadowing.stderr b/tests/ui/proc-macro/derive-helper-shadowing.stderr index f284b1c54dd61..a7d5feb95b6f2 100644 --- a/tests/ui/proc-macro/derive-helper-shadowing.stderr +++ b/tests/ui/proc-macro/derive-helper-shadowing.stderr @@ -10,11 +10,11 @@ note: the derive helper attribute imported here LL | use empty_helper as renamed; | ^^^^^^^^^^^^^^^^^^^^^^^ -error: cannot find attribute `empty_helper` in this scope +error: cannot find attribute `empty_helper` in module `inner` --> $DIR/derive-helper-shadowing.rs:38:22 | LL | #[derive(GenHelperUse)] - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ not found in module `inner` | = note: this error originates in the derive macro `GenHelperUse` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this attribute macro through its public re-export @@ -22,11 +22,11 @@ help: consider importing this attribute macro through its public re-export LL + use empty_helper; | -error: cannot find attribute `empty_helper` in this scope +error: cannot find attribute `empty_helper` in module `inner` --> $DIR/derive-helper-shadowing.rs:14:11 | LL | #[empty_helper] - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ not found in module `inner` ... LL | gen_helper_use!(); | ----------------- in this macro invocation diff --git a/tests/ui/proc-macro/derive-still-gated.rs b/tests/ui/proc-macro/derive-still-gated.rs index bce7badeffe1d..b08dd2ef932bc 100644 --- a/tests/ui/proc-macro/derive-still-gated.rs +++ b/tests/ui/proc-macro/derive-still-gated.rs @@ -3,7 +3,7 @@ #[macro_use] extern crate test_macros; -#[derive_Empty] //~ ERROR cannot find attribute `derive_Empty` in this scope +#[derive_Empty] //~ ERROR cannot find attribute `derive_Empty` struct A; fn main() {} diff --git a/tests/ui/proc-macro/derive-still-gated.stderr b/tests/ui/proc-macro/derive-still-gated.stderr index 25777f72b8d11..604cd6e1b1fed 100644 --- a/tests/ui/proc-macro/derive-still-gated.stderr +++ b/tests/ui/proc-macro/derive-still-gated.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `derive_Empty` in this scope +error: cannot find attribute `derive_Empty` in the crate root --> $DIR/derive-still-gated.rs:6:3 | LL | #[derive_Empty] - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ not found in the crate root error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/disappearing-resolution.rs b/tests/ui/proc-macro/disappearing-resolution.rs index b8bc2953576a6..3d700f44175df 100644 --- a/tests/ui/proc-macro/disappearing-resolution.rs +++ b/tests/ui/proc-macro/disappearing-resolution.rs @@ -15,7 +15,7 @@ use m::Empty; //~ ERROR derive macro import `Empty` is private // successfully resolve `Empty` from there, and then resolve `empty_helper` as its helper. // During validation `use m::Empty` introduces a `Res::Err` stub, so `Empty` resolves to it, // and `empty_helper` can no longer be resolved. -#[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope +#[empty_helper] //~ ERROR cannot find attribute `empty_helper` #[derive(Empty)] struct S; diff --git a/tests/ui/proc-macro/disappearing-resolution.stderr b/tests/ui/proc-macro/disappearing-resolution.stderr index e6d0868687e27..c767a9b29fc37 100644 --- a/tests/ui/proc-macro/disappearing-resolution.stderr +++ b/tests/ui/proc-macro/disappearing-resolution.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `empty_helper` in this scope +error: cannot find attribute `empty_helper` in the crate root --> $DIR/disappearing-resolution.rs:18:3 | LL | #[empty_helper] - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ not found in the crate root error[E0603]: derive macro import `Empty` is private --> $DIR/disappearing-resolution.rs:11:8 diff --git a/tests/ui/proc-macro/gen-macro-rules-hygiene.rs b/tests/ui/proc-macro/gen-macro-rules-hygiene.rs index 2bfbf9dcccaaf..8d52f7f3dd9fd 100644 --- a/tests/ui/proc-macro/gen-macro-rules-hygiene.rs +++ b/tests/ui/proc-macro/gen-macro-rules-hygiene.rs @@ -11,13 +11,13 @@ struct ItemUse; gen_macro_rules!(); //~^ ERROR use of undeclared label `'label_use` -//~| ERROR cannot find value `local_use` in this scope +//~| ERROR cannot find value `local_use` fn main() { 'label_use: loop { let local_use = 1; generated!(); ItemDef; // OK - local_def; //~ ERROR cannot find value `local_def` in this scope + local_def; //~ ERROR cannot find value `local_def` } } diff --git a/tests/ui/proc-macro/generate-mod.rs b/tests/ui/proc-macro/generate-mod.rs index ab93666f28af1..b77ea3d8ffe1a 100644 --- a/tests/ui/proc-macro/generate-mod.rs +++ b/tests/ui/proc-macro/generate-mod.rs @@ -6,22 +6,22 @@ extern crate generate_mod; struct FromOutside; -generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope - //~| ERROR cannot find type `Outer` in this scope +generate_mod::check!(); //~ ERROR cannot find type `FromOutside` + //~| ERROR cannot find type `Outer` -#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope - //~| ERROR cannot find type `OuterAttr` in this scope +#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` + //~| ERROR cannot find type `OuterAttr` struct S; -#[derive(generate_mod::CheckDerive)] //~ ERROR cannot find type `FromOutside` in this scope - //~| ERROR cannot find type `OuterDerive` in this scope +#[derive(generate_mod::CheckDerive)] //~ ERROR cannot find type `FromOutside` + //~| ERROR cannot find type `OuterDerive` //~| WARN this was previously accepted //~| WARN this was previously accepted struct Z; fn inner_block() { - #[derive(generate_mod::CheckDerive)] //~ ERROR cannot find type `FromOutside` in this scope - //~| ERROR cannot find type `OuterDerive` in this scope + #[derive(generate_mod::CheckDerive)] //~ ERROR cannot find type `FromOutside` + //~| ERROR cannot find type `OuterDerive` //~| WARN this was previously accepted //~| WARN this was previously accepted struct InnerZ; diff --git a/tests/ui/proc-macro/issue-118455-skip-err-builtin.rs b/tests/ui/proc-macro/issue-118455-skip-err-builtin.rs index baef020612891..75bdc4b111ea7 100644 --- a/tests/ui/proc-macro/issue-118455-skip-err-builtin.rs +++ b/tests/ui/proc-macro/issue-118455-skip-err-builtin.rs @@ -1,5 +1,5 @@ #![some_nonexistent_attribute] -//~^ ERROR cannot find attribute `some_nonexistent_attribute` in this scope +//~^ ERROR cannot find attribute `some_nonexistent_attribute` #[derive(Debug)] pub struct SomeUserCode; diff --git a/tests/ui/proc-macro/issue-118455-skip-err-builtin.stderr b/tests/ui/proc-macro/issue-118455-skip-err-builtin.stderr index fa8af87a3d019..bec20f824d127 100644 --- a/tests/ui/proc-macro/issue-118455-skip-err-builtin.stderr +++ b/tests/ui/proc-macro/issue-118455-skip-err-builtin.stderr @@ -1,8 +1,8 @@ -error: cannot find attribute `some_nonexistent_attribute` in this scope +error: cannot find attribute `some_nonexistent_attribute` in the crate root --> $DIR/issue-118455-skip-err-builtin.rs:1:4 | LL | #![some_nonexistent_attribute] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/issue-83510.rs b/tests/ui/proc-macro/issue-83510.rs index ea8a334f57c55..3e32e7b16bbba 100644 --- a/tests/ui/proc-macro/issue-83510.rs +++ b/tests/ui/proc-macro/issue-83510.rs @@ -3,9 +3,9 @@ extern crate issue_83510; issue_83510::dance_like_you_want_to_ice!(); -//~^ ERROR: cannot find type `Foo` in this scope +//~^ ERROR: cannot find type `Foo` //~| ERROR: expected trait, found struct `Box` -//~| ERROR: cannot find trait `Baz` in this scope +//~| ERROR: cannot find trait `Baz` //~| ERROR: inherent associated types are unstable fn main() {} diff --git a/tests/ui/proc-macro/lints_in_proc_macros.rs b/tests/ui/proc-macro/lints_in_proc_macros.rs index 13ae7239a143d..22ebf4d66c172 100644 --- a/tests/ui/proc-macro/lints_in_proc_macros.rs +++ b/tests/ui/proc-macro/lints_in_proc_macros.rs @@ -7,7 +7,7 @@ use bang_proc_macro2::bang_proc_macro2; fn main() { let foobar = 42; bang_proc_macro2!(); - //~^ ERROR cannot find value `foobar2` in this scope + //~^ ERROR cannot find value `foobar2` //~| HELP a local variable with a similar name exists //~| SUGGESTION foobar println!("{}", x); diff --git a/tests/ui/proc-macro/macro-namespace-reserved-2.rs b/tests/ui/proc-macro/macro-namespace-reserved-2.rs index 79f591d8cb61e..929cb46ae98c9 100644 --- a/tests/ui/proc-macro/macro-namespace-reserved-2.rs +++ b/tests/ui/proc-macro/macro-namespace-reserved-2.rs @@ -25,17 +25,17 @@ fn check_bang1() { my_macro!(); //~ ERROR can't use a procedural macro from the same crate that defines it } fn check_bang2() { - my_macro_attr!(); //~ ERROR cannot find macro `my_macro_attr` in this scope + my_macro_attr!(); //~ ERROR cannot find macro `my_macro_attr` crate::my_macro_attr!(); //~ ERROR can't use a procedural macro from the same crate that defines //~| ERROR expected macro, found attribute macro `crate::my_macro_attr` } fn check_bang3() { - MyTrait!(); //~ ERROR cannot find macro `MyTrait` in this scope + MyTrait!(); //~ ERROR cannot find macro `MyTrait` crate::MyTrait!(); //~ ERROR can't use a procedural macro from the same crate that defines it //~| ERROR expected macro, found derive macro `crate::MyTrait` } -#[my_macro] //~ ERROR cannot find attribute `my_macro` in this scope +#[my_macro] //~ ERROR cannot find attribute `my_macro` #[crate::my_macro] //~ ERROR can't use a procedural macro from the same crate that defines it //~| ERROR expected attribute, found macro `crate::my_macro` fn check_attr1() {} @@ -45,8 +45,8 @@ fn check_attr2() {} //~| ERROR expected attribute, found derive macro `MyTrait` fn check_attr3() {} -#[derive(my_macro)] //~ ERROR cannot find derive macro `my_macro` in this scope - //~| ERROR cannot find derive macro `my_macro` in this scope +#[derive(my_macro)] //~ ERROR cannot find derive macro `my_macro` + //~| ERROR cannot find derive macro `my_macro` #[derive(crate::my_macro)] //~ ERROR can't use a procedural macro from the same crate that defines //~| ERROR expected derive macro, found macro `crate::my_macro` struct CheckDerive1; diff --git a/tests/ui/proc-macro/macro-namespace-reserved-2.stderr b/tests/ui/proc-macro/macro-namespace-reserved-2.stderr index 0471124061ef4..50f7e58ad8dcd 100644 --- a/tests/ui/proc-macro/macro-namespace-reserved-2.stderr +++ b/tests/ui/proc-macro/macro-namespace-reserved-2.stderr @@ -108,7 +108,7 @@ error: cannot find macro `my_macro_attr` in this scope --> $DIR/macro-namespace-reserved-2.rs:28:5 | LL | my_macro_attr!(); - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ not found in this scope | = note: `my_macro_attr` is in scope, but it is an attribute: `#[my_macro_attr]` @@ -116,31 +116,31 @@ error: cannot find macro `MyTrait` in this scope --> $DIR/macro-namespace-reserved-2.rs:33:5 | LL | MyTrait!(); - | ^^^^^^^ + | ^^^^^^^ not found in this scope | = note: `MyTrait` is in scope, but it is a derive macro: `#[derive(MyTrait)]` -error: cannot find attribute `my_macro` in this scope +error: cannot find attribute `my_macro` in the crate root --> $DIR/macro-namespace-reserved-2.rs:38:3 | LL | #[my_macro] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = note: `my_macro` is in scope, but it is a function-like macro -error: cannot find derive macro `my_macro` in this scope +error: cannot find derive macro `my_macro` in the crate root --> $DIR/macro-namespace-reserved-2.rs:48:10 | LL | #[derive(my_macro)] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = note: `my_macro` is in scope, but it is a function-like macro -error: cannot find derive macro `my_macro` in this scope +error: cannot find derive macro `my_macro` in the crate root --> $DIR/macro-namespace-reserved-2.rs:48:10 | LL | #[derive(my_macro)] - | ^^^^^^^^ + | ^^^^^^^^ not found in the crate root | = note: `my_macro` is in scope, but it is a function-like macro = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/proc-macro/mixed-site-span.rs b/tests/ui/proc-macro/mixed-site-span.rs index bab76a8c43319..005c7b31ab705 100644 --- a/tests/ui/proc-macro/mixed-site-span.rs +++ b/tests/ui/proc-macro/mixed-site-span.rs @@ -12,13 +12,13 @@ fn main() { let local_use = 1; proc_macro_rules!(); //~^ ERROR use of undeclared label `'label_use` - //~| ERROR cannot find value `local_use` in this scope + //~| ERROR cannot find value `local_use` ItemDef; // OK - local_def; //~ ERROR cannot find value `local_def` in this scope + local_def; //~ ERROR cannot find value `local_def` } } macro_rules! pass_dollar_crate { - () => (proc_macro_rules!($crate);) //~ ERROR cannot find type `ItemUse` in crate `$crate` + () => (proc_macro_rules!($crate);) //~ ERROR cannot find type `ItemUse` } pass_dollar_crate!(); diff --git a/tests/ui/proc-macro/mixed-site-span.stderr b/tests/ui/proc-macro/mixed-site-span.stderr index 1378608012464..b8c2524cac68a 100644 --- a/tests/ui/proc-macro/mixed-site-span.stderr +++ b/tests/ui/proc-macro/mixed-site-span.stderr @@ -24,7 +24,7 @@ error[E0412]: cannot find type `ItemUse` in crate `$crate` --> $DIR/mixed-site-span.rs:24:1 | LL | pass_dollar_crate!(); - | ^^^^^^^^^^^^^^^^^^^^ not found in `$crate` + | ^^^^^^^^^^^^^^^^^^^^ not found in crate `$crate` | = note: this error originates in the macro `proc_macro_rules` which comes from the expansion of the macro `pass_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/proc-macro/parent-source-spans.rs b/tests/ui/proc-macro/parent-source-spans.rs index 12a1ab1a43d57..84f6c57d4aef7 100644 --- a/tests/ui/proc-macro/parent-source-spans.rs +++ b/tests/ui/proc-macro/parent-source-spans.rs @@ -27,9 +27,9 @@ macro three($($tokens:tt)*) { macro four($($tokens:tt)*) { parent_source_spans!($($tokens)*); - //~^ ERROR cannot find value `ok` in this scope - //~| ERROR cannot find value `ok` in this scope - //~| ERROR cannot find value `ok` in this scope + //~^ ERROR cannot find value `ok` + //~| ERROR cannot find value `ok` + //~| ERROR cannot find value `ok` } fn main() { diff --git a/tests/ui/proc-macro/proc-macro-attributes.rs b/tests/ui/proc-macro/proc-macro-attributes.rs index 6d5e7b67c782e..e7f6e83cd640e 100644 --- a/tests/ui/proc-macro/proc-macro-attributes.rs +++ b/tests/ui/proc-macro/proc-macro-attributes.rs @@ -6,7 +6,7 @@ extern crate derive_b; #[B] //~ ERROR `B` is ambiguous //~| WARN derive helper attribute is used before it is introduced //~| WARN this was previously accepted -#[C] //~ ERROR cannot find attribute `C` in this scope +#[C] //~ ERROR cannot find attribute `C` #[B(D)] //~ ERROR `B` is ambiguous //~| WARN derive helper attribute is used before it is introduced //~| WARN this was previously accepted diff --git a/tests/ui/proc-macro/proc-macro-attributes.stderr b/tests/ui/proc-macro/proc-macro-attributes.stderr index 140d879069040..f7342d6f79315 100644 --- a/tests/ui/proc-macro/proc-macro-attributes.stderr +++ b/tests/ui/proc-macro/proc-macro-attributes.stderr @@ -1,8 +1,11 @@ -error: cannot find attribute `C` in this scope +error: cannot find attribute `C` in the crate root --> $DIR/proc-macro-attributes.rs:9:3 | LL | #[C] - | ^ help: a derive helper attribute with a similar name exists: `B` + | ^ + | | + | not found in the crate root + | help: a derive helper attribute with a similar name exists: `B` error[E0659]: `B` is ambiguous --> $DIR/proc-macro-attributes.rs:6:3 diff --git a/tests/ui/proc-macro/resolve-error.rs b/tests/ui/proc-macro/resolve-error.rs index 2670d8884ae72..f4e9677ccebab 100644 --- a/tests/ui/proc-macro/resolve-error.rs +++ b/tests/ui/proc-macro/resolve-error.rs @@ -25,11 +25,11 @@ macro_rules! attr_proc_mac { struct Foo; // Interpreted as an unstable custom attribute -#[attr_proc_macra] //~ ERROR cannot find attribute `attr_proc_macra` in this scope +#[attr_proc_macra] //~ ERROR cannot find attribute `attr_proc_macra` struct Bar; // Interpreted as an unstable custom attribute -#[FooWithLongNan] //~ ERROR cannot find attribute `FooWithLongNan` in this scope +#[FooWithLongNan] //~ ERROR cannot find attribute `FooWithLongNan` struct Asdf; #[derive(Dlone)] diff --git a/tests/ui/proc-macro/resolve-error.stderr b/tests/ui/proc-macro/resolve-error.stderr index e7639f474c75e..c21a6a98941ea 100644 --- a/tests/ui/proc-macro/resolve-error.stderr +++ b/tests/ui/proc-macro/resolve-error.stderr @@ -2,7 +2,10 @@ error: cannot find macro `bang_proc_macrp` in this scope --> $DIR/resolve-error.rs:60:5 | LL | bang_proc_macrp!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` + | ^^^^^^^^^^^^^^^ + | | + | not found in this scope + | help: a macro with a similar name exists: `bang_proc_macro` | ::: $DIR/auxiliary/test-macros.rs:15:1 | @@ -13,7 +16,7 @@ error: cannot find macro `Dlona` in this scope --> $DIR/resolve-error.rs:57:5 | LL | Dlona!(); - | ^^^^^ + | ^^^^^ not found in this scope error: cannot find macro `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:54:5 @@ -22,7 +25,10 @@ LL | macro_rules! attr_proc_mac { | -------------------------- similarly named macro `attr_proc_mac` defined here ... LL | attr_proc_macra!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac` + | ^^^^^^^^^^^^^^^ + | | + | not found in this scope + | help: a macro with a similar name exists: `attr_proc_mac` error: cannot find macro `FooWithLongNama` in this scope --> $DIR/resolve-error.rs:51:5 @@ -31,38 +37,47 @@ LL | macro_rules! FooWithLongNam { | --------------------------- similarly named macro `FooWithLongNam` defined here ... LL | FooWithLongNama!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam` + | ^^^^^^^^^^^^^^^ + | | + | not found in this scope + | help: a macro with a similar name exists: `FooWithLongNam` -error: cannot find derive macro `attr_proc_macra` in this scope +error: cannot find derive macro `attr_proc_macra` in the crate root --> $DIR/resolve-error.rs:45:10 | LL | #[derive(attr_proc_macra)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ not found in the crate root -error: cannot find derive macro `attr_proc_macra` in this scope +error: cannot find derive macro `attr_proc_macra` in the crate root --> $DIR/resolve-error.rs:45:10 | LL | #[derive(attr_proc_macra)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ not found in the crate root | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: cannot find derive macro `Dlona` in this scope +error: cannot find derive macro `Dlona` in the crate root --> $DIR/resolve-error.rs:40:10 | LL | #[derive(Dlona)] - | ^^^^^ help: a derive macro with a similar name exists: `Clona` + | ^^^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `Clona` | ::: $DIR/auxiliary/derive-clona.rs:11:1 | LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { | ------------------------------------------------------- similarly named derive macro `Clona` defined here -error: cannot find derive macro `Dlona` in this scope +error: cannot find derive macro `Dlona` in the crate root --> $DIR/resolve-error.rs:40:10 | LL | #[derive(Dlona)] - | ^^^^^ help: a derive macro with a similar name exists: `Clona` + | ^^^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `Clona` | ::: $DIR/auxiliary/derive-clona.rs:11:1 | @@ -71,59 +86,74 @@ LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: cannot find derive macro `Dlone` in this scope +error: cannot find derive macro `Dlone` in the crate root --> $DIR/resolve-error.rs:35:10 | LL | #[derive(Dlone)] - | ^^^^^ help: a derive macro with a similar name exists: `Clone` + | ^^^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `Clone` --> $SRC_DIR/core/src/clone.rs:LL:COL | = note: similarly named derive macro `Clone` defined here -error: cannot find derive macro `Dlone` in this scope +error: cannot find derive macro `Dlone` in the crate root --> $DIR/resolve-error.rs:35:10 | LL | #[derive(Dlone)] - | ^^^^^ help: a derive macro with a similar name exists: `Clone` + | ^^^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `Clone` --> $SRC_DIR/core/src/clone.rs:LL:COL | = note: similarly named derive macro `Clone` defined here | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: cannot find attribute `FooWithLongNan` in this scope +error: cannot find attribute `FooWithLongNan` in the crate root --> $DIR/resolve-error.rs:32:3 | LL | #[FooWithLongNan] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ not found in the crate root -error: cannot find attribute `attr_proc_macra` in this scope +error: cannot find attribute `attr_proc_macra` in the crate root --> $DIR/resolve-error.rs:28:3 | LL | #[attr_proc_macra] - | ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro` + | ^^^^^^^^^^^^^^^ + | | + | not found in the crate root + | help: an attribute macro with a similar name exists: `attr_proc_macro` | ::: $DIR/auxiliary/test-macros.rs:20:1 | LL | pub fn empty_attr(_: TokenStream, _: TokenStream) -> TokenStream { | ---------------------------------------------------------------- similarly named attribute macro `attr_proc_macro` defined here -error: cannot find derive macro `FooWithLongNan` in this scope +error: cannot find derive macro `FooWithLongNan` in the crate root --> $DIR/resolve-error.rs:22:10 | LL | #[derive(FooWithLongNan)] - | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` + | ^^^^^^^^^^^^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `FooWithLongName` | ::: $DIR/auxiliary/derive-foo.rs:11:1 | LL | pub fn derive_foo(input: TokenStream) -> TokenStream { | ---------------------------------------------------- similarly named derive macro `FooWithLongName` defined here -error: cannot find derive macro `FooWithLongNan` in this scope +error: cannot find derive macro `FooWithLongNan` in the crate root --> $DIR/resolve-error.rs:22:10 | LL | #[derive(FooWithLongNan)] - | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` + | ^^^^^^^^^^^^^^ + | | + | not found in the crate root + | help: a derive macro with a similar name exists: `FooWithLongName` | ::: $DIR/auxiliary/derive-foo.rs:11:1 | diff --git a/tests/ui/query-system/issue-83479.rs b/tests/ui/query-system/issue-83479.rs index 32676dfe9c8fa..b71c5b11adec1 100644 --- a/tests/ui/query-system/issue-83479.rs +++ b/tests/ui/query-system/issue-83479.rs @@ -2,12 +2,12 @@ type PairCoupledTypes: Trait< //~^ ERROR: bounds on `type`s in this context have no effect - //~| ERROR: cannot find trait `Trait` in this scope + //~| ERROR: cannot find trait `Trait` [u32; { static FOO: usize; //~ ERROR: free static item without body }], > = impl Trait< - //~^ ERROR: cannot find trait `Trait` in this scope + //~^ ERROR: cannot find trait `Trait` [u32; { static FOO: usize; //~ ERROR: free static item without body }], diff --git a/tests/ui/recursion/recursive-reexports.rs b/tests/ui/recursion/recursive-reexports.rs index 26d15fb04734b..ef3992fe25069 100644 --- a/tests/ui/recursion/recursive-reexports.rs +++ b/tests/ui/recursion/recursive-reexports.rs @@ -2,6 +2,6 @@ extern crate recursive_reexports; -fn f() -> recursive_reexports::S {} //~ ERROR cannot find type `S` in crate `recursive_reexports` +fn f() -> recursive_reexports::S {} //~ ERROR cannot find type `S` fn main() {} diff --git a/tests/ui/recursion/recursive-reexports.stderr b/tests/ui/recursion/recursive-reexports.stderr index 71653d26a18d7..cfa245ea69ff7 100644 --- a/tests/ui/recursion/recursive-reexports.stderr +++ b/tests/ui/recursion/recursive-reexports.stderr @@ -2,7 +2,7 @@ error[E0412]: cannot find type `S` in crate `recursive_reexports` --> $DIR/recursive-reexports.rs:5:32 | LL | fn f() -> recursive_reexports::S {} - | ^ not found in `recursive_reexports` + | ^ not found in crate `recursive_reexports` error: aborting due to 1 previous error diff --git a/tests/ui/regions/outlives-with-missing.rs b/tests/ui/regions/outlives-with-missing.rs index 29d89718b5867..0d012fa6019ce 100644 --- a/tests/ui/regions/outlives-with-missing.rs +++ b/tests/ui/regions/outlives-with-missing.rs @@ -8,7 +8,7 @@ impl HandlerWrapper { pub fn set_handler(&self, handler: &H::Target) where T: Send + Sync + 'static, - //~^ ERROR cannot find type `T` in this scope + //~^ ERROR cannot find type `T` { } } diff --git a/tests/ui/reserved/reserved-attr-on-macro.rs b/tests/ui/reserved/reserved-attr-on-macro.rs index 5c4657e0ec2e1..8c0f77176aa6c 100644 --- a/tests/ui/reserved/reserved-attr-on-macro.rs +++ b/tests/ui/reserved/reserved-attr-on-macro.rs @@ -1,5 +1,5 @@ #[rustc_attribute_should_be_reserved] -//~^ ERROR cannot find attribute `rustc_attribute_should_be_reserved` in this scope +//~^ ERROR cannot find attribute `rustc_attribute_should_be_reserved` //~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler macro_rules! foo { diff --git a/tests/ui/reserved/reserved-attr-on-macro.stderr b/tests/ui/reserved/reserved-attr-on-macro.stderr index 066f72367b1a5..8e371c28bee9c 100644 --- a/tests/ui/reserved/reserved-attr-on-macro.stderr +++ b/tests/ui/reserved/reserved-attr-on-macro.stderr @@ -4,11 +4,11 @@ error: attributes starting with `rustc` are reserved for use by the `rustc` comp LL | #[rustc_attribute_should_be_reserved] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: cannot find attribute `rustc_attribute_should_be_reserved` in this scope +error: cannot find attribute `rustc_attribute_should_be_reserved` in the crate root --> $DIR/reserved-attr-on-macro.rs:1:3 | LL | #[rustc_attribute_should_be_reserved] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/112590-2.fixed b/tests/ui/resolve/112590-2.fixed index d88bc4b47e204..f72faeeb51992 100644 --- a/tests/ui/resolve/112590-2.fixed +++ b/tests/ui/resolve/112590-2.fixed @@ -15,7 +15,7 @@ mod u { use foo::bar::baz::MyVec; fn _a() { - let _: Vec = MyVec::new(); //~ ERROR failed to resolve + let _: Vec = MyVec::new(); //~ ERROR cannot find item } } @@ -23,12 +23,12 @@ mod v { use foo::bar::baz::MyVec; fn _b() { - let _: Vec = MyVec::new(); //~ ERROR failed to resolve + let _: Vec = MyVec::new(); //~ ERROR cannot find item } } fn main() { - let _t: Vec = Vec::new(); //~ ERROR failed to resolve - type _B = vec::Vec::; //~ ERROR failed to resolve - let _t = AtomicBool::new(true); //~ ERROR failed to resolve + let _t: Vec = Vec::new(); //~ ERROR cannot find item + type _B = vec::Vec::; //~ ERROR cannot find item + let _t = AtomicBool::new(true); //~ ERROR cannot find item } diff --git a/tests/ui/resolve/112590-2.rs b/tests/ui/resolve/112590-2.rs index d8aaa5a6cc121..532ee55e782c3 100644 --- a/tests/ui/resolve/112590-2.rs +++ b/tests/ui/resolve/112590-2.rs @@ -9,18 +9,18 @@ mod foo { mod u { fn _a() { - let _: Vec = super::foo::baf::baz::MyVec::new(); //~ ERROR failed to resolve + let _: Vec = super::foo::baf::baz::MyVec::new(); //~ ERROR cannot find item } } mod v { fn _b() { - let _: Vec = fox::bar::baz::MyVec::new(); //~ ERROR failed to resolve + let _: Vec = fox::bar::baz::MyVec::new(); //~ ERROR cannot find item } } fn main() { - let _t: Vec = vec::new(); //~ ERROR failed to resolve - type _B = vec::Vec::; //~ ERROR failed to resolve - let _t = std::sync_error::atomic::AtomicBool::new(true); //~ ERROR failed to resolve + let _t: Vec = vec::new(); //~ ERROR cannot find item + type _B = vec::Vec::; //~ ERROR cannot find item + let _t = std::sync_error::atomic::AtomicBool::new(true); //~ ERROR cannot find item } diff --git a/tests/ui/resolve/112590-2.stderr b/tests/ui/resolve/112590-2.stderr index 0db20249d27f5..7492b7bf52723 100644 --- a/tests/ui/resolve/112590-2.stderr +++ b/tests/ui/resolve/112590-2.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `baf` in `foo` +error[E0433]: cannot find item `baf` in module `foo` --> $DIR/112590-2.rs:12:39 | LL | let _: Vec = super::foo::baf::baz::MyVec::new(); @@ -14,7 +14,7 @@ LL - let _: Vec = super::foo::baf::baz::MyVec::new(); LL + let _: Vec = MyVec::new(); | -error[E0433]: failed to resolve: use of undeclared crate or module `fox` +error[E0433]: cannot find item `fox` in this scope --> $DIR/112590-2.rs:18:27 | LL | let _: Vec = fox::bar::baz::MyVec::new(); @@ -30,7 +30,7 @@ LL - let _: Vec = fox::bar::baz::MyVec::new(); LL + let _: Vec = MyVec::new(); | -error[E0433]: failed to resolve: use of undeclared crate or module `vec` +error[E0433]: cannot find item `vec` in this scope --> $DIR/112590-2.rs:24:15 | LL | type _B = vec::Vec::; @@ -41,7 +41,7 @@ help: consider importing this module LL + use std::vec; | -error[E0433]: failed to resolve: could not find `sync_error` in `std` +error[E0433]: cannot find item `sync_error` in crate `std` --> $DIR/112590-2.rs:25:19 | LL | let _t = std::sync_error::atomic::AtomicBool::new(true); @@ -57,7 +57,7 @@ LL - let _t = std::sync_error::atomic::AtomicBool::new(true); LL + let _t = AtomicBool::new(true); | -error[E0433]: failed to resolve: use of undeclared crate or module `vec` +error[E0433]: cannot find item `vec` in this scope --> $DIR/112590-2.rs:23:24 | LL | let _t: Vec = vec::new(); diff --git a/tests/ui/resolve/bad-expr-path.rs b/tests/ui/resolve/bad-expr-path.rs index 31fc9cf2cb575..f4dff83330d94 100644 --- a/tests/ui/resolve/bad-expr-path.rs +++ b/tests/ui/resolve/bad-expr-path.rs @@ -2,7 +2,7 @@ mod m1 {} fn main(arguments: Vec) { //~ ERROR `main` function has wrong type log(debug, m1::arguments); - //~^ ERROR cannot find function `log` in this scope - //~| ERROR cannot find value `debug` in this scope - //~| ERROR cannot find value `arguments` in module `m1` + //~^ ERROR cannot find function `log` + //~| ERROR cannot find value `debug` + //~| ERROR cannot find value `arguments` } diff --git a/tests/ui/resolve/bad-expr-path.stderr b/tests/ui/resolve/bad-expr-path.stderr index 0392c1fa23993..ea13b8a05e61c 100644 --- a/tests/ui/resolve/bad-expr-path.stderr +++ b/tests/ui/resolve/bad-expr-path.stderr @@ -8,7 +8,7 @@ error[E0425]: cannot find value `arguments` in module `m1` --> $DIR/bad-expr-path.rs:4:20 | LL | log(debug, m1::arguments); - | ^^^^^^^^^ not found in `m1` + | ^^^^^^^^^ not found in module `m1` error[E0580]: `main` function has wrong type --> $DIR/bad-expr-path.rs:3:1 diff --git a/tests/ui/resolve/bad-expr-path2.rs b/tests/ui/resolve/bad-expr-path2.rs index eb88edb9071ef..952949fbb43d5 100644 --- a/tests/ui/resolve/bad-expr-path2.rs +++ b/tests/ui/resolve/bad-expr-path2.rs @@ -4,7 +4,7 @@ mod m1 { fn main(arguments: Vec) { //~ ERROR `main` function has wrong type log(debug, m1::arguments); - //~^ ERROR cannot find function `log` in this scope - //~| ERROR cannot find value `debug` in this scope + //~^ ERROR cannot find function `log` + //~| ERROR cannot find value `debug` //~| ERROR expected value, found module `m1::arguments` } diff --git a/tests/ui/resolve/bad-module.rs b/tests/ui/resolve/bad-module.rs index b23e97c2cf6bc..90a4b6531aff0 100644 --- a/tests/ui/resolve/bad-module.rs +++ b/tests/ui/resolve/bad-module.rs @@ -1,7 +1,7 @@ fn main() { let foo = thing::len(Vec::new()); - //~^ ERROR failed to resolve: use of undeclared crate or module `thing` + //~^ ERROR cannot find item `thing` let foo = foo::bar::baz(); - //~^ ERROR failed to resolve: use of undeclared crate or module `foo` + //~^ ERROR cannot find item `foo` } diff --git a/tests/ui/resolve/bad-module.stderr b/tests/ui/resolve/bad-module.stderr index 558760c6793ab..da41a80f79c15 100644 --- a/tests/ui/resolve/bad-module.stderr +++ b/tests/ui/resolve/bad-module.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `foo` +error[E0433]: cannot find item `foo` in this scope --> $DIR/bad-module.rs:5:15 | LL | let foo = foo::bar::baz(); | ^^^ use of undeclared crate or module `foo` -error[E0433]: failed to resolve: use of undeclared crate or module `thing` +error[E0433]: cannot find item `thing` in this scope --> $DIR/bad-module.rs:2:15 | LL | let foo = thing::len(Vec::new()); diff --git a/tests/ui/resolve/crate-called-as-function.rs b/tests/ui/resolve/crate-called-as-function.rs index e8f52c0c029aa..3e70c6029b606 100644 --- a/tests/ui/resolve/crate-called-as-function.rs +++ b/tests/ui/resolve/crate-called-as-function.rs @@ -1,3 +1,3 @@ fn main() { - ::foo() //~ cannot find external crate `foo` in the crate root + ::foo() //~ cannot find external crate `foo` } diff --git a/tests/ui/resolve/crate-in-paths.rs b/tests/ui/resolve/crate-in-paths.rs index fad1add40afa9..6d27f82450699 100644 --- a/tests/ui/resolve/crate-in-paths.rs +++ b/tests/ui/resolve/crate-in-paths.rs @@ -6,5 +6,5 @@ mod bar { fn main() { Foo; - //~^ ERROR cannot find value `Foo` in this scope [E0425] + //~^ ERROR cannot find value `Foo` } diff --git a/tests/ui/resolve/editions-crate-root-2015.rs b/tests/ui/resolve/editions-crate-root-2015.rs index 5f764d3ceef81..0d7e0aa3db8f5 100644 --- a/tests/ui/resolve/editions-crate-root-2015.rs +++ b/tests/ui/resolve/editions-crate-root-2015.rs @@ -2,17 +2,17 @@ mod inner { fn global_inner(_: ::nonexistant::Foo) { - //~^ ERROR failed to resolve: maybe a missing crate `nonexistant`? + //~^ ERROR cannot find item `nonexistant` } fn crate_inner(_: crate::nonexistant::Foo) { - //~^ ERROR failed to resolve: maybe a missing crate `nonexistant`? + //~^ ERROR cannot find item `nonexistant` } fn bare_global(_: ::nonexistant) { - //~^ ERROR cannot find type `nonexistant` in the crate root + //~^ ERROR cannot find type `nonexistant` } fn bare_crate(_: crate::nonexistant) { - //~^ ERROR cannot find type `nonexistant` in the crate root + //~^ ERROR cannot find type `nonexistant` } } diff --git a/tests/ui/resolve/editions-crate-root-2015.stderr b/tests/ui/resolve/editions-crate-root-2015.stderr index 00cdd0c58f4ec..08c6fcfeaba4e 100644 --- a/tests/ui/resolve/editions-crate-root-2015.stderr +++ b/tests/ui/resolve/editions-crate-root-2015.stderr @@ -1,16 +1,16 @@ -error[E0433]: failed to resolve: maybe a missing crate `nonexistant`? +error[E0433]: cannot find item `nonexistant` in the crate root --> $DIR/editions-crate-root-2015.rs:4:26 | LL | fn global_inner(_: ::nonexistant::Foo) { - | ^^^^^^^^^^^ maybe a missing crate `nonexistant`? + | ^^^^^^^^^^^ you might be missing a crate named `nonexistant` | = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate -error[E0433]: failed to resolve: maybe a missing crate `nonexistant`? +error[E0433]: cannot find item `nonexistant` in the crate root --> $DIR/editions-crate-root-2015.rs:7:30 | LL | fn crate_inner(_: crate::nonexistant::Foo) { - | ^^^^^^^^^^^ maybe a missing crate `nonexistant`? + | ^^^^^^^^^^^ you might be missing a crate named `nonexistant` | = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate diff --git a/tests/ui/resolve/editions-crate-root-2018.rs b/tests/ui/resolve/editions-crate-root-2018.rs index 0e964d20f9c0e..4333e718fab00 100644 --- a/tests/ui/resolve/editions-crate-root-2018.rs +++ b/tests/ui/resolve/editions-crate-root-2018.rs @@ -2,17 +2,17 @@ mod inner { fn global_inner(_: ::nonexistant::Foo) { - //~^ ERROR failed to resolve: could not find `nonexistant` in the list of imported crates + //~^ ERROR cannot find item `nonexistant` } fn crate_inner(_: crate::nonexistant::Foo) { - //~^ ERROR failed to resolve: could not find `nonexistant` in the crate root + //~^ ERROR cannot find item `nonexistant` } fn bare_global(_: ::nonexistant) { - //~^ ERROR cannot find crate `nonexistant` in the list of imported crates + //~^ ERROR cannot find crate `nonexistant` } fn bare_crate(_: crate::nonexistant) { - //~^ ERROR cannot find type `nonexistant` in the crate root + //~^ ERROR cannot find type `nonexistant` } } diff --git a/tests/ui/resolve/editions-crate-root-2018.stderr b/tests/ui/resolve/editions-crate-root-2018.stderr index 967a5a2fca155..3c974bb2cb850 100644 --- a/tests/ui/resolve/editions-crate-root-2018.stderr +++ b/tests/ui/resolve/editions-crate-root-2018.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: could not find `nonexistant` in the list of imported crates +error[E0433]: cannot find item `nonexistant` in the list of imported crates --> $DIR/editions-crate-root-2018.rs:4:26 | LL | fn global_inner(_: ::nonexistant::Foo) { | ^^^^^^^^^^^ could not find `nonexistant` in the list of imported crates -error[E0433]: failed to resolve: could not find `nonexistant` in the crate root +error[E0433]: cannot find item `nonexistant` in the crate root --> $DIR/editions-crate-root-2018.rs:7:30 | LL | fn crate_inner(_: crate::nonexistant::Foo) { diff --git a/tests/ui/resolve/enums-are-namespaced-xc.stderr b/tests/ui/resolve/enums-are-namespaced-xc.stderr index 5af6cb04275b8..71978055afa1a 100644 --- a/tests/ui/resolve/enums-are-namespaced-xc.stderr +++ b/tests/ui/resolve/enums-are-namespaced-xc.stderr @@ -2,7 +2,7 @@ error[E0425]: cannot find value `A` in crate `namespaced_enums` --> $DIR/enums-are-namespaced-xc.rs:5:31 | LL | let _ = namespaced_enums::A; - | ^ not found in `namespaced_enums` + | ^ not found in crate `namespaced_enums` | help: consider importing this unit variant | @@ -18,7 +18,7 @@ error[E0425]: cannot find function, tuple struct or tuple variant `B` in crate ` --> $DIR/enums-are-namespaced-xc.rs:7:31 | LL | let _ = namespaced_enums::B(10); - | ^ not found in `namespaced_enums` + | ^ not found in crate `namespaced_enums` | help: consider importing this tuple variant | @@ -34,7 +34,7 @@ error[E0422]: cannot find struct, variant or union type `C` in crate `namespaced --> $DIR/enums-are-namespaced-xc.rs:9:31 | LL | let _ = namespaced_enums::C { a: 10 }; - | ^ not found in `namespaced_enums` + | ^ not found in crate `namespaced_enums` | help: consider importing this variant | diff --git a/tests/ui/resolve/enums-pats-not-idents.rs b/tests/ui/resolve/enums-pats-not-idents.rs index 5b918eef6d65b..64e63309146f0 100644 --- a/tests/ui/resolve/enums-pats-not-idents.rs +++ b/tests/ui/resolve/enums-pats-not-idents.rs @@ -1,3 +1,3 @@ fn main() { - let a(1) = 13; //~ ERROR cannot find tuple struct or tuple variant `a` in this scope + let a(1) = 13; //~ ERROR cannot find tuple struct or tuple variant `a` } diff --git a/tests/ui/resolve/export-fully-qualified-2018.rs b/tests/ui/resolve/export-fully-qualified-2018.rs index 26e3044d8df0e..1c0e2aa1f6b68 100644 --- a/tests/ui/resolve/export-fully-qualified-2018.rs +++ b/tests/ui/resolve/export-fully-qualified-2018.rs @@ -5,7 +5,7 @@ // want to change eventually. mod foo { - pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo` + pub fn bar() { foo::baz(); } //~ ERROR cannot find item `foo` fn baz() { } } diff --git a/tests/ui/resolve/export-fully-qualified-2018.stderr b/tests/ui/resolve/export-fully-qualified-2018.stderr index 378d9832a657a..2713c5ef4f102 100644 --- a/tests/ui/resolve/export-fully-qualified-2018.stderr +++ b/tests/ui/resolve/export-fully-qualified-2018.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `foo` +error[E0433]: cannot find item `foo` in this scope --> $DIR/export-fully-qualified-2018.rs:8:20 | LL | pub fn bar() { foo::baz(); } diff --git a/tests/ui/resolve/export-fully-qualified.rs b/tests/ui/resolve/export-fully-qualified.rs index 6de33b7e1915f..85f773644f071 100644 --- a/tests/ui/resolve/export-fully-qualified.rs +++ b/tests/ui/resolve/export-fully-qualified.rs @@ -5,7 +5,7 @@ // want to change eventually. mod foo { - pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo` + pub fn bar() { foo::baz(); } //~ ERROR cannot find item `foo` fn baz() { } } diff --git a/tests/ui/resolve/export-fully-qualified.stderr b/tests/ui/resolve/export-fully-qualified.stderr index 869149d8d3c65..1c14514328364 100644 --- a/tests/ui/resolve/export-fully-qualified.stderr +++ b/tests/ui/resolve/export-fully-qualified.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `foo` +error[E0433]: cannot find item `foo` in this scope --> $DIR/export-fully-qualified.rs:8:20 | LL | pub fn bar() { foo::baz(); } diff --git a/tests/ui/resolve/extern-prelude-fail.rs b/tests/ui/resolve/extern-prelude-fail.rs index c0716f1ebf566..8fcf7f2262435 100644 --- a/tests/ui/resolve/extern-prelude-fail.rs +++ b/tests/ui/resolve/extern-prelude-fail.rs @@ -5,5 +5,5 @@ fn main() { use extern_prelude::S; //~ ERROR unresolved import `extern_prelude` - let s = ::extern_prelude::S; //~ ERROR failed to resolve + let s = ::extern_prelude::S; //~ ERROR cannot find item `extern_prelude` } diff --git a/tests/ui/resolve/extern-prelude-fail.stderr b/tests/ui/resolve/extern-prelude-fail.stderr index a1591914b4d29..030c4834dc7b8 100644 --- a/tests/ui/resolve/extern-prelude-fail.stderr +++ b/tests/ui/resolve/extern-prelude-fail.stderr @@ -2,15 +2,15 @@ error[E0432]: unresolved import `extern_prelude` --> $DIR/extern-prelude-fail.rs:7:9 | LL | use extern_prelude::S; - | ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`? + | ^^^^^^^^^^^^^^ you might be missing a crate named `extern_prelude` | = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate -error[E0433]: failed to resolve: maybe a missing crate `extern_prelude`? +error[E0433]: cannot find item `extern_prelude` in the crate root --> $DIR/extern-prelude-fail.rs:8:15 | LL | let s = ::extern_prelude::S; - | ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`? + | ^^^^^^^^^^^^^^ you might be missing a crate named `extern_prelude` | = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate diff --git a/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs b/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs index b5f13959081b8..1f074aec25bc6 100644 --- a/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs +++ b/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs @@ -8,11 +8,11 @@ impl Foo { } fn new() -> Foo { - field; //~ ERROR cannot find value `field` in this scope - Foo { field } //~ ERROR cannot find value `field` in this scope + field; //~ ERROR cannot find value `field` + Foo { field } //~ ERROR cannot find value `field` } fn clone(&self) -> Foo { - Foo { field } //~ ERROR cannot find value `field` in this scope + Foo { field } //~ ERROR cannot find value `field` } } fn main() {} diff --git a/tests/ui/resolve/impl-items-vis-unresolved.rs b/tests/ui/resolve/impl-items-vis-unresolved.rs index 1494c1cf96800..5c0c151c57cef 100644 --- a/tests/ui/resolve/impl-items-vis-unresolved.rs +++ b/tests/ui/resolve/impl-items-vis-unresolved.rs @@ -19,7 +19,7 @@ pub struct RawFloatState; impl RawFloatState { perftools_inline! { pub(super) fn new() {} - //~^ ERROR failed to resolve: there are too many leading `super` keywords + //~^ ERROR cannot find module `super` } } diff --git a/tests/ui/resolve/impl-items-vis-unresolved.stderr b/tests/ui/resolve/impl-items-vis-unresolved.stderr index cccffdcbf541b..af0b7e6f50bab 100644 --- a/tests/ui/resolve/impl-items-vis-unresolved.stderr +++ b/tests/ui/resolve/impl-items-vis-unresolved.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords +error[E0433]: cannot find module `super` in this scope --> $DIR/impl-items-vis-unresolved.rs:21:13 | LL | pub(super) fn new() {} - | ^^^^^ there are too many leading `super` keywords + | ^^^^^ can't use `super` on the crate root, there are no further modules to go "up" to error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-101749-2.rs b/tests/ui/resolve/issue-101749-2.rs index 4d3d469447c2b..9afcc4deef2fc 100644 --- a/tests/ui/resolve/issue-101749-2.rs +++ b/tests/ui/resolve/issue-101749-2.rs @@ -12,5 +12,5 @@ fn main() { let rect = Rectangle::new(3, 4); // `area` is not implemented for `Rectangle`, so this should not suggest let _ = rect::area(); - //~^ ERROR failed to resolve: use of undeclared crate or module `rect` + //~^ ERROR cannot find item `rect` } diff --git a/tests/ui/resolve/issue-101749-2.stderr b/tests/ui/resolve/issue-101749-2.stderr index 300aaf26cb7d8..14e35593781a4 100644 --- a/tests/ui/resolve/issue-101749-2.stderr +++ b/tests/ui/resolve/issue-101749-2.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `rect` +error[E0433]: cannot find item `rect` in this scope --> $DIR/issue-101749-2.rs:14:13 | LL | let _ = rect::area(); diff --git a/tests/ui/resolve/issue-101749.fixed b/tests/ui/resolve/issue-101749.fixed index 97815793d298e..4a532d7a0a44b 100644 --- a/tests/ui/resolve/issue-101749.fixed +++ b/tests/ui/resolve/issue-101749.fixed @@ -15,5 +15,5 @@ impl Rectangle { fn main() { let rect = Rectangle::new(3, 4); let _ = rect.area(); - //~^ ERROR failed to resolve: use of undeclared crate or module `rect` + //~^ ERROR cannot find item `rect` } diff --git a/tests/ui/resolve/issue-101749.rs b/tests/ui/resolve/issue-101749.rs index 994fc86778e08..13c122f721e85 100644 --- a/tests/ui/resolve/issue-101749.rs +++ b/tests/ui/resolve/issue-101749.rs @@ -15,5 +15,5 @@ impl Rectangle { fn main() { let rect = Rectangle::new(3, 4); let _ = rect::area(); - //~^ ERROR failed to resolve: use of undeclared crate or module `rect` + //~^ ERROR cannot find item `rect` } diff --git a/tests/ui/resolve/issue-101749.stderr b/tests/ui/resolve/issue-101749.stderr index 05515b1b46052..d64eb03376e92 100644 --- a/tests/ui/resolve/issue-101749.stderr +++ b/tests/ui/resolve/issue-101749.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `rect` +error[E0433]: cannot find item `rect` in this scope --> $DIR/issue-101749.rs:17:13 | LL | let _ = rect::area(); diff --git a/tests/ui/resolve/issue-102946.rs b/tests/ui/resolve/issue-102946.rs index c6feca6f32f60..01d044b3f1a7e 100644 --- a/tests/ui/resolve/issue-102946.rs +++ b/tests/ui/resolve/issue-102946.rs @@ -1,5 +1,5 @@ impl Error for str::Utf8Error { - //~^ ERROR cannot find trait `Error` in this scope + //~^ ERROR cannot find trait `Error` //~| ERROR ambiguous associated type fn description(&self) {} } diff --git a/tests/ui/resolve/issue-103474.rs b/tests/ui/resolve/issue-103474.rs index 14f2259e1d4e8..ae13e2cedd549 100644 --- a/tests/ui/resolve/issue-103474.rs +++ b/tests/ui/resolve/issue-103474.rs @@ -4,12 +4,12 @@ impl S { fn second(&self) { first() - //~^ ERROR cannot find function `first` in this scope + //~^ ERROR cannot find function `first` } fn third(&self) { no_method_err() - //~^ ERROR cannot find function `no_method_err` in this scope + //~^ ERROR cannot find function `no_method_err` } } @@ -21,7 +21,7 @@ struct Foo { impl Foo { fn needs_self() { this.i - //~^ ERROR cannot find value `this` in this scope + //~^ ERROR cannot find value `this` } } diff --git a/tests/ui/resolve/issue-109250.rs b/tests/ui/resolve/issue-109250.rs index 68e33f693cef1..736ad81e3174d 100644 --- a/tests/ui/resolve/issue-109250.rs +++ b/tests/ui/resolve/issue-109250.rs @@ -1,3 +1,3 @@ fn main() { //~ HELP consider importing - HashMap::new; //~ ERROR failed to resolve: use of undeclared type `HashMap` + HashMap::new; //~ ERROR cannot find item `HashMap` } diff --git a/tests/ui/resolve/issue-109250.stderr b/tests/ui/resolve/issue-109250.stderr index ad6cc6986229a..4692e8f43f9a3 100644 --- a/tests/ui/resolve/issue-109250.stderr +++ b/tests/ui/resolve/issue-109250.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `HashMap` +error[E0433]: cannot find item `HashMap` in this scope --> $DIR/issue-109250.rs:2:5 | LL | HashMap::new; diff --git a/tests/ui/resolve/issue-116164.rs b/tests/ui/resolve/issue-116164.rs index d30c8f514b3d6..66bf5a984f857 100644 --- a/tests/ui/resolve/issue-116164.rs +++ b/tests/ui/resolve/issue-116164.rs @@ -15,5 +15,5 @@ use crate::reexports::*; fn main() { ExOne; - //~^ ERROR: cannot find value `ExOne` in this scope + //~^ ERROR: cannot find value `ExOne` } diff --git a/tests/ui/resolve/issue-117920.rs b/tests/ui/resolve/issue-117920.rs index 928f194c59c3f..25a57ae3b9047 100644 --- a/tests/ui/resolve/issue-117920.rs +++ b/tests/ui/resolve/issue-117920.rs @@ -1,6 +1,6 @@ #![crate_type = "lib"] -use super::A; //~ ERROR failed to resolve +use super::A; //~ ERROR cannot find mod b { pub trait A {} diff --git a/tests/ui/resolve/issue-117920.stderr b/tests/ui/resolve/issue-117920.stderr index c4528d467e9f5..53b45c981f7e9 100644 --- a/tests/ui/resolve/issue-117920.stderr +++ b/tests/ui/resolve/issue-117920.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords +error[E0433]: cannot find module `super` in this scope --> $DIR/issue-117920.rs:3:5 | LL | use super::A; - | ^^^^^ there are too many leading `super` keywords + | ^^^^^ can't use `super` on the crate root, there are no further modules to go "up" to error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-118295.rs b/tests/ui/resolve/issue-118295.rs index b97681d956341..892e061d207d9 100644 --- a/tests/ui/resolve/issue-118295.rs +++ b/tests/ui/resolve/issue-118295.rs @@ -1,5 +1,6 @@ macro_rules! {} -//~^ ERROR cannot find macro `macro_rules` in this scope +//~^ ERROR cannot find macro `macro_rules` +//~| NOTE not found in //~| NOTE maybe you have forgotten to define a name for this `macro_rules!` fn main() {} diff --git a/tests/ui/resolve/issue-118295.stderr b/tests/ui/resolve/issue-118295.stderr index d60d7d9185db4..edee27c77f19d 100644 --- a/tests/ui/resolve/issue-118295.stderr +++ b/tests/ui/resolve/issue-118295.stderr @@ -1,8 +1,8 @@ -error: cannot find macro `macro_rules` in this scope +error: cannot find macro `macro_rules` in the crate root --> $DIR/issue-118295.rs:1:1 | LL | macro_rules! {} - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ not found in the crate root | note: maybe you have forgotten to define a name for this `macro_rules!` --> $DIR/issue-118295.rs:1:1 diff --git a/tests/ui/resolve/issue-2356.rs b/tests/ui/resolve/issue-2356.rs index fe9bf4d443e72..f7b2dd13dcb64 100644 --- a/tests/ui/resolve/issue-2356.rs +++ b/tests/ui/resolve/issue-2356.rs @@ -29,7 +29,7 @@ impl Clone for Cat { impl Default for Cat { fn default() -> Self { default(); - //~^ ERROR cannot find function `default` in this scope [E0425] + //~^ ERROR cannot find function `default` loop {} } } diff --git a/tests/ui/resolve/issue-24968.rs b/tests/ui/resolve/issue-24968.rs index 19e16abcee3cb..63e3d19a25ff6 100644 --- a/tests/ui/resolve/issue-24968.rs +++ b/tests/ui/resolve/issue-24968.rs @@ -19,12 +19,12 @@ const FOO: Self = 0; //~^ ERROR cannot find type `Self` const FOO2: u32 = Self::bar(); -//~^ ERROR failed to resolve: `Self` +//~^ ERROR cannot find item `Self` static FOO_S: Self = 0; //~^ ERROR cannot find type `Self` static FOO_S2: u32 = Self::bar(); -//~^ ERROR failed to resolve: `Self` +//~^ ERROR cannot find item `Self` fn main() {} diff --git a/tests/ui/resolve/issue-24968.stderr b/tests/ui/resolve/issue-24968.stderr index 82f5a1d5b57b3..75c4059d7c267 100644 --- a/tests/ui/resolve/issue-24968.stderr +++ b/tests/ui/resolve/issue-24968.stderr @@ -39,13 +39,13 @@ LL | static FOO_S: Self = 0; | | | `Self` not allowed in a static item -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> $DIR/issue-24968.rs:21:19 | LL | const FOO2: u32 = Self::bar(); | ^^^^ `Self` is only available in impls, traits, and type definitions -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> $DIR/issue-24968.rs:27:22 | LL | static FOO_S2: u32 = Self::bar(); diff --git a/tests/ui/resolve/issue-26545.rs b/tests/ui/resolve/issue-26545.rs index 5652ee7470605..72a171475066c 100644 --- a/tests/ui/resolve/issue-26545.rs +++ b/tests/ui/resolve/issue-26545.rs @@ -5,7 +5,7 @@ mod foo { mod baz { fn foo() { B(()); - //~^ ERROR cannot find function, tuple struct or tuple variant `B` in this scope [E0425] + //~^ ERROR cannot find function, tuple struct or tuple variant `B` } } diff --git a/tests/ui/resolve/issue-31845.rs b/tests/ui/resolve/issue-31845.rs index f6dc11502ba18..33c1711375cf2 100644 --- a/tests/ui/resolve/issue-31845.rs +++ b/tests/ui/resolve/issue-31845.rs @@ -4,7 +4,7 @@ fn f() { fn g() {} mod foo { fn h() { - g(); //~ ERROR cannot find function `g` in this scope + g(); //~ ERROR cannot find function `g` } } } diff --git a/tests/ui/resolve/issue-35675.rs b/tests/ui/resolve/issue-35675.rs index 683761667d40a..682089a21a1fb 100644 --- a/tests/ui/resolve/issue-35675.rs +++ b/tests/ui/resolve/issue-35675.rs @@ -5,15 +5,15 @@ enum Fruit { } fn should_return_fruit() -> Apple { - //~^ ERROR cannot find type `Apple` in this scope + //~^ ERROR cannot find type `Apple` Apple(5) - //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` in this scope + //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` } fn should_return_fruit_too() -> Fruit::Apple { //~^ ERROR expected type, found variant `Fruit::Apple` Apple(5) - //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` in this scope + //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` } fn foo() -> Ok { @@ -22,7 +22,7 @@ fn foo() -> Ok { } fn bar() -> Variant3 { - //~^ ERROR cannot find type `Variant3` in this scope + //~^ ERROR cannot find type `Variant3` } fn qux() -> Some { diff --git a/tests/ui/resolve/issue-42944.rs b/tests/ui/resolve/issue-42944.rs index 7e439c10b7b84..d5bd7bba95a36 100644 --- a/tests/ui/resolve/issue-42944.rs +++ b/tests/ui/resolve/issue-42944.rs @@ -14,7 +14,7 @@ mod bar { mod baz { fn foo() { Bx(()); - //~^ ERROR cannot find function, tuple struct or tuple variant `Bx` in this scope [E0425] + //~^ ERROR cannot find function, tuple struct or tuple variant `Bx` } } diff --git a/tests/ui/resolve/issue-49074.rs b/tests/ui/resolve/issue-49074.rs index 752bb345b703e..7b3842ef5e92d 100644 --- a/tests/ui/resolve/issue-49074.rs +++ b/tests/ui/resolve/issue-49074.rs @@ -1,7 +1,7 @@ // Check that unknown attribute error is shown even if there are unresolved macros. #[marco_use] // typo -//~^ ERROR cannot find attribute `marco_use` in this scope +//~^ ERROR cannot find attribute `marco_use` mod foo { macro_rules! bar { () => (); @@ -9,5 +9,5 @@ mod foo { } fn main() { - bar!(); //~ ERROR cannot find macro `bar` in this scope + bar!(); //~ ERROR cannot find macro `bar` } diff --git a/tests/ui/resolve/issue-49074.stderr b/tests/ui/resolve/issue-49074.stderr index bbfeb4ea9483a..c8154b4844544 100644 --- a/tests/ui/resolve/issue-49074.stderr +++ b/tests/ui/resolve/issue-49074.stderr @@ -2,15 +2,18 @@ error: cannot find macro `bar` in this scope --> $DIR/issue-49074.rs:12:4 | LL | bar!(); - | ^^^ + | ^^^ not found in this scope | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find attribute `marco_use` in this scope +error: cannot find attribute `marco_use` in the crate root --> $DIR/issue-49074.rs:3:3 | LL | #[marco_use] // typo - | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_use` + | ^^^^^^^^^ + | | + | not found in the crate root + | help: a built-in attribute with a similar name exists: `macro_use` error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/issue-50599.stderr b/tests/ui/resolve/issue-50599.stderr index 24fb3d580b8fa..250db65ab08d7 100644 --- a/tests/ui/resolve/issue-50599.stderr +++ b/tests/ui/resolve/issue-50599.stderr @@ -2,7 +2,7 @@ error[E0425]: cannot find value `LOG10_2` in module `std::f64` --> $DIR/issue-50599.rs:3:48 | LL | const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize; - | ^^^^^^^ not found in `std::f64` + | ^^^^^^^ not found in module `std::f64` | help: consider importing one of these constants | diff --git a/tests/ui/resolve/issue-5099.rs b/tests/ui/resolve/issue-5099.rs index b5abccb4b19f9..a8e7d05550bc9 100644 --- a/tests/ui/resolve/issue-5099.rs +++ b/tests/ui/resolve/issue-5099.rs @@ -1,12 +1,12 @@ trait B { fn a() -> A { - this.a //~ ERROR cannot find value `this` in this scope + this.a //~ ERROR cannot find value `this` } fn b(x: i32) { - this.b(x); //~ ERROR cannot find value `this` in this scope + this.b(x); //~ ERROR cannot find value `this` } fn c() { - let _ = || this.a; //~ ERROR cannot find value `this` in this scope + let _ = || this.a; //~ ERROR cannot find value `this` } } diff --git a/tests/ui/resolve/issue-5927.rs b/tests/ui/resolve/issue-5927.rs index 14f95827be8ea..a483705fe72c8 100644 --- a/tests/ui/resolve/issue-5927.rs +++ b/tests/ui/resolve/issue-5927.rs @@ -1,7 +1,7 @@ fn main() { let z = match 3 { - x(1) => x(1) //~ ERROR cannot find tuple struct or tuple variant `x` in this scope - //~^ ERROR cannot find function `x` in this scope + x(1) => x(1) //~ ERROR cannot find tuple struct or tuple variant `x` + //~^ ERROR cannot find function `x` }; assert!(z == 3); } diff --git a/tests/ui/resolve/issue-60057.rs b/tests/ui/resolve/issue-60057.rs index b52343adaee71..be01c2c91d629 100644 --- a/tests/ui/resolve/issue-60057.rs +++ b/tests/ui/resolve/issue-60057.rs @@ -5,13 +5,13 @@ struct A { impl A { fn new(peach: u8) -> A { A { - banana: banana //~ ERROR cannot find value `banana` in this scope + banana: banana //~ ERROR cannot find value `banana` } } fn foo(&self, peach: u8) -> A { A { - banana: banana //~ ERROR cannot find value `banana` in this scope + banana: banana //~ ERROR cannot find value `banana` } } } diff --git a/tests/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs b/tests/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs index c377ecea94d0c..0fb2fdb76768e 100644 --- a/tests/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs +++ b/tests/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs @@ -2,5 +2,5 @@ fn main() {} trait Foo { fn fn_with_type_named_same_as_local_in_param(b: b); - //~^ ERROR cannot find type `b` in this scope [E0412] + //~^ ERROR cannot find type `b` } diff --git a/tests/ui/resolve/issue-80079.rs b/tests/ui/resolve/issue-80079.rs index 4dc61c320adce..2c6e431769a5a 100644 --- a/tests/ui/resolve/issue-80079.rs +++ b/tests/ui/resolve/issue-80079.rs @@ -8,5 +8,5 @@ extern crate issue_80079; use issue_80079::public; fn main() { - let _ = Foo; //~ ERROR cannot find value `Foo` in this scope + let _ = Foo; //~ ERROR cannot find value `Foo` } diff --git a/tests/ui/resolve/issue-81508.rs b/tests/ui/resolve/issue-81508.rs index 23605cd2fd91d..c0cbb966fb96e 100644 --- a/tests/ui/resolve/issue-81508.rs +++ b/tests/ui/resolve/issue-81508.rs @@ -8,7 +8,7 @@ fn main() { let Baz: &str = ""; - println!("{}", Baz::Bar); //~ ERROR: failed to resolve: use of undeclared type `Baz` + println!("{}", Baz::Bar); //~ ERROR: cannot find item `Baz` } #[allow(non_upper_case_globals)] @@ -17,6 +17,6 @@ pub const Foo: &str = ""; mod submod { use super::Foo; fn function() { - println!("{}", Foo::Bar); //~ ERROR: failed to resolve: use of undeclared type `Foo` + println!("{}", Foo::Bar); //~ ERROR: cannot find item `Foo` } } diff --git a/tests/ui/resolve/issue-81508.stderr b/tests/ui/resolve/issue-81508.stderr index 7258174ba89b3..0e06ab5dd7bd6 100644 --- a/tests/ui/resolve/issue-81508.stderr +++ b/tests/ui/resolve/issue-81508.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `Baz` +error[E0433]: cannot find item `Baz` in this scope --> $DIR/issue-81508.rs:11:20 | LL | let Baz: &str = ""; @@ -7,7 +7,7 @@ LL | LL | println!("{}", Baz::Bar); | ^^^ use of undeclared type `Baz` -error[E0433]: failed to resolve: use of undeclared type `Foo` +error[E0433]: cannot find item `Foo` in this scope --> $DIR/issue-81508.rs:20:24 | LL | use super::Foo; diff --git a/tests/ui/resolve/issue-82156.rs b/tests/ui/resolve/issue-82156.rs index 6215259e48657..f1c6fffff11ef 100644 --- a/tests/ui/resolve/issue-82156.rs +++ b/tests/ui/resolve/issue-82156.rs @@ -1,3 +1,3 @@ fn main() { - super(); //~ ERROR failed to resolve: there are too many leading `super` keywords + super(); //~ ERROR cannot find item `super` } diff --git a/tests/ui/resolve/issue-82156.stderr b/tests/ui/resolve/issue-82156.stderr index 3894b9573a45c..3649c775d8553 100644 --- a/tests/ui/resolve/issue-82156.stderr +++ b/tests/ui/resolve/issue-82156.stderr @@ -1,8 +1,13 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords +error[E0433]: cannot find item `super` in this scope --> $DIR/issue-82156.rs:2:5 | LL | super(); - | ^^^^^ there are too many leading `super` keywords + | ^^^^^ can't use `super` as an identifier + | +help: if you still want to call your identifier `super`, use the raw identifier format + | +LL | r#super(); + | ++ error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-82865.rs b/tests/ui/resolve/issue-82865.rs index 07d88c413bfa8..6a358ea60864c 100644 --- a/tests/ui/resolve/issue-82865.rs +++ b/tests/ui/resolve/issue-82865.rs @@ -2,7 +2,7 @@ #![feature(decl_macro)] -use x::y::z; //~ ERROR: failed to resolve: maybe a missing crate `x`? +use x::y::z; //~ ERROR: cannot find item `x` macro mac () { Box::z //~ ERROR: no function or associated item diff --git a/tests/ui/resolve/issue-82865.stderr b/tests/ui/resolve/issue-82865.stderr index 730fd6d602645..667d7bcc4b9c6 100644 --- a/tests/ui/resolve/issue-82865.stderr +++ b/tests/ui/resolve/issue-82865.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve: maybe a missing crate `x`? +error[E0433]: cannot find item `x` in the crate root --> $DIR/issue-82865.rs:5:5 | LL | use x::y::z; - | ^ maybe a missing crate `x`? + | ^ you might be missing a crate named `x` | = help: consider adding `extern crate x` to use the `x` crate diff --git a/tests/ui/resolve/issue-85348.rs b/tests/ui/resolve/issue-85348.rs index 3a33c19340841..4639c41f0dfe2 100644 --- a/tests/ui/resolve/issue-85348.rs +++ b/tests/ui/resolve/issue-85348.rs @@ -1,7 +1,7 @@ // Checks whether shadowing a const parameter leads to an ICE (#85348). impl ArrayWindowsExample { -//~^ ERROR: cannot find type `ArrayWindowsExample` in this scope [E0412] +//~^ ERROR: cannot find type `ArrayWindowsExample` fn next() { let mut N; //~^ ERROR: let bindings cannot shadow const parameters [E0530] diff --git a/tests/ui/resolve/issue-88472.rs b/tests/ui/resolve/issue-88472.rs index 6bf7caeddbfcd..6b62f413bc49b 100644 --- a/tests/ui/resolve/issue-88472.rs +++ b/tests/ui/resolve/issue-88472.rs @@ -14,8 +14,8 @@ mod b { use crate::a::*; //~^ WARNING: unused import type Bar = Foo; - //~^ ERROR: cannot find type `Foo` in this scope [E0412] - //~| NOTE: not found in this scope + //~^ ERROR: cannot find type `Foo` + //~| NOTE: not found } mod c { @@ -31,8 +31,8 @@ mod c { mod e { type Baz = Eee; - //~^ ERROR: cannot find type `Eee` in this scope [E0412] - //~| NOTE: not found in this scope + //~^ ERROR: cannot find type `Eee` + //~| NOTE: not found } fn main() {} diff --git a/tests/ui/resolve/issue-90113.rs b/tests/ui/resolve/issue-90113.rs index f6658b45ed1a6..1418a831880f4 100644 --- a/tests/ui/resolve/issue-90113.rs +++ b/tests/ui/resolve/issue-90113.rs @@ -14,7 +14,7 @@ mod alias { fn foo(l: crate::alias::Foo) { match l { - Cons(..) => {} //~ ERROR: cannot find tuple struct or tuple variant `Cons` in this scope + Cons(..) => {} //~ ERROR: cannot find tuple struct or tuple variant `Cons` } } diff --git a/tests/ui/resolve/missing-in-namespace.rs b/tests/ui/resolve/missing-in-namespace.rs index e1dedb072b77b..e884ec82dae33 100644 --- a/tests/ui/resolve/missing-in-namespace.rs +++ b/tests/ui/resolve/missing-in-namespace.rs @@ -1,4 +1,4 @@ fn main() { let _map = std::hahmap::HashMap::new(); - //~^ ERROR failed to resolve: could not find `hahmap` in `std + //~^ ERROR cannot find item `hahmap` } diff --git a/tests/ui/resolve/missing-in-namespace.stderr b/tests/ui/resolve/missing-in-namespace.stderr index 35585e4240a2b..d53c191f70c88 100644 --- a/tests/ui/resolve/missing-in-namespace.stderr +++ b/tests/ui/resolve/missing-in-namespace.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `hahmap` in `std` +error[E0433]: cannot find item `hahmap` in crate `std` --> $DIR/missing-in-namespace.rs:2:21 | LL | let _map = std::hahmap::HashMap::new(); diff --git a/tests/ui/resolve/no-implicit-prelude-nested.rs b/tests/ui/resolve/no-implicit-prelude-nested.rs index c314967da4fb7..06497d4be963e 100644 --- a/tests/ui/resolve/no-implicit-prelude-nested.rs +++ b/tests/ui/resolve/no-implicit-prelude-nested.rs @@ -8,26 +8,26 @@ mod foo { mod baz { struct Test; - impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope + impl Add for Test {} //~ ERROR cannot find trait `Add` impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` - impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope - impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope - impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope + impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` + impl ToString for Test {} //~ ERROR cannot find trait `ToString` + impl Writer for Test {} //~ ERROR cannot find trait `Writer` fn foo() { - drop(2) //~ ERROR cannot find function `drop` in this scope + drop(2) //~ ERROR cannot find function `drop` } } struct Test; - impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope + impl Add for Test {} //~ ERROR cannot find trait `Add` impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` - impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope - impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope - impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope + impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` + impl ToString for Test {} //~ ERROR cannot find trait `ToString` + impl Writer for Test {} //~ ERROR cannot find trait `Writer` fn foo() { - drop(2) //~ ERROR cannot find function `drop` in this scope + drop(2) //~ ERROR cannot find function `drop` } } @@ -35,14 +35,14 @@ fn qux() { #[no_implicit_prelude] mod qux_inner { struct Test; - impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope + impl Add for Test {} //~ ERROR cannot find trait `Add` impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` - impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope - impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope - impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope + impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` + impl ToString for Test {} //~ ERROR cannot find trait `ToString` + impl Writer for Test {} //~ ERROR cannot find trait `Writer` fn foo() { - drop(2) //~ ERROR cannot find function `drop` in this scope + drop(2) //~ ERROR cannot find function `drop` } } } diff --git a/tests/ui/resolve/no-implicit-prelude.rs b/tests/ui/resolve/no-implicit-prelude.rs index 4b0ca4d524e62..3bf8d92142956 100644 --- a/tests/ui/resolve/no-implicit-prelude.rs +++ b/tests/ui/resolve/no-implicit-prelude.rs @@ -7,12 +7,12 @@ // fail with the same error message). struct Test; -impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope +impl Add for Test {} //~ ERROR cannot find trait `Add` impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` -impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope -impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope -impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope +impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` +impl ToString for Test {} //~ ERROR cannot find trait `ToString` +impl Writer for Test {} //~ ERROR cannot find trait `Writer` fn main() { - drop(2) //~ ERROR cannot find function `drop` in this scope + drop(2) //~ ERROR cannot find function `drop` } diff --git a/tests/ui/resolve/path-attr-in-const-block.rs b/tests/ui/resolve/path-attr-in-const-block.rs index 076511d26d6d3..d73acab44ebcd 100644 --- a/tests/ui/resolve/path-attr-in-const-block.rs +++ b/tests/ui/resolve/path-attr-in-const-block.rs @@ -4,6 +4,6 @@ fn main() { const { #![path = foo!()] - //~^ ERROR: cannot find macro `foo` in this scope + //~^ ERROR: cannot find macro `foo` } } diff --git a/tests/ui/resolve/path-attr-in-const-block.stderr b/tests/ui/resolve/path-attr-in-const-block.stderr index 8f9e58157c809..dfb89a04ca152 100644 --- a/tests/ui/resolve/path-attr-in-const-block.stderr +++ b/tests/ui/resolve/path-attr-in-const-block.stderr @@ -1,8 +1,8 @@ -error: cannot find macro `foo` in this scope +error: cannot find macro `foo` in the crate root --> $DIR/path-attr-in-const-block.rs:6:19 | LL | #![path = foo!()] - | ^^^ + | ^^^ not found in the crate root error: aborting due to 1 previous error diff --git a/tests/ui/resolve/privacy-enum-ctor.rs b/tests/ui/resolve/privacy-enum-ctor.rs index f0d2cf8c04e90..8b160257680ca 100644 --- a/tests/ui/resolve/privacy-enum-ctor.rs +++ b/tests/ui/resolve/privacy-enum-ctor.rs @@ -55,17 +55,17 @@ fn main() { let _: E = E::Unit(); //~^ ERROR expected function, found enum variant `E::Unit` let _: Z = m::n::Z; - //~^ ERROR cannot find type `Z` in this scope + //~^ ERROR cannot find type `Z` //~| ERROR expected value, found enum `m::n::Z` //~| ERROR enum `Z` is private let _: Z = m::n::Z::Fn; - //~^ ERROR cannot find type `Z` in this scope + //~^ ERROR cannot find type `Z` //~| ERROR enum `Z` is private let _: Z = m::n::Z::Struct; - //~^ ERROR cannot find type `Z` in this scope + //~^ ERROR cannot find type `Z` //~| ERROR expected value, found struct variant `m::n::Z::Struct` //~| ERROR enum `Z` is private let _: Z = m::n::Z::Unit {}; - //~^ ERROR cannot find type `Z` in this scope + //~^ ERROR cannot find type `Z` //~| ERROR enum `Z` is private } diff --git a/tests/ui/resolve/raw-ident-in-path.rs b/tests/ui/resolve/raw-ident-in-path.rs index 7f1163bebde67..05d18a9f1c679 100644 --- a/tests/ui/resolve/raw-ident-in-path.rs +++ b/tests/ui/resolve/raw-ident-in-path.rs @@ -1,5 +1,5 @@ // Regression test for issue #63882. -type A = crate::r#break; //~ ERROR cannot find type `r#break` in the crate root +type A = crate::r#break; //~ ERROR cannot find type `r#break` fn main() {} diff --git a/tests/ui/resolve/resolve-bad-visibility.rs b/tests/ui/resolve/resolve-bad-visibility.rs index 7d48bb97b106e..d2cbb2973349f 100644 --- a/tests/ui/resolve/resolve-bad-visibility.rs +++ b/tests/ui/resolve/resolve-bad-visibility.rs @@ -4,8 +4,8 @@ trait Tr {} pub(in E) struct S; //~ ERROR expected module, found enum `E` pub(in Tr) struct Z; //~ ERROR expected module, found trait `Tr` pub(in std::vec) struct F; //~ ERROR visibilities can only be restricted to ancestor modules -pub(in nonexistent) struct G; //~ ERROR failed to resolve -pub(in too_soon) struct H; //~ ERROR failed to resolve +pub(in nonexistent) struct G; //~ ERROR cannot find +pub(in too_soon) struct H; //~ ERROR cannot find // Visibilities are resolved eagerly without waiting for modules becoming fully populated. // Visibilities can only use ancestor modules legally which are always available in time, diff --git a/tests/ui/resolve/resolve-bad-visibility.stderr b/tests/ui/resolve/resolve-bad-visibility.stderr index 2ac41b87562e1..ff7e1f58bdce1 100644 --- a/tests/ui/resolve/resolve-bad-visibility.stderr +++ b/tests/ui/resolve/resolve-bad-visibility.stderr @@ -16,19 +16,19 @@ error[E0742]: visibilities can only be restricted to ancestor modules LL | pub(in std::vec) struct F; | ^^^^^^^^ -error[E0433]: failed to resolve: maybe a missing crate `nonexistent`? +error[E0433]: cannot find item `nonexistent` in this scope --> $DIR/resolve-bad-visibility.rs:7:8 | LL | pub(in nonexistent) struct G; - | ^^^^^^^^^^^ maybe a missing crate `nonexistent`? + | ^^^^^^^^^^^ you might be missing a crate named `nonexistent` | = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate -error[E0433]: failed to resolve: maybe a missing crate `too_soon`? +error[E0433]: cannot find item `too_soon` in this scope --> $DIR/resolve-bad-visibility.rs:8:8 | LL | pub(in too_soon) struct H; - | ^^^^^^^^ maybe a missing crate `too_soon`? + | ^^^^^^^^ you might be missing a crate named `too_soon` | = help: consider adding `extern crate too_soon` to use the `too_soon` crate diff --git a/tests/ui/resolve/resolve-primitive-fallback.rs b/tests/ui/resolve/resolve-primitive-fallback.rs index 05cabd9e3cd01..f4d06ec208688 100644 --- a/tests/ui/resolve/resolve-primitive-fallback.rs +++ b/tests/ui/resolve/resolve-primitive-fallback.rs @@ -6,5 +6,5 @@ fn main() { // Make sure primitive type fallback doesn't work with global paths let _: ::u8; - //~^ ERROR cannot find type `u8` in the crate root + //~^ ERROR cannot find type `u8` } diff --git a/tests/ui/resolve/resolve-self-in-impl-2.rs b/tests/ui/resolve/resolve-self-in-impl-2.rs index f586760c8b096..7ce4c5ededad3 100644 --- a/tests/ui/resolve/resolve-self-in-impl-2.rs +++ b/tests/ui/resolve/resolve-self-in-impl-2.rs @@ -2,6 +2,6 @@ struct S(T); trait Tr {} impl Self for S {} //~ ERROR expected trait, found self type `Self` -impl Self::N for S {} //~ ERROR cannot find trait `N` in `Self` +impl Self::N for S {} //~ ERROR cannot find trait `N` fn main() {} diff --git a/tests/ui/resolve/resolve-unknown-trait.rs b/tests/ui/resolve/resolve-unknown-trait.rs index 290893bbbec40..b8b41279bef00 100644 --- a/tests/ui/resolve/resolve-unknown-trait.rs +++ b/tests/ui/resolve/resolve-unknown-trait.rs @@ -1,10 +1,10 @@ trait NewTrait : SomeNonExistentTrait {} -//~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope +//~^ ERROR cannot find trait `SomeNonExistentTrait` impl SomeNonExistentTrait for isize {} -//~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope +//~^ ERROR cannot find trait `SomeNonExistentTrait` fn f() {} -//~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope +//~^ ERROR cannot find trait `SomeNonExistentTrait` fn main() {} diff --git a/tests/ui/resolve/resolve-variant-assoc-item.rs b/tests/ui/resolve/resolve-variant-assoc-item.rs index db4fedfb0bdf8..8bc294a7f4b7d 100644 --- a/tests/ui/resolve/resolve-variant-assoc-item.rs +++ b/tests/ui/resolve/resolve-variant-assoc-item.rs @@ -2,6 +2,6 @@ enum E { V } use E::V; fn main() { - E::V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module - V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module + E::V::associated_item; //~ ERROR cannot find module `V` + V::associated_item; //~ ERROR cannot find module `V` } diff --git a/tests/ui/resolve/resolve-variant-assoc-item.stderr b/tests/ui/resolve/resolve-variant-assoc-item.stderr index ed157197d17e1..9508c7412ff2b 100644 --- a/tests/ui/resolve/resolve-variant-assoc-item.stderr +++ b/tests/ui/resolve/resolve-variant-assoc-item.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `V` is a variant, not a module +error[E0433]: cannot find module `V` in enum `E` --> $DIR/resolve-variant-assoc-item.rs:5:8 | LL | E::V::associated_item; @@ -9,7 +9,7 @@ help: there is an enum variant `E::V`; try using the variant's enum LL | E; | ~ -error[E0433]: failed to resolve: `V` is a variant, not a module +error[E0433]: cannot find module `V` in this scope --> $DIR/resolve-variant-assoc-item.rs:6:5 | LL | V::associated_item; diff --git a/tests/ui/resolve/suggest-import-without-clobbering-attrs.fixed b/tests/ui/resolve/suggest-import-without-clobbering-attrs.fixed index 607c9af492713..ac8a4d283c827 100644 --- a/tests/ui/resolve/suggest-import-without-clobbering-attrs.fixed +++ b/tests/ui/resolve/suggest-import-without-clobbering-attrs.fixed @@ -12,5 +12,5 @@ mod y { fn main() { z(); - //~^ ERROR cannot find function `z` in this scope + //~^ ERROR cannot find function `z` } diff --git a/tests/ui/resolve/suggest-import-without-clobbering-attrs.rs b/tests/ui/resolve/suggest-import-without-clobbering-attrs.rs index 6cc53fb108658..b879183c6549a 100644 --- a/tests/ui/resolve/suggest-import-without-clobbering-attrs.rs +++ b/tests/ui/resolve/suggest-import-without-clobbering-attrs.rs @@ -11,5 +11,5 @@ mod y { fn main() { z(); - //~^ ERROR cannot find function `z` in this scope + //~^ ERROR cannot find function `z` } diff --git a/tests/ui/resolve/tool-import.rs b/tests/ui/resolve/tool-import.rs index bde375a2c490e..fadb963682fb9 100644 --- a/tests/ui/resolve/tool-import.rs +++ b/tests/ui/resolve/tool-import.rs @@ -1,7 +1,8 @@ //@ edition: 2018 use clippy::time::Instant; -//~^ `clippy` is a tool module +//~^ ERROR cannot find module `clippy` +//~| NOTE `clippy` is a tool module fn main() { Instant::now(); diff --git a/tests/ui/resolve/tool-import.stderr b/tests/ui/resolve/tool-import.stderr index b070439d72b77..02e4432fd9e56 100644 --- a/tests/ui/resolve/tool-import.stderr +++ b/tests/ui/resolve/tool-import.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `clippy` is a tool module, not a module +error[E0433]: cannot find module `clippy` in this scope --> $DIR/tool-import.rs:3:5 | LL | use clippy::time::Instant; diff --git a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs index ecd3f58811904..acc4b08a1fa62 100644 --- a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs +++ b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs @@ -4,15 +4,15 @@ struct A { impl A { fn new(cofig: String) -> Self { - Self { config } //~ Error cannot find value `config` in this scope + Self { config } //~ Error cannot find value `config` } fn do_something(cofig: String) { - println!("{config}"); //~ Error cannot find value `config` in this scope + println!("{config}"); //~ Error cannot find value `config` } fn self_is_available(self, cofig: String) { - println!("{config}"); //~ Error cannot find value `config` in this scope + println!("{config}"); //~ Error cannot find value `config` } } @@ -33,9 +33,9 @@ impl B for Box { bah; //~^ ERROR cannot find value `bah` BAR; - //~^ ERROR cannot find value `BAR` in this scope + //~^ ERROR cannot find value `BAR` let foo: Baz = "".to_string(); - //~^ ERROR cannot find type `Baz` in this scope + //~^ ERROR cannot find type `Baz` } } diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs b/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs index 3ce17a14f146b..bede336f1216f 100644 --- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs +++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs @@ -25,18 +25,18 @@ fn main() { //~| NOTE function or associated item not found in `Struct` Struc::foo(); - //~^ ERROR failed to resolve: use of undeclared type `Struc` + //~^ ERROR cannot find item `Struc` //~| NOTE use of undeclared type `Struc` modul::foo(); - //~^ ERROR failed to resolve: use of undeclared crate or module `modul` + //~^ ERROR cannot find item `modul` //~| NOTE use of undeclared crate or module `modul` module::Struc::foo(); - //~^ ERROR failed to resolve: could not find `Struc` in `module` + //~^ ERROR cannot find item `Struc` //~| NOTE could not find `Struc` in `module` Trai::foo(); - //~^ ERROR failed to resolve: use of undeclared type `Trai` + //~^ ERROR cannot find item `Trai` //~| NOTE use of undeclared type `Trai` } diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr index f4fb7fd955f2b..d54450e769525 100644 --- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr +++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `Struc` in `module` +error[E0433]: cannot find item `Struc` in module `module` --> $DIR/typo-suggestion-mistyped-in-path.rs:35:13 | LL | module::Struc::foo(); @@ -21,7 +21,7 @@ help: there is an associated function `foo` with a similar name LL | Struct::foo(); | ~~~ -error[E0433]: failed to resolve: use of undeclared type `Struc` +error[E0433]: cannot find item `Struc` in this scope --> $DIR/typo-suggestion-mistyped-in-path.rs:27:5 | LL | Struc::foo(); @@ -30,7 +30,7 @@ LL | Struc::foo(); | use of undeclared type `Struc` | help: a struct with a similar name exists: `Struct` -error[E0433]: failed to resolve: use of undeclared crate or module `modul` +error[E0433]: cannot find item `modul` in this scope --> $DIR/typo-suggestion-mistyped-in-path.rs:31:5 | LL | modul::foo(); @@ -41,7 +41,7 @@ help: there is a crate or module with a similar name LL | module::foo(); | ~~~~~~ -error[E0433]: failed to resolve: use of undeclared type `Trai` +error[E0433]: cannot find item `Trai` in this scope --> $DIR/typo-suggestion-mistyped-in-path.rs:39:5 | LL | Trai::foo(); diff --git a/tests/ui/resolve/typo-suggestion-named-underscore.rs b/tests/ui/resolve/typo-suggestion-named-underscore.rs index a2b05db035150..e39369ffcccae 100644 --- a/tests/ui/resolve/typo-suggestion-named-underscore.rs +++ b/tests/ui/resolve/typo-suggestion-named-underscore.rs @@ -2,7 +2,7 @@ const _: () = (); fn main() { a // Shouldn't suggest underscore - //~^ ERROR: cannot find value `a` in this scope + //~^ ERROR: cannot find value `a` } trait Unknown {} @@ -11,4 +11,4 @@ trait Unknown {} use Unknown as _; fn foo(x: T) {} // Shouldn't suggest underscore -//~^ ERROR: cannot find trait `A` in this scope +//~^ ERROR: cannot find trait `A` diff --git a/tests/ui/resolve/unresolved-segments-visibility.rs b/tests/ui/resolve/unresolved-segments-visibility.rs index c26171f75d2ca..3c6b5a52da588 100644 --- a/tests/ui/resolve/unresolved-segments-visibility.rs +++ b/tests/ui/resolve/unresolved-segments-visibility.rs @@ -6,6 +6,6 @@ extern crate alloc as b; mod foo { mod bar { pub(in b::string::String::newy) extern crate alloc as e; - //~^ ERROR failed to resolve: `String` is a struct, not a module [E0433] + //~^ ERROR cannot find module `String` } } diff --git a/tests/ui/resolve/unresolved-segments-visibility.stderr b/tests/ui/resolve/unresolved-segments-visibility.stderr index 09f3c50258d93..065c9a13e0e40 100644 --- a/tests/ui/resolve/unresolved-segments-visibility.stderr +++ b/tests/ui/resolve/unresolved-segments-visibility.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `String` is a struct, not a module +error[E0433]: cannot find module `String` in this scope --> $DIR/unresolved-segments-visibility.rs:8:27 | LL | pub(in b::string::String::newy) extern crate alloc as e; diff --git a/tests/ui/resolve/unresolved_static_type_field.rs b/tests/ui/resolve/unresolved_static_type_field.rs index 494ad083f1a87..784926e267795 100644 --- a/tests/ui/resolve/unresolved_static_type_field.rs +++ b/tests/ui/resolve/unresolved_static_type_field.rs @@ -7,7 +7,7 @@ struct Foo { impl Foo { fn bar() { f(cx); - //~^ ERROR cannot find value `cx` in this scope + //~^ ERROR cannot find value `cx` } } diff --git a/tests/ui/resolve/use_suggestion.rs b/tests/ui/resolve/use_suggestion.rs index 8c9bc6d76b8b2..9a513d08ba49b 100644 --- a/tests/ui/resolve/use_suggestion.rs +++ b/tests/ui/resolve/use_suggestion.rs @@ -1,6 +1,6 @@ fn main() { - let x1 = HashMap::new(); //~ ERROR failed to resolve - let x2 = GooMap::new(); //~ ERROR failed to resolve + let x1 = HashMap::new(); //~ ERROR cannot find item `HashMap` + let x2 = GooMap::new(); //~ ERROR cannot find item `GooMap` let y1: HashMap; //~ ERROR cannot find type let y2: GooMap; //~ ERROR cannot find type diff --git a/tests/ui/resolve/use_suggestion.stderr b/tests/ui/resolve/use_suggestion.stderr index 1155f5caa1739..811f53e763fdd 100644 --- a/tests/ui/resolve/use_suggestion.stderr +++ b/tests/ui/resolve/use_suggestion.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `HashMap` +error[E0433]: cannot find item `HashMap` in this scope --> $DIR/use_suggestion.rs:2:14 | LL | let x1 = HashMap::new(); @@ -26,7 +26,7 @@ error[E0412]: cannot find type `GooMap` in this scope LL | let y2: GooMap; | ^^^^^^ not found in this scope -error[E0433]: failed to resolve: use of undeclared type `GooMap` +error[E0433]: cannot find item `GooMap` in this scope --> $DIR/use_suggestion.rs:3:14 | LL | let x2 = GooMap::new(); diff --git a/tests/ui/resolve/visibility-indeterminate.rs b/tests/ui/resolve/visibility-indeterminate.rs index 17e5fec4701b9..9bb9af404e0cc 100644 --- a/tests/ui/resolve/visibility-indeterminate.rs +++ b/tests/ui/resolve/visibility-indeterminate.rs @@ -1,6 +1,6 @@ //@ edition:2018 -foo!(); //~ ERROR cannot find macro `foo` in this scope +foo!(); //~ ERROR cannot find macro `foo` pub(in ::bar) struct Baz {} //~ ERROR cannot determine resolution for the visibility diff --git a/tests/ui/resolve/visibility-indeterminate.stderr b/tests/ui/resolve/visibility-indeterminate.stderr index 84d82ce852240..d3ba907147f7d 100644 --- a/tests/ui/resolve/visibility-indeterminate.stderr +++ b/tests/ui/resolve/visibility-indeterminate.stderr @@ -4,11 +4,11 @@ error[E0578]: cannot determine resolution for the visibility LL | pub(in ::bar) struct Baz {} | ^^^^^ -error: cannot find macro `foo` in this scope +error: cannot find macro `foo` in the crate root --> $DIR/visibility-indeterminate.rs:3:1 | LL | foo!(); - | ^^^ + | ^^^ not found in the crate root error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs index 79f6b0dfe34ee..a307781f0baee 100644 --- a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs +++ b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs @@ -2,8 +2,8 @@ struct S; pub mod m { fn f() { - let s = ::m::crate::S; //~ ERROR failed to resolve - let s1 = ::crate::S; //~ ERROR failed to resolve + let s = ::m::crate::S; //~ ERROR cannot find module `crate` + let s1 = ::crate::S; //~ ERROR cannot find module `crate` let s2 = crate::S; // no error } } diff --git a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr index 7e7ee3ce03d77..8f44a98aecea5 100644 --- a/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr +++ b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: `crate` in paths can only be used in start position +error[E0433]: cannot find module `crate` in module `m` --> $DIR/crate-path-non-absolute.rs:5:22 | LL | let s = ::m::crate::S; | ^^^^^ `crate` in paths can only be used in start position -error[E0433]: failed to resolve: global paths cannot start with `crate` +error[E0433]: cannot find module `crate` in the crate root --> $DIR/crate-path-non-absolute.rs:6:20 | LL | let s1 = ::crate::S; diff --git a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs index 6bbfb69800e11..13fc896a4d7fa 100644 --- a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs +++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs @@ -2,5 +2,5 @@ fn main() { let s = ::xcrate::S; - //~^ ERROR failed to resolve: could not find `xcrate` in the list of imported crates + //~^ ERROR cannot find item `xcrate` } diff --git a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr index e3875fd843b62..cc0cf75b32d69 100644 --- a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr +++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `xcrate` in the list of imported crates +error[E0433]: cannot find item `xcrate` in the list of imported crates --> $DIR/non-existent-2.rs:4:15 | LL | let s = ::xcrate::S; diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr index c331236a4601c..1892394d7f959 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr @@ -1,19 +1,19 @@ -error[E0433]: failed to resolve: maybe a missing crate `core`? +error[E0433]: cannot find item `core` in the crate root --> $DIR/issue-102156.rs:4:5 | LL | use core::convert::{From, TryFrom}; | ^^^^ | | - | maybe a missing crate `core`? + | you might be missing a crate named `core` | help: try using `std` instead of `core`: `std` -error[E0433]: failed to resolve: maybe a missing crate `core`? +error[E0433]: cannot find item `core` in the crate root --> $DIR/issue-102156.rs:4:5 | LL | use core::convert::{From, TryFrom}; | ^^^^ | | - | maybe a missing crate `core`? + | you might be missing a crate named `core` | help: try using `std` instead of `core`: `std` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/rmeta/rmeta.rs b/tests/ui/rmeta/rmeta.rs index 4d8cff8e60e8c..089bcfb5f6424 100644 --- a/tests/ui/rmeta/rmeta.rs +++ b/tests/ui/rmeta/rmeta.rs @@ -4,5 +4,5 @@ // Check that building a metadata crate finds an error. fn main() { - let _ = Foo; //~ ERROR cannot find value `Foo` in this scope + let _ = Foo; //~ ERROR cannot find value `Foo` } diff --git a/tests/ui/rust-2018/issue-52202-use-suggestions.rs b/tests/ui/rust-2018/issue-52202-use-suggestions.rs index ce9a5edf007f9..0392df4678a44 100644 --- a/tests/ui/rust-2018/issue-52202-use-suggestions.rs +++ b/tests/ui/rust-2018/issue-52202-use-suggestions.rs @@ -9,5 +9,5 @@ mod plumbing { fn main() { let _d = Drain {}; - //~^ ERROR cannot find struct, variant or union type `Drain` in this scope + //~^ ERROR cannot find struct, variant or union type `Drain` } diff --git a/tests/ui/self/class-missing-self.rs b/tests/ui/self/class-missing-self.rs index 8ad347d20e6e4..4d973d3a2aeed 100644 --- a/tests/ui/self/class-missing-self.rs +++ b/tests/ui/self/class-missing-self.rs @@ -6,8 +6,8 @@ impl Cat { fn sleep(&self) { loop{} } fn meow(&self) { println!("Meow"); - meows += 1; //~ ERROR cannot find value `meows` in this scope - sleep(); //~ ERROR cannot find function `sleep` in this + meows += 1; //~ ERROR cannot find value `meows` + sleep(); //~ ERROR cannot find function `sleep` } } diff --git a/tests/ui/self/elision/nested-item.rs b/tests/ui/self/elision/nested-item.rs index 4bcb645c60eef..6cc379747ab8e 100644 --- a/tests/ui/self/elision/nested-item.rs +++ b/tests/ui/self/elision/nested-item.rs @@ -6,7 +6,7 @@ fn wrap(self: Wrap<{ fn bar(&self) {} }>) -> &() { //~^ ERROR `self` parameter is only allowed in associated functions //~| ERROR `self` parameter is only allowed in associated functions //~| ERROR missing lifetime specifier - //~| ERROR cannot find type `Wrap` in this scope + //~| ERROR cannot find type `Wrap` &() } diff --git a/tests/ui/self/self_type_keyword-2.rs b/tests/ui/self/self_type_keyword-2.rs index cfb87f5186d32..0af2c42b0bf23 100644 --- a/tests/ui/self/self_type_keyword-2.rs +++ b/tests/ui/self/self_type_keyword-2.rs @@ -2,12 +2,12 @@ use self::Self as Foo; //~ ERROR unresolved import `self::Self` pub fn main() { let Self = 5; - //~^ ERROR cannot find unit struct, unit variant or constant `Self` in this scope + //~^ ERROR cannot find unit struct, unit variant or constant `Self` match 15 { Self => (), - //~^ ERROR cannot find unit struct, unit variant or constant `Self` in this scope + //~^ ERROR cannot find unit struct, unit variant or constant `Self` Foo { x: Self } => (), - //~^ ERROR cannot find unit struct, unit variant or constant `Self` in this scope + //~^ ERROR cannot find unit struct, unit variant or constant `Self` } } diff --git a/tests/ui/self/self_type_keyword.rs b/tests/ui/self/self_type_keyword.rs index 96d24715edb10..a0cda4ee49002 100644 --- a/tests/ui/self/self_type_keyword.rs +++ b/tests/ui/self/self_type_keyword.rs @@ -19,7 +19,7 @@ pub fn main() { ref mut Self => (), //~^ ERROR expected identifier, found keyword `Self` Self!() => (), - //~^ ERROR cannot find macro `Self` in this scope + //~^ ERROR cannot find macro `Self` Foo { Self } => (), //~^ ERROR expected identifier, found keyword `Self` //~| ERROR mismatched types diff --git a/tests/ui/self/self_type_keyword.stderr b/tests/ui/self/self_type_keyword.stderr index 4909a9cdc7f5c..a2dd8869bcd06 100644 --- a/tests/ui/self/self_type_keyword.stderr +++ b/tests/ui/self/self_type_keyword.stderr @@ -54,11 +54,11 @@ error: lifetimes cannot use keyword names LL | struct Bar<'Self>; | ^^^^^ -error: cannot find macro `Self` in this scope +error: cannot find macro `Self` in the crate root --> $DIR/self_type_keyword.rs:21:9 | LL | Self!() => (), - | ^^^^ + | ^^^^ not found in the crate root error[E0531]: cannot find unit struct, unit variant or constant `Self` in this scope --> $DIR/self_type_keyword.rs:16:13 diff --git a/tests/ui/self/suggest-self-2.rs b/tests/ui/self/suggest-self-2.rs index 1e001827e475f..74573e111f2b5 100644 --- a/tests/ui/self/suggest-self-2.rs +++ b/tests/ui/self/suggest-self-2.rs @@ -3,19 +3,19 @@ struct Foo {} impl Foo { fn foo(&self) { bar(self); - //~^ ERROR cannot find function `bar` in this scope + //~^ ERROR cannot find function `bar` //~| HELP try calling `bar` as a method bar(&&self, 102); - //~^ ERROR cannot find function `bar` in this scope + //~^ ERROR cannot find function `bar` //~| HELP try calling `bar` as a method bar(&mut self, 102, &"str"); - //~^ ERROR cannot find function `bar` in this scope + //~^ ERROR cannot find function `bar` //~| HELP try calling `bar` as a method bar(); - //~^ ERROR cannot find function `bar` in this scope + //~^ ERROR cannot find function `bar` self.bar(); //~^ ERROR no method named `bar` found for reference diff --git a/tests/ui/self/suggest-self.rs b/tests/ui/self/suggest-self.rs index 1cc17116ea7f7..3d292a02e5310 100644 --- a/tests/ui/self/suggest-self.rs +++ b/tests/ui/self/suggest-self.rs @@ -19,17 +19,17 @@ impl Foo { fn foo(&self) -> i32 { this.x - //~^ ERROR cannot find value `this` in this scope + //~^ ERROR cannot find value `this` } fn bar(&self) -> i32 { this.foo() - //~^ ERROR cannot find value `this` in this scope + //~^ ERROR cannot find value `this` } fn baz(&self) -> i32 { my.bar() - //~^ ERROR cannot find value `my` in this scope + //~^ ERROR cannot find value `my` } } diff --git a/tests/ui/simd/portable-intrinsics-arent-exposed.stderr b/tests/ui/simd/portable-intrinsics-arent-exposed.stderr index a6f27af428b51..113d64792407d 100644 --- a/tests/ui/simd/portable-intrinsics-arent-exposed.stderr +++ b/tests/ui/simd/portable-intrinsics-arent-exposed.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: maybe a missing crate `core`? +error[E0433]: cannot find item `core` in the crate root --> $DIR/portable-intrinsics-arent-exposed.rs:4:5 | LL | use core::simd::intrinsics; | ^^^^ | | - | maybe a missing crate `core`? + | you might be missing a crate named `core` | help: try using `std` instead of `core`: `std` error[E0432]: unresolved import `std::simd::intrinsics` diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs index d0bf5078165b7..7d5cfbc9c6bd2 100644 --- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs +++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs @@ -1,7 +1,7 @@ fn main() { let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; //~^ ERROR expected a pattern, found an expression -//~| ERROR cannot find type `T` in this scope +//~| ERROR cannot find type `T` //~| ERROR const and type arguments are not allowed on builtin type `str` //~| ERROR expected unit struct, unit variant or constant, found associated function `str< //~| ERROR type annotations needed diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs index 66a432be35737..dc5c4f7627522 100644 --- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs +++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs @@ -8,7 +8,7 @@ impl Numberer { pub(crate) async fn new( //~^ ERROR `async fn` is not permitted in Rust 2015 interval: Duration, - //~^ ERROR cannot find type `Duration` in this scope + //~^ ERROR cannot find type `Duration` ) -> Numberer { Numberer {} } diff --git a/tests/ui/span/visibility-ty-params.rs b/tests/ui/span/visibility-ty-params.rs index 11c2cf44cb459..22e786a3169cf 100644 --- a/tests/ui/span/visibility-ty-params.rs +++ b/tests/ui/span/visibility-ty-params.rs @@ -4,7 +4,7 @@ macro_rules! m { struct S(T); m!{ S } //~ ERROR unexpected generic arguments in path - //~| ERROR failed to resolve: `S` is a struct, not a module [E0433] + //~| ERROR cannot find module `S` mod m { m!{ m<> } //~ ERROR unexpected generic arguments in path diff --git a/tests/ui/span/visibility-ty-params.stderr b/tests/ui/span/visibility-ty-params.stderr index 97d05c4644e82..abd171f80a443 100644 --- a/tests/ui/span/visibility-ty-params.stderr +++ b/tests/ui/span/visibility-ty-params.stderr @@ -4,7 +4,7 @@ error: unexpected generic arguments in path LL | m!{ S } | ^^^^ -error[E0433]: failed to resolve: `S` is a struct, not a module +error[E0433]: cannot find module `S` in this scope --> $DIR/visibility-ty-params.rs:6:5 | LL | m!{ S } diff --git a/tests/ui/specialization/issue-68830-spurious-diagnostics.rs b/tests/ui/specialization/issue-68830-spurious-diagnostics.rs index a7487b8aecb9c..7ff92bff26a25 100644 --- a/tests/ui/specialization/issue-68830-spurious-diagnostics.rs +++ b/tests/ui/specialization/issue-68830-spurious-diagnostics.rs @@ -5,7 +5,7 @@ #![allow(incomplete_features)] struct BadStruct { - err: MissingType //~ ERROR: cannot find type `MissingType` in this scope + err: MissingType //~ ERROR: cannot find type `MissingType` } trait MyTrait { diff --git a/tests/ui/specialization/min_specialization/impl-on-nonexisting.rs b/tests/ui/specialization/min_specialization/impl-on-nonexisting.rs index 77a64320d6f37..b3e08f5a86770 100644 --- a/tests/ui/specialization/min_specialization/impl-on-nonexisting.rs +++ b/tests/ui/specialization/min_specialization/impl-on-nonexisting.rs @@ -2,6 +2,6 @@ trait Trait {} impl Trait for NonExistent {} -//~^ ERROR cannot find type `NonExistent` in this scope +//~^ ERROR cannot find type `NonExistent` fn main() {} diff --git a/tests/ui/stability-attribute/issue-109177.rs b/tests/ui/stability-attribute/issue-109177.rs index 52880a43bcc3d..8bfa030fce099 100644 --- a/tests/ui/stability-attribute/issue-109177.rs +++ b/tests/ui/stability-attribute/issue-109177.rs @@ -5,7 +5,7 @@ extern crate similar_unstable_method; fn main() { // FIXME: this function should not suggest the `foo` function. similar_unstable_method::foo1(); - //~^ ERROR cannot find function `foo1` in crate `similar_unstable_method` [E0425] + //~^ ERROR cannot find function `foo1` let foo = similar_unstable_method::Foo; foo.foo1(); diff --git a/tests/ui/stability-attribute/unresolved_stability_lint.rs b/tests/ui/stability-attribute/unresolved_stability_lint.rs index 818d228bc91c5..2af8ce01e34e2 100644 --- a/tests/ui/stability-attribute/unresolved_stability_lint.rs +++ b/tests/ui/stability-attribute/unresolved_stability_lint.rs @@ -3,6 +3,6 @@ #[unstable(feature = "foo", issue = "none")] impl Foo for () {} -//~^ ERROR cannot find trait `Foo` in this scope +//~^ ERROR cannot find trait `Foo` fn main() {} diff --git a/tests/ui/structs/ice-struct-tail-normalization-113272.rs b/tests/ui/structs/ice-struct-tail-normalization-113272.rs index 85d3d1b4886f7..eab99be4b13ee 100644 --- a/tests/ui/structs/ice-struct-tail-normalization-113272.rs +++ b/tests/ui/structs/ice-struct-tail-normalization-113272.rs @@ -3,7 +3,7 @@ trait Trait { } impl Trait for () where Missing: Trait {} -//~^ ERROR cannot find type `Missing` in this scope +//~^ ERROR cannot find type `Missing` //~| ERROR not all trait items implemented, missing: `RefTarget` struct Other { diff --git a/tests/ui/structs/struct-fields-shorthand-unresolved.rs b/tests/ui/structs/struct-fields-shorthand-unresolved.rs index caad149160c89..14700e827a074 100644 --- a/tests/ui/structs/struct-fields-shorthand-unresolved.rs +++ b/tests/ui/structs/struct-fields-shorthand-unresolved.rs @@ -7,6 +7,6 @@ fn main() { let x = 0; let foo = Foo { x, - y //~ ERROR cannot find value `y` in this scope + y //~ ERROR cannot find value `y` }; } diff --git a/tests/ui/structs/unresolved-struct-with-fru.rs b/tests/ui/structs/unresolved-struct-with-fru.rs index c9fdca4577279..3b84b807c51cc 100644 --- a/tests/ui/structs/unresolved-struct-with-fru.rs +++ b/tests/ui/structs/unresolved-struct-with-fru.rs @@ -7,6 +7,6 @@ fn main() { let _ = || { let s2 = Oops { a: 2, ..s1 }; - //~^ ERROR cannot find struct, variant or union type `Oops` in this scope + //~^ ERROR cannot find struct, variant or union type `Oops` }; } diff --git a/tests/ui/suggestions/assoc-const-without-self.rs b/tests/ui/suggestions/assoc-const-without-self.rs index 95070ec601cd4..020b1c2f9a8e3 100644 --- a/tests/ui/suggestions/assoc-const-without-self.rs +++ b/tests/ui/suggestions/assoc-const-without-self.rs @@ -4,7 +4,7 @@ impl Foo { const A_CONST: usize = 1; fn foo() -> usize { - A_CONST //~ ERROR cannot find value `A_CONST` in this scope + A_CONST //~ ERROR cannot find value `A_CONST` } } diff --git a/tests/ui/suggestions/assoc-type-in-method-return.rs b/tests/ui/suggestions/assoc-type-in-method-return.rs index 9bde65998d744..e9341304d7990 100644 --- a/tests/ui/suggestions/assoc-type-in-method-return.rs +++ b/tests/ui/suggestions/assoc-type-in-method-return.rs @@ -1,7 +1,7 @@ trait A { type Bla; fn to_bla(&self) -> Bla; - //~^ ERROR cannot find type `Bla` in this scope + //~^ ERROR cannot find type `Bla` } fn main() {} diff --git a/tests/ui/suggestions/assoc_fn_without_self.rs b/tests/ui/suggestions/assoc_fn_without_self.rs index 35c16ef3e9f7c..c9c62b8bba313 100644 --- a/tests/ui/suggestions/assoc_fn_without_self.rs +++ b/tests/ui/suggestions/assoc_fn_without_self.rs @@ -11,18 +11,18 @@ impl S { fn b() { fn c() { - foo(); //~ ERROR cannot find function `foo` in this scope + foo(); //~ ERROR cannot find function `foo` } - foo(); //~ ERROR cannot find function `foo` in this scope - bar(); //~ ERROR cannot find function `bar` in this scope - baz(2, 3); //~ ERROR cannot find function `baz` in this scope + foo(); //~ ERROR cannot find function `foo` + bar(); //~ ERROR cannot find function `bar` + baz(2, 3); //~ ERROR cannot find function `baz` } fn d(&self) { fn c() { - foo(); //~ ERROR cannot find function `foo` in this scope + foo(); //~ ERROR cannot find function `foo` } - foo(); //~ ERROR cannot find function `foo` in this scope - bar(); //~ ERROR cannot find function `bar` in this scope - baz(2, 3); //~ ERROR cannot find function `baz` in this scope + foo(); //~ ERROR cannot find function `foo` + bar(); //~ ERROR cannot find function `bar` + baz(2, 3); //~ ERROR cannot find function `baz` } } diff --git a/tests/ui/suggestions/attribute-typos.rs b/tests/ui/suggestions/attribute-typos.rs index 7c8231bbb24f8..b8bc785a93833 100644 --- a/tests/ui/suggestions/attribute-typos.rs +++ b/tests/ui/suggestions/attribute-typos.rs @@ -1,11 +1,11 @@ -#[deprcated] //~ ERROR cannot find attribute `deprcated` in this scope +#[deprcated] //~ ERROR cannot find attribute `deprcated` fn foo() {} -#[tests] //~ ERROR cannot find attribute `tests` in this scope +#[tests] //~ ERROR cannot find attribute `tests` fn bar() {} #[rustc_err] -//~^ ERROR cannot find attribute `rustc_err` in this scope +//~^ ERROR cannot find attribute `rustc_err` //~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler fn main() {} diff --git a/tests/ui/suggestions/attribute-typos.stderr b/tests/ui/suggestions/attribute-typos.stderr index b871c9b45a56c..44814ec1244a3 100644 --- a/tests/ui/suggestions/attribute-typos.stderr +++ b/tests/ui/suggestions/attribute-typos.stderr @@ -4,26 +4,35 @@ error: attributes starting with `rustc` are reserved for use by the `rustc` comp LL | #[rustc_err] | ^^^^^^^^^ -error: cannot find attribute `rustc_err` in this scope +error: cannot find attribute `rustc_err` in the crate root --> $DIR/attribute-typos.rs:7:3 | LL | #[rustc_err] - | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `rustc_error` + | ^^^^^^^^^ + | | + | not found in the crate root + | help: a built-in attribute with a similar name exists: `rustc_error` -error: cannot find attribute `tests` in this scope +error: cannot find attribute `tests` in the crate root --> $DIR/attribute-typos.rs:4:3 | LL | #[tests] - | ^^^^^ help: an attribute macro with a similar name exists: `test` + | ^^^^^ + | | + | not found in the crate root + | help: an attribute macro with a similar name exists: `test` --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | = note: similarly named attribute macro `test` defined here -error: cannot find attribute `deprcated` in this scope +error: cannot find attribute `deprcated` in the crate root --> $DIR/attribute-typos.rs:1:3 | LL | #[deprcated] - | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `deprecated` + | ^^^^^^^^^ + | | + | not found in the crate root + | help: a built-in attribute with a similar name exists: `deprecated` error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/bool_typo_err_suggest.rs b/tests/ui/suggestions/bool_typo_err_suggest.rs index deab0fb05b76b..7a32c55dc862c 100644 --- a/tests/ui/suggestions/bool_typo_err_suggest.rs +++ b/tests/ui/suggestions/bool_typo_err_suggest.rs @@ -3,10 +3,10 @@ fn main() { let x = True; - //~^ ERROR cannot find value `True` in this scope + //~^ ERROR cannot find value `True` //~| HELP you may want to use a bool value instead let y = False; - //~^ ERROR cannot find value `False` in this scope + //~^ ERROR cannot find value `False` //~| HELP you may want to use a bool value instead } diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.fixed b/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.fixed index 02d667d984421..559ea90f6dd0d 100644 --- a/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.fixed +++ b/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.fixed @@ -12,7 +12,7 @@ use core::num::NonZero; fn main() { //~^ HELP consider importing this struct let _x = NonZero::new(5u32).unwrap(); - //~^ ERROR failed to resolve: use of undeclared type `NonZero` + //~^ ERROR cannot find item `NonZero` } #[allow(dead_code)] diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.stderr b/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.stderr index d73f613bf9c8a..2d14a483e9446 100644 --- a/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.stderr +++ b/tests/ui/suggestions/core-std-import-order-issue-83564.no_std.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `NonZero` +error[E0433]: cannot find item `NonZero` in this scope --> $DIR/core-std-import-order-issue-83564.rs:12:14 | LL | let _x = NonZero::new(5u32).unwrap(); diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.rs b/tests/ui/suggestions/core-std-import-order-issue-83564.rs index 5bb5bfe176ba8..7da0f1a275f79 100644 --- a/tests/ui/suggestions/core-std-import-order-issue-83564.rs +++ b/tests/ui/suggestions/core-std-import-order-issue-83564.rs @@ -10,7 +10,7 @@ fn main() { //~^ HELP consider importing this struct let _x = NonZero::new(5u32).unwrap(); - //~^ ERROR failed to resolve: use of undeclared type `NonZero` + //~^ ERROR cannot find item `NonZero` } #[allow(dead_code)] diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.std.fixed b/tests/ui/suggestions/core-std-import-order-issue-83564.std.fixed index 3492b42c685f9..020382c396b33 100644 --- a/tests/ui/suggestions/core-std-import-order-issue-83564.std.fixed +++ b/tests/ui/suggestions/core-std-import-order-issue-83564.std.fixed @@ -12,7 +12,7 @@ use std::num::NonZero; fn main() { //~^ HELP consider importing this struct let _x = NonZero::new(5u32).unwrap(); - //~^ ERROR failed to resolve: use of undeclared type `NonZero` + //~^ ERROR cannot find item `NonZero` } #[allow(dead_code)] diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.std.stderr b/tests/ui/suggestions/core-std-import-order-issue-83564.std.stderr index ebfe197b45d69..8b299321042f3 100644 --- a/tests/ui/suggestions/core-std-import-order-issue-83564.std.stderr +++ b/tests/ui/suggestions/core-std-import-order-issue-83564.std.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `NonZero` +error[E0433]: cannot find item `NonZero` in this scope --> $DIR/core-std-import-order-issue-83564.rs:12:14 | LL | let _x = NonZero::new(5u32).unwrap(); diff --git a/tests/ui/suggestions/crate-or-module-typo.rs b/tests/ui/suggestions/crate-or-module-typo.rs index dbc0605c76bce..eb8f95ebe3927 100644 --- a/tests/ui/suggestions/crate-or-module-typo.rs +++ b/tests/ui/suggestions/crate-or-module-typo.rs @@ -1,9 +1,9 @@ //@ edition:2018 -use st::cell::Cell; //~ ERROR failed to resolve: use of undeclared crate or module `st` +use st::cell::Cell; //~ ERROR cannot find item `st` mod bar { - pub fn bar() { bar::baz(); } //~ ERROR failed to resolve: function `bar` is not a crate or module + pub fn bar() { bar::baz(); } //~ ERROR cannot find item `bar` fn baz() {} } @@ -11,7 +11,7 @@ mod bar { use bas::bar; //~ ERROR unresolved import `bas` struct Foo { - bar: st::cell::Cell //~ ERROR failed to resolve: use of undeclared crate or module `st` + bar: st::cell::Cell //~ ERROR cannot find item `st` } fn main() {} diff --git a/tests/ui/suggestions/crate-or-module-typo.stderr b/tests/ui/suggestions/crate-or-module-typo.stderr index 084d0408a8e7d..109fc79d8793e 100644 --- a/tests/ui/suggestions/crate-or-module-typo.stderr +++ b/tests/ui/suggestions/crate-or-module-typo.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `st` +error[E0433]: cannot find item `st` in this scope --> $DIR/crate-or-module-typo.rs:3:5 | LL | use st::cell::Cell; @@ -20,7 +20,7 @@ help: there is a crate or module with a similar name LL | use bar::bar; | ~~~ -error[E0433]: failed to resolve: use of undeclared crate or module `st` +error[E0433]: cannot find item `st` in this scope --> $DIR/crate-or-module-typo.rs:14:10 | LL | bar: st::cell::Cell @@ -40,7 +40,7 @@ LL - bar: st::cell::Cell LL + bar: cell::Cell | -error[E0433]: failed to resolve: function `bar` is not a crate or module +error[E0433]: cannot find item `bar` in this scope --> $DIR/crate-or-module-typo.rs:6:20 | LL | pub fn bar() { bar::baz(); } diff --git a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs index 281975dcc2f3b..43badc7a8f881 100644 --- a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs +++ b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs @@ -9,7 +9,7 @@ mod local { } pub fn test(_: Foo) {} -//~^ ERROR cannot find type `Foo` in this scope +//~^ ERROR cannot find type `Foo` pub fn test2(_: Bar) {} -//~^ ERROR cannot find type `Bar` in this scope +//~^ ERROR cannot find type `Bar` diff --git a/tests/ui/suggestions/fn-to-method-deeply-nested.rs b/tests/ui/suggestions/fn-to-method-deeply-nested.rs index 58ee3d6409a7e..b271aa9ab02bb 100644 --- a/tests/ui/suggestions/fn-to-method-deeply-nested.rs +++ b/tests/ui/suggestions/fn-to-method-deeply-nested.rs @@ -1,13 +1,13 @@ fn main() -> Result<(), ()> { a(b(c(d(e( - //~^ ERROR cannot find function `a` in this scope - //~| ERROR cannot find function `b` in this scope - //~| ERROR cannot find function `c` in this scope - //~| ERROR cannot find function `d` in this scope - //~| ERROR cannot find function `e` in this scope + //~^ ERROR cannot find function `a` + //~| ERROR cannot find function `b` + //~| ERROR cannot find function `c` + //~| ERROR cannot find function `d` + //~| ERROR cannot find function `e` z???????????????????????????????????????????????????????????????????????????????????????? ????????????????????????????????????????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????????????? - //~^^^ ERROR cannot find value `z` in this scope + //~^^^ ERROR cannot find value `z` ))))) } diff --git a/tests/ui/suggestions/fn-to-method.rs b/tests/ui/suggestions/fn-to-method.rs index 9a35c3efc41b7..5594b80a188e2 100644 --- a/tests/ui/suggestions/fn-to-method.rs +++ b/tests/ui/suggestions/fn-to-method.rs @@ -6,14 +6,14 @@ impl Foo { fn main() { let x = cmp(&1, &2); - //~^ ERROR cannot find function `cmp` in this scope + //~^ ERROR cannot find function `cmp` //~| HELP use the `.` operator to call the method `Ord::cmp` on `&{integer}` let y = len([1, 2, 3]); - //~^ ERROR cannot find function `len` in this scope + //~^ ERROR cannot find function `len` //~| HELP use the `.` operator to call the method `len` on `&[{integer}]` let z = bar(Foo); - //~^ ERROR cannot find function `bar` in this scope + //~^ ERROR cannot find function `bar` //~| HELP use the `.` operator to call the method `bar` on `Foo` } diff --git a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs index efa296db47cf9..5292ba3b9dae3 100644 --- a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs +++ b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs @@ -2,7 +2,7 @@ fn main() { std::ptr::from_ref(num).cast_mut().as_deref(); - //~^ ERROR cannot find value `num` in this scope + //~^ ERROR cannot find value `num` //~| ERROR no method named `as_deref` found for raw pointer `*mut _` in the current scope //~| WARN type annotations needed //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! diff --git a/tests/ui/suggestions/if-let-typo.rs b/tests/ui/suggestions/if-let-typo.rs index 375bd3f03c920..ed889ad007853 100644 --- a/tests/ui/suggestions/if-let-typo.rs +++ b/tests/ui/suggestions/if-let-typo.rs @@ -1,11 +1,11 @@ fn main() { let foo = Some(0); let bar = None; - if Some(x) = foo {} //~ ERROR cannot find value `x` in this scope + if Some(x) = foo {} //~ ERROR cannot find value `x` //~^ ERROR mismatched types if Some(foo) = bar {} //~ ERROR mismatched types if 3 = foo {} //~ ERROR mismatched types if Some(3) = foo {} //~ ERROR mismatched types //~^ ERROR invalid left-hand side of assignment - if x = 5 {} //~ ERROR cannot find value `x` in this scope + if x = 5 {} //~ ERROR cannot find value `x` } diff --git a/tests/ui/suggestions/issue-103112.rs b/tests/ui/suggestions/issue-103112.rs index 111ae7c73080d..906e7332d11cc 100644 --- a/tests/ui/suggestions/issue-103112.rs +++ b/tests/ui/suggestions/issue-103112.rs @@ -1,4 +1,4 @@ fn main() { std::process::abort!(); - //~^ ERROR: failed to resolve + //~^ ERROR: cannot find macro `abort` } diff --git a/tests/ui/suggestions/issue-103112.stderr b/tests/ui/suggestions/issue-103112.stderr index b7de57bfd90ed..b0b2beaf545f8 100644 --- a/tests/ui/suggestions/issue-103112.stderr +++ b/tests/ui/suggestions/issue-103112.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `abort` in `process` +error[E0433]: cannot find macro `abort` in module `process` --> $DIR/issue-103112.rs:2:19 | LL | std::process::abort!(); diff --git a/tests/ui/suggestions/issue-104086-suggest-let.rs b/tests/ui/suggestions/issue-104086-suggest-let.rs index d22ad27d0e031..5c415afee6d37 100644 --- a/tests/ui/suggestions/issue-104086-suggest-let.rs +++ b/tests/ui/suggestions/issue-104086-suggest-let.rs @@ -1,30 +1,30 @@ fn main() { x = x = x; - //~^ ERROR cannot find value `x` in this scope - //~| ERROR cannot find value `x` in this scope - //~| ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` + //~| ERROR cannot find value `x` + //~| ERROR cannot find value `x` x = y = y = y; - //~^ ERROR cannot find value `y` in this scope - //~| ERROR cannot find value `y` in this scope - //~| ERROR cannot find value `y` in this scope - //~| ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `y` + //~| ERROR cannot find value `y` + //~| ERROR cannot find value `y` + //~| ERROR cannot find value `x` x = y = y; - //~^ ERROR cannot find value `x` in this scope - //~| ERROR cannot find value `y` in this scope - //~| ERROR cannot find value `y` in this scope + //~^ ERROR cannot find value `x` + //~| ERROR cannot find value `y` + //~| ERROR cannot find value `y` x = x = y; - //~^ ERROR cannot find value `x` in this scope - //~| ERROR cannot find value `x` in this scope - //~| ERROR cannot find value `y` in this scope + //~^ ERROR cannot find value `x` + //~| ERROR cannot find value `x` + //~| ERROR cannot find value `y` x = x; // will suggest add `let` - //~^ ERROR cannot find value `x` in this scope - //~| ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` + //~| ERROR cannot find value `x` x = y // will suggest add `let` - //~^ ERROR cannot find value `x` in this scope - //~| ERROR cannot find value `y` in this scope + //~^ ERROR cannot find value `x` + //~| ERROR cannot find value `y` } diff --git a/tests/ui/suggestions/issue-104287.rs b/tests/ui/suggestions/issue-104287.rs index 37b3339fa923e..3d4c8c5d4d357 100644 --- a/tests/ui/suggestions/issue-104287.rs +++ b/tests/ui/suggestions/issue-104287.rs @@ -9,5 +9,5 @@ fn main() { let x = S; foo::<()>(x); //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied - //~| ERROR cannot find function `foo` in this scope + //~| ERROR cannot find function `foo` } diff --git a/tests/ui/suggestions/issue-112590-suggest-import.rs b/tests/ui/suggestions/issue-112590-suggest-import.rs index 0938814c55985..6dfb785275576 100644 --- a/tests/ui/suggestions/issue-112590-suggest-import.rs +++ b/tests/ui/suggestions/issue-112590-suggest-import.rs @@ -1,8 +1,8 @@ pub struct S; -impl fmt::Debug for S { //~ ERROR failed to resolve: use of undeclared crate or module `fmt` - fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of undeclared crate or module `fmt` - //~^ ERROR failed to resolve: use of undeclared crate or module `fmt` +impl fmt::Debug for S { //~ ERROR cannot find item `fmt` + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR cannot find item `fmt` + //~^ ERROR cannot find item `fmt` Ok(()) } } diff --git a/tests/ui/suggestions/issue-112590-suggest-import.stderr b/tests/ui/suggestions/issue-112590-suggest-import.stderr index aeac18c16f047..4c9022d313bfa 100644 --- a/tests/ui/suggestions/issue-112590-suggest-import.stderr +++ b/tests/ui/suggestions/issue-112590-suggest-import.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `fmt` +error[E0433]: cannot find item `fmt` in this scope --> $DIR/issue-112590-suggest-import.rs:3:6 | LL | impl fmt::Debug for S { @@ -9,7 +9,7 @@ help: consider importing this module LL + use std::fmt; | -error[E0433]: failed to resolve: use of undeclared crate or module `fmt` +error[E0433]: cannot find item `fmt` in this scope --> $DIR/issue-112590-suggest-import.rs:4:28 | LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -20,7 +20,7 @@ help: consider importing this module LL + use std::fmt; | -error[E0433]: failed to resolve: use of undeclared crate or module `fmt` +error[E0433]: cannot find item `fmt` in this scope --> $DIR/issue-112590-suggest-import.rs:4:51 | LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/tests/ui/suggestions/non_ascii_ident.rs b/tests/ui/suggestions/non_ascii_ident.rs index 9c89714751826..45d9b1bdf0b12 100644 --- a/tests/ui/suggestions/non_ascii_ident.rs +++ b/tests/ui/suggestions/non_ascii_ident.rs @@ -1,7 +1,7 @@ fn main() { // There shall be no suggestions here. In particular not `Ok`. - let _ = 读文; //~ ERROR cannot find value `读文` in this scope + let _ = 读文; //~ ERROR cannot find value `读文` let f = 0f32; // Important line to make this an ICE regression test - 读文(f); //~ ERROR cannot find function `读文` in this scope + 读文(f); //~ ERROR cannot find function `读文` } diff --git a/tests/ui/suggestions/raw-name-use-suggestion.rs b/tests/ui/suggestions/raw-name-use-suggestion.rs index 0a8073c0be2ea..c5ccc7566111d 100644 --- a/tests/ui/suggestions/raw-name-use-suggestion.rs +++ b/tests/ui/suggestions/raw-name-use-suggestion.rs @@ -5,5 +5,5 @@ mod foo { fn main() { foo::let(); //~ ERROR expected identifier, found keyword `let` - r#break(); //~ ERROR cannot find function `r#break` in this scope + r#break(); //~ ERROR cannot find function `r#break` } diff --git a/tests/ui/suggestions/suggest-let-for-assignment.fixed b/tests/ui/suggestions/suggest-let-for-assignment.fixed index 80b9333827ec9..5010e290c8342 100644 --- a/tests/ui/suggestions/suggest-let-for-assignment.fixed +++ b/tests/ui/suggestions/suggest-let-for-assignment.fixed @@ -1,23 +1,23 @@ //@ run-rustfix fn main() { - let demo = 1; //~ ERROR cannot find value `demo` in this scope - dbg!(demo); //~ ERROR cannot find value `demo` in this scope + let demo = 1; //~ ERROR cannot find value `demo` + dbg!(demo); //~ ERROR cannot find value `demo` - let x = "x"; //~ ERROR cannot find value `x` in this scope - println!("x: {}", x); //~ ERROR cannot find value `x` in this scope + let x = "x"; //~ ERROR cannot find value `x` + println!("x: {}", x); //~ ERROR cannot find value `x` - let some_variable = 6; //~ cannot find value `let_some_variable` in this scope - println!("some_variable: {}", some_variable); //~ ERROR cannot find value `some_variable` in this scope + let some_variable = 6; //~ cannot find value `let_some_variable` + println!("some_variable: {}", some_variable); //~ ERROR cannot find value `some_variable` - let other_variable = 6; //~ cannot find value `letother_variable` in this scope - println!("other_variable: {}", other_variable); //~ ERROR cannot find value `other_variable` in this scope + let other_variable = 6; //~ cannot find value `letother_variable` + println!("other_variable: {}", other_variable); //~ ERROR cannot find value `other_variable` if x == "x" { - //~^ ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` println!("x is 1"); } - let y = 1 + 2; //~ ERROR cannot find value `y` in this scope - println!("y: {}", y); //~ ERROR cannot find value `y` in this scope + let y = 1 + 2; //~ ERROR cannot find value `y` + println!("y: {}", y); //~ ERROR cannot find value `y` } diff --git a/tests/ui/suggestions/suggest-let-for-assignment.rs b/tests/ui/suggestions/suggest-let-for-assignment.rs index 22560083d34c9..59005a29d5e88 100644 --- a/tests/ui/suggestions/suggest-let-for-assignment.rs +++ b/tests/ui/suggestions/suggest-let-for-assignment.rs @@ -1,23 +1,23 @@ //@ run-rustfix fn main() { - demo = 1; //~ ERROR cannot find value `demo` in this scope - dbg!(demo); //~ ERROR cannot find value `demo` in this scope + demo = 1; //~ ERROR cannot find value `demo` + dbg!(demo); //~ ERROR cannot find value `demo` - x = "x"; //~ ERROR cannot find value `x` in this scope - println!("x: {}", x); //~ ERROR cannot find value `x` in this scope + x = "x"; //~ ERROR cannot find value `x` + println!("x: {}", x); //~ ERROR cannot find value `x` - let_some_variable = 6; //~ cannot find value `let_some_variable` in this scope - println!("some_variable: {}", some_variable); //~ ERROR cannot find value `some_variable` in this scope + let_some_variable = 6; //~ cannot find value `let_some_variable` + println!("some_variable: {}", some_variable); //~ ERROR cannot find value `some_variable` - letother_variable = 6; //~ cannot find value `letother_variable` in this scope - println!("other_variable: {}", other_variable); //~ ERROR cannot find value `other_variable` in this scope + letother_variable = 6; //~ cannot find value `letother_variable` + println!("other_variable: {}", other_variable); //~ ERROR cannot find value `other_variable` if x == "x" { - //~^ ERROR cannot find value `x` in this scope + //~^ ERROR cannot find value `x` println!("x is 1"); } - y = 1 + 2; //~ ERROR cannot find value `y` in this scope - println!("y: {}", y); //~ ERROR cannot find value `y` in this scope + y = 1 + 2; //~ ERROR cannot find value `y` + println!("y: {}", y); //~ ERROR cannot find value `y` } diff --git a/tests/ui/suggestions/suggest-tryinto-edition-change.rs b/tests/ui/suggestions/suggest-tryinto-edition-change.rs index f45670ae7c1e2..2ea224ced3c89 100644 --- a/tests/ui/suggestions/suggest-tryinto-edition-change.rs +++ b/tests/ui/suggestions/suggest-tryinto-edition-change.rs @@ -4,21 +4,21 @@ fn test() { let _i: i16 = 0_i32.try_into().unwrap(); - //~^ ERROR no method named `try_into` found for type `i32` in the current scope + // //~^ ERROR no method named `try_into` found for type `i32` in the current scope //~| NOTE 'std::convert::TryInto' is included in the prelude starting in Edition 2021 let _i: i16 = TryFrom::try_from(0_i32).unwrap(); - //~^ ERROR failed to resolve: use of undeclared type + //~^ ERROR cannot find item `TryFrom` //~| NOTE use of undeclared type //~| NOTE 'std::convert::TryFrom' is included in the prelude starting in Edition 2021 let _i: i16 = TryInto::try_into(0_i32).unwrap(); - //~^ ERROR failed to resolve: use of undeclared type + //~^ ERROR cannot find item `TryInto` //~| NOTE use of undeclared type //~| NOTE 'std::convert::TryInto' is included in the prelude starting in Edition 2021 let _v: Vec<_> = FromIterator::from_iter(&[1]); - //~^ ERROR failed to resolve: use of undeclared type + //~^ ERROR cannot find item `FromIterator` //~| NOTE use of undeclared type //~| NOTE 'std::iter::FromIterator' is included in the prelude starting in Edition 2021 } diff --git a/tests/ui/suggestions/suggest-tryinto-edition-change.stderr b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr index 5be55f75cd15d..396fd1f4e5492 100644 --- a/tests/ui/suggestions/suggest-tryinto-edition-change.stderr +++ b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared type `TryFrom` +error[E0433]: cannot find item `TryFrom` in this scope --> $DIR/suggest-tryinto-edition-change.rs:10:19 | LL | let _i: i16 = TryFrom::try_from(0_i32).unwrap(); @@ -10,7 +10,7 @@ help: consider importing this trait LL + use std::convert::TryFrom; | -error[E0433]: failed to resolve: use of undeclared type `TryInto` +error[E0433]: cannot find item `TryInto` in this scope --> $DIR/suggest-tryinto-edition-change.rs:15:19 | LL | let _i: i16 = TryInto::try_into(0_i32).unwrap(); @@ -22,7 +22,7 @@ help: consider importing this trait LL + use std::convert::TryInto; | -error[E0433]: failed to resolve: use of undeclared type `FromIterator` +error[E0433]: cannot find item `FromIterator` in this scope --> $DIR/suggest-tryinto-edition-change.rs:20:22 | LL | let _v: Vec<_> = FromIterator::from_iter(&[1]); diff --git a/tests/ui/suggestions/suggest_print_over_printf.rs b/tests/ui/suggestions/suggest_print_over_printf.rs index 124ddec50cbbe..8272172abaa5a 100644 --- a/tests/ui/suggestions/suggest_print_over_printf.rs +++ b/tests/ui/suggestions/suggest_print_over_printf.rs @@ -3,6 +3,6 @@ fn main() { let x = 4; printf("%d", x); - //~^ ERROR cannot find function `printf` in this scope + //~^ ERROR cannot find function `printf` //~| HELP you may have meant to use the `print` macro } diff --git a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs index 99f943d71e9e5..353961ab00ea1 100644 --- a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs @@ -4,7 +4,7 @@ enum A { fn main() { let _: Vec = A::B; - //~^ ERROR cannot find trait `B` in this scope + //~^ ERROR cannot find trait `B` //~| HELP you might have meant to write a path instead of an associated type bound //~| ERROR struct takes at least 1 generic argument but 0 generic arguments were supplied //~| HELP add missing generic argument diff --git a/tests/ui/suggestions/type-not-found-in-adt-field.rs b/tests/ui/suggestions/type-not-found-in-adt-field.rs index 4cbfe58d35703..3fe05ac1bd09b 100644 --- a/tests/ui/suggestions/type-not-found-in-adt-field.rs +++ b/tests/ui/suggestions/type-not-found-in-adt-field.rs @@ -1,9 +1,9 @@ struct Struct { - m: Vec>, //~ ERROR cannot find type `Someunknownname` in this scope - //~^ NOTE not found in this scope + m: Vec>, //~ ERROR cannot find type `Someunknownname` + //~^ NOTE not found } struct OtherStruct { //~ HELP you might be missing a type parameter - m: K, //~ ERROR cannot find type `K` in this scope - //~^ NOTE not found in this scope + m: K, //~ ERROR cannot find type `K` + //~^ NOTE not found } fn main() {} diff --git a/tests/ui/suggestions/undeclared-module-alloc.rs b/tests/ui/suggestions/undeclared-module-alloc.rs index e5f22369b941a..84c5fc491bffc 100644 --- a/tests/ui/suggestions/undeclared-module-alloc.rs +++ b/tests/ui/suggestions/undeclared-module-alloc.rs @@ -1,5 +1,5 @@ //@ edition:2018 -use alloc::rc::Rc; //~ ERROR failed to resolve: use of undeclared crate or module `alloc` +use alloc::rc::Rc; //~ ERROR cannot find item `alloc` fn main() {} diff --git a/tests/ui/suggestions/undeclared-module-alloc.stderr b/tests/ui/suggestions/undeclared-module-alloc.stderr index a439546492b5f..2acb4f412b47e 100644 --- a/tests/ui/suggestions/undeclared-module-alloc.stderr +++ b/tests/ui/suggestions/undeclared-module-alloc.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `alloc` +error[E0433]: cannot find item `alloc` in this scope --> $DIR/undeclared-module-alloc.rs:3:5 | LL | use alloc::rc::Rc; diff --git a/tests/ui/suggestions/while-let-typo.rs b/tests/ui/suggestions/while-let-typo.rs index 21b254054bbc0..06a277b0b9ec0 100644 --- a/tests/ui/suggestions/while-let-typo.rs +++ b/tests/ui/suggestions/while-let-typo.rs @@ -1,9 +1,9 @@ fn main() { let foo = Some(0); let bar = None; - while Some(x) = foo {} //~ ERROR cannot find value `x` in this scope + while Some(x) = foo {} //~ ERROR cannot find value `x` while Some(foo) = bar {} //~ ERROR mismatched types while 3 = foo {} //~ ERROR mismatched types while Some(3) = foo {} //~ ERROR invalid left-hand side of assignment - while x = 5 {} //~ ERROR cannot find value `x` in this scope + while x = 5 {} //~ ERROR cannot find value `x` } diff --git a/tests/ui/super-at-top-level.rs b/tests/ui/super-at-top-level.rs index e4d587bc9effa..ae1e70050a5c7 100644 --- a/tests/ui/super-at-top-level.rs +++ b/tests/ui/super-at-top-level.rs @@ -1,4 +1,5 @@ -use super::f; //~ ERROR there are too many leading `super` keywords +use super::f; //~ ERROR cannot find module `super` + //~| NOTE can't use `super` on the crate root fn main() { } diff --git a/tests/ui/super-at-top-level.stderr b/tests/ui/super-at-top-level.stderr index 4dce81fbef43f..e86e973990612 100644 --- a/tests/ui/super-at-top-level.stderr +++ b/tests/ui/super-at-top-level.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords +error[E0433]: cannot find module `super` in this scope --> $DIR/super-at-top-level.rs:1:5 | LL | use super::f; - | ^^^^^ there are too many leading `super` keywords + | ^^^^^ can't use `super` on the crate root, there are no further modules to go "up" to error: aborting due to 1 previous error diff --git a/tests/ui/tool-attributes/tool-attributes-misplaced-1.rs b/tests/ui/tool-attributes/tool-attributes-misplaced-1.rs index bf45ba2ed8227..03f5482f000f4 100644 --- a/tests/ui/tool-attributes/tool-attributes-misplaced-1.rs +++ b/tests/ui/tool-attributes/tool-attributes-misplaced-1.rs @@ -1,18 +1,18 @@ type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt` type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip` -#[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope - //~| ERROR cannot find derive macro `rustfmt` in this scope +#[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` + //~| ERROR cannot find derive macro `rustfmt` struct S; // Interpreted as an unstable custom attribute -#[rustfmt] //~ ERROR cannot find attribute `rustfmt` in this scope +#[rustfmt] //~ ERROR cannot find attribute `rustfmt` fn check() {} #[rustfmt::skip] // OK fn main() { rustfmt; //~ ERROR expected value, found tool module `rustfmt` - rustfmt!(); //~ ERROR cannot find macro `rustfmt` in this scope + rustfmt!(); //~ ERROR cannot find macro `rustfmt` rustfmt::skip; //~ ERROR expected value, found tool attribute `rustfmt::skip` } diff --git a/tests/ui/tool-attributes/tool-attributes-misplaced-1.stderr b/tests/ui/tool-attributes/tool-attributes-misplaced-1.stderr index 2045dc6a36e1a..0efbae23bc0d5 100644 --- a/tests/ui/tool-attributes/tool-attributes-misplaced-1.stderr +++ b/tests/ui/tool-attributes/tool-attributes-misplaced-1.stderr @@ -1,28 +1,28 @@ -error: cannot find derive macro `rustfmt` in this scope +error: cannot find derive macro `rustfmt` in the crate root --> $DIR/tool-attributes-misplaced-1.rs:4:10 | LL | #[derive(rustfmt)] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root -error: cannot find derive macro `rustfmt` in this scope +error: cannot find derive macro `rustfmt` in the crate root --> $DIR/tool-attributes-misplaced-1.rs:4:10 | LL | #[derive(rustfmt)] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: cannot find attribute `rustfmt` in this scope +error: cannot find attribute `rustfmt` in the crate root --> $DIR/tool-attributes-misplaced-1.rs:9:3 | LL | #[rustfmt] - | ^^^^^^^ + | ^^^^^^^ not found in the crate root error: cannot find macro `rustfmt` in this scope --> $DIR/tool-attributes-misplaced-1.rs:15:5 | LL | rustfmt!(); - | ^^^^^^^ + | ^^^^^^^ not found in this scope error[E0573]: expected type, found tool module `rustfmt` --> $DIR/tool-attributes-misplaced-1.rs:1:10 diff --git a/tests/ui/tool-attributes/tool-attributes-shadowing.rs b/tests/ui/tool-attributes/tool-attributes-shadowing.rs index 21bbaa3a7105d..1353edaa60165 100644 --- a/tests/ui/tool-attributes/tool-attributes-shadowing.rs +++ b/tests/ui/tool-attributes/tool-attributes-shadowing.rs @@ -1,4 +1,4 @@ mod rustfmt {} -#[rustfmt::skip] //~ ERROR failed to resolve: could not find `skip` in `rustfmt` +#[rustfmt::skip] //~ ERROR cannot find macro `skip` fn main() {} diff --git a/tests/ui/tool-attributes/tool-attributes-shadowing.stderr b/tests/ui/tool-attributes/tool-attributes-shadowing.stderr index f2da617272288..9314d42158da6 100644 --- a/tests/ui/tool-attributes/tool-attributes-shadowing.stderr +++ b/tests/ui/tool-attributes/tool-attributes-shadowing.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: could not find `skip` in `rustfmt` +error[E0433]: cannot find macro `skip` in module `rustfmt` --> $DIR/tool-attributes-shadowing.rs:3:12 | LL | #[rustfmt::skip] diff --git a/tests/ui/tool-attributes/unknown-tool-name.rs b/tests/ui/tool-attributes/unknown-tool-name.rs index 73fca61c65d1b..05b3b05593712 100644 --- a/tests/ui/tool-attributes/unknown-tool-name.rs +++ b/tests/ui/tool-attributes/unknown-tool-name.rs @@ -1,2 +1,2 @@ -#[foo::bar] //~ ERROR failed to resolve: use of undeclared crate or module `foo` +#[foo::bar] //~ ERROR cannot find item `foo` fn main() {} diff --git a/tests/ui/tool-attributes/unknown-tool-name.stderr b/tests/ui/tool-attributes/unknown-tool-name.stderr index 361d359a10e47..e113aed48d04d 100644 --- a/tests/ui/tool-attributes/unknown-tool-name.stderr +++ b/tests/ui/tool-attributes/unknown-tool-name.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `foo` +error[E0433]: cannot find item `foo` in this scope --> $DIR/unknown-tool-name.rs:1:3 | LL | #[foo::bar] diff --git a/tests/ui/trait-bounds/ice-unsized-struct-arg-issue-121612.rs b/tests/ui/trait-bounds/ice-unsized-struct-arg-issue-121612.rs index 5ca4f49c3bac5..765740c089181 100644 --- a/tests/ui/trait-bounds/ice-unsized-struct-arg-issue-121612.rs +++ b/tests/ui/trait-bounds/ice-unsized-struct-arg-issue-121612.rs @@ -3,8 +3,8 @@ trait Trait {} impl Trait for bool {} struct MySlice Idx>(bool, T); -//~^ ERROR cannot find type `Idx` in this scope -//~| ERROR cannot find type `Idx` in this scope +//~^ ERROR cannot find type `Idx` +//~| ERROR cannot find type `Idx` type MySliceBool = MySlice<[bool]>; const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]); //~^ ERROR the size for values of type `[bool]` cannot be known at compilation time diff --git a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs index c3a2ab82adc6a..636fb68c4c369 100644 --- a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs +++ b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs @@ -6,7 +6,7 @@ type Fn = dyn FnOnce() -> u8; const TEST: Fn = some_fn; -//~^ ERROR cannot find value `some_fn` in this scope +//~^ ERROR cannot find value `some_fn` //~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time //~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time const TEST2: (Fn, u8) = (TEST, 0); diff --git a/tests/ui/trait-bounds/impl-bound-with-references-error.rs b/tests/ui/trait-bounds/impl-bound-with-references-error.rs index 5ba35da83839e..b6a532297e5c1 100644 --- a/tests/ui/trait-bounds/impl-bound-with-references-error.rs +++ b/tests/ui/trait-bounds/impl-bound-with-references-error.rs @@ -10,7 +10,7 @@ impl From for LabelText //~^ ERROR conflicting implementations of trait `From` for type `LabelText` [E0119] where T: Into>, - //~^ ERROR cannot find type `Cow` in this scope [E0412] + //~^ ERROR cannot find type `Cow` { fn from(text: T) -> Self { LabelText::Plain(text.into()) //~ ERROR expected function, found `LabelText` diff --git a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs index 8e43b7249f7c0..4d5e96cae02ec 100644 --- a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs +++ b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs @@ -18,6 +18,6 @@ fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { //~ ERROR expec fn issue_95327() where ::Assoc: String {} //~^ ERROR expected trait, found struct -//~| ERROR cannot find trait `Unresolved` in this scope +//~| ERROR cannot find trait `Unresolved` fn main() {} diff --git a/tests/ui/traits/dont-autoderef-ty-with-escaping-var.rs b/tests/ui/traits/dont-autoderef-ty-with-escaping-var.rs index d5ba3847ac38c..cccb0c8099927 100644 --- a/tests/ui/traits/dont-autoderef-ty-with-escaping-var.rs +++ b/tests/ui/traits/dont-autoderef-ty-with-escaping-var.rs @@ -15,7 +15,7 @@ where fn coerce_lifetime2() { >::ref_foo(unknown); - //~^ ERROR cannot find value `unknown` in this scope + //~^ ERROR cannot find value `unknown` //~| ERROR the trait bound `for<'a> &'a mut Vec<&'a u32>: Foo<'static, i32>` is not satisfied } diff --git a/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs b/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs index a08407683d8fe..38daa0a576691 100644 --- a/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs +++ b/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs @@ -1,5 +1,5 @@ fn function() { - foo == 2; //~ ERROR cannot find value `foo` in this scope [E0425] + foo == 2; //~ ERROR cannot find value `foo` } fn main() {} diff --git a/tests/ui/traits/ignore-err-impls.rs b/tests/ui/traits/ignore-err-impls.rs index 67e880b006a7f..ccfa1fc535c0d 100644 --- a/tests/ui/traits/ignore-err-impls.rs +++ b/tests/ui/traits/ignore-err-impls.rs @@ -4,6 +4,6 @@ trait Generic {} impl<'a, T> Generic<&'a T> for S {} impl Generic for S {} -//~^ ERROR cannot find type `Type` in this scope +//~^ ERROR cannot find type `Type` fn main() {} diff --git a/tests/ui/traits/issue-22384.rs b/tests/ui/traits/issue-22384.rs index 98988f27ecce5..04d90acfba8bc 100644 --- a/tests/ui/traits/issue-22384.rs +++ b/tests/ui/traits/issue-22384.rs @@ -4,5 +4,5 @@ trait Trait { fn main() { <::foobar as Trait>::foo(); - //~^ ERROR cannot find associated type `foobar` in trait `Copy` + //~^ ERROR cannot find associated type `foobar` } diff --git a/tests/ui/traits/issue-22384.stderr b/tests/ui/traits/issue-22384.stderr index f53c95c2b677e..36ea54d27c63b 100644 --- a/tests/ui/traits/issue-22384.stderr +++ b/tests/ui/traits/issue-22384.stderr @@ -2,7 +2,7 @@ error[E0576]: cannot find associated type `foobar` in trait `Copy` --> $DIR/issue-22384.rs:6:21 | LL | <::foobar as Trait>::foo(); - | ^^^^^^ not found in `Copy` + | ^^^^^^ not found in trait `Copy` error: aborting due to 1 previous error diff --git a/tests/ui/traits/issue-50480.rs b/tests/ui/traits/issue-50480.rs index ccd35a850f2d7..a5c2f144e086e 100644 --- a/tests/ui/traits/issue-50480.rs +++ b/tests/ui/traits/issue-50480.rs @@ -1,10 +1,10 @@ #[derive(Clone, Copy)] //~^ ERROR the trait `Copy` cannot be implemented for this type struct Foo(N, NotDefined, ::Item, Vec, String); -//~^ ERROR cannot find type `NotDefined` in this scope -//~| ERROR cannot find type `NotDefined` in this scope -//~| ERROR cannot find type `N` in this scope -//~| ERROR cannot find type `N` in this scope +//~^ ERROR cannot find type `NotDefined` +//~| ERROR cannot find type `NotDefined` +//~| ERROR cannot find type `N` +//~| ERROR cannot find type `N` //~| ERROR `i32` is not an iterator //~| ERROR `i32` is not an iterator @@ -12,8 +12,8 @@ struct Foo(N, NotDefined, ::Item, Vec, String); //~^ ERROR the trait `Copy` cannot be implemented for this type //~| ERROR `i32` is not an iterator struct Bar(T, N, NotDefined, ::Item, Vec, String); -//~^ ERROR cannot find type `NotDefined` in this scope -//~| ERROR cannot find type `N` in this scope +//~^ ERROR cannot find type `NotDefined` +//~| ERROR cannot find type `N` //~| ERROR `i32` is not an iterator //~| ERROR `i32` is not an iterator diff --git a/tests/ui/traits/issue-78372.rs b/tests/ui/traits/issue-78372.rs index b97835bbc57fd..d123e4515dbee 100644 --- a/tests/ui/traits/issue-78372.rs +++ b/tests/ui/traits/issue-78372.rs @@ -1,7 +1,7 @@ use std::ops::DispatchFromDyn; //~ ERROR use of unstable library feature 'dispatch_from_dyn' -struct Smaht(PhantomData); //~ ERROR cannot find type `PhantomData` in this scope -impl DispatchFromDyn> for T {} //~ ERROR cannot find type `U` in this scope -//~^ ERROR cannot find type `MISC` in this scope +struct Smaht(PhantomData); //~ ERROR cannot find type `PhantomData` +impl DispatchFromDyn> for T {} //~ ERROR cannot find type `U` +//~^ ERROR cannot find type `MISC` //~| ERROR use of unstable library feature 'dispatch_from_dyn' //~| ERROR the trait `DispatchFromDyn` may only be implemented for a coercion between structures trait Foo: X {} diff --git a/tests/ui/traits/next-solver/dont-normalize-proj-with-error.rs b/tests/ui/traits/next-solver/dont-normalize-proj-with-error.rs index 2f7ea3bb09548..692e93053cc27 100644 --- a/tests/ui/traits/next-solver/dont-normalize-proj-with-error.rs +++ b/tests/ui/traits/next-solver/dont-normalize-proj-with-error.rs @@ -15,7 +15,7 @@ impl Mirror for Wrapper { fn mirror(_: W) -> Box { todo!() } fn type_error() -> TypeError { todo!() } -//~^ ERROR cannot find type `TypeError` in this scope +//~^ ERROR cannot find type `TypeError` fn main() { let x = mirror(type_error()); diff --git a/tests/ui/traits/next-solver/issue-118950-root-region.rs b/tests/ui/traits/next-solver/issue-118950-root-region.rs index 9f6dea5d5bf86..501b906f3f491 100644 --- a/tests/ui/traits/next-solver/issue-118950-root-region.rs +++ b/tests/ui/traits/next-solver/issue-118950-root-region.rs @@ -18,6 +18,6 @@ impl Overlap for T {} impl Overlap fn(Assoc<'a, T>)> for T where Missing: Overlap {} //~^ ERROR conflicting implementations of trait `Overlap` for type `fn(_)` -//~| ERROR cannot find type `Missing` in this scope +//~| ERROR cannot find type `Missing` fn main() {} diff --git a/tests/ui/traits/no-fallback-multiple-impls.rs b/tests/ui/traits/no-fallback-multiple-impls.rs index 7ed3796f08b76..aea6d86bfb4dd 100644 --- a/tests/ui/traits/no-fallback-multiple-impls.rs +++ b/tests/ui/traits/no-fallback-multiple-impls.rs @@ -10,7 +10,7 @@ impl Fallback for usize {} fn main() { missing(); - //~^ ERROR cannot find function `missing` in this scope + //~^ ERROR cannot find function `missing` 0.foo(); // But then we shouldn't report an inference ambiguity here... } diff --git a/tests/ui/traits/non_lifetime_binders/binder-defaults-112547.rs b/tests/ui/traits/non_lifetime_binders/binder-defaults-112547.rs index c6bf0dc1f720f..b7b91a5325731 100644 --- a/tests/ui/traits/non_lifetime_binders/binder-defaults-112547.rs +++ b/tests/ui/traits/non_lifetime_binders/binder-defaults-112547.rs @@ -7,7 +7,7 @@ where (||1usize)() }> V: IntoIterator //~^^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders -//~^^ ERROR cannot find type `V` in this scope +//~^^ ERROR cannot find type `V` { } diff --git a/tests/ui/traits/non_lifetime_binders/binder-defaults-118697.rs b/tests/ui/traits/non_lifetime_binders/binder-defaults-118697.rs index 2dc9fb98b153d..fbb1bcbb9d92d 100644 --- a/tests/ui/traits/non_lifetime_binders/binder-defaults-118697.rs +++ b/tests/ui/traits/non_lifetime_binders/binder-defaults-118697.rs @@ -3,7 +3,7 @@ type T = dyn for Fn(()); //~^ ERROR defaults for generic parameters are not allowed in `for<...>` binders -//~| ERROR cannot find type `A` in this scope +//~| ERROR cannot find type `A` //~| ERROR late-bound type parameter not allowed on trait object types fn main() {} diff --git a/tests/ui/traits/trait-selection-ice-84727.rs b/tests/ui/traits/trait-selection-ice-84727.rs index 08a282892a59c..c899a6928de2a 100644 --- a/tests/ui/traits/trait-selection-ice-84727.rs +++ b/tests/ui/traits/trait-selection-ice-84727.rs @@ -3,9 +3,9 @@ struct Cell { foreground: Color, - //~^ ERROR cannot find type `Color` in this scope + //~^ ERROR cannot find type `Color` background: Color, - //~^ ERROR cannot find type `Color` in this scope + //~^ ERROR cannot find type `Color` } trait Over { @@ -16,7 +16,7 @@ impl Over, Cell> for Cell where Self: Over, Cell>, - //~^ ERROR cannot find type `Color` in this scope + //~^ ERROR cannot find type `Color` { fn over(self) -> Cell { //~^ ERROR mismatched types @@ -30,7 +30,7 @@ where Cell: Over, Cell>, { fn over(self) -> Cell { - //~^ ERROR cannot find type `NewBg` in this scope + //~^ ERROR cannot find type `NewBg` self.over(); } } diff --git a/tests/ui/transmutability/issue-101739-1.rs b/tests/ui/transmutability/issue-101739-1.rs index 0695d7d409fe0..81e848ce262d9 100644 --- a/tests/ui/transmutability/issue-101739-1.rs +++ b/tests/ui/transmutability/issue-101739-1.rs @@ -5,7 +5,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom, //~ ERROR cannot find type `Dst` in this scope + Dst: BikeshedIntrinsicFrom, //~ ERROR cannot find type `Dst` //~^ the constant `ASSUME_ALIGNMENT` is not of type `Assume` //~| ERROR: mismatched types { diff --git a/tests/ui/tuple/tuple-struct-fields/test.rs b/tests/ui/tuple/tuple-struct-fields/test.rs index 00677090d78c5..e2c0f438ef6c1 100644 --- a/tests/ui/tuple/tuple-struct-fields/test.rs +++ b/tests/ui/tuple/tuple-struct-fields/test.rs @@ -3,7 +3,7 @@ mod foo { struct S1(pub(in foo) (), pub(T), pub(crate) (), pub(((), T))); struct S2(pub((foo)) ()); //~^ ERROR expected one of `)` or `,`, found `(` - //~| ERROR cannot find type `foo` in this scope + //~| ERROR cannot find type `foo` } fn main() {} diff --git a/tests/ui/tuple/tuple-struct-fields/test2.rs b/tests/ui/tuple/tuple-struct-fields/test2.rs index 2b2a2c127e985..8b7a4713fc9f3 100644 --- a/tests/ui/tuple/tuple-struct-fields/test2.rs +++ b/tests/ui/tuple/tuple-struct-fields/test2.rs @@ -8,8 +8,8 @@ macro_rules! define_struct { } mod foo { - define_struct! { (foo) } //~ ERROR cannot find type `foo` in this scope - //~| ERROR cannot find type `foo` in this scope + define_struct! { (foo) } //~ ERROR cannot find type `foo` + //~| ERROR cannot find type `foo` } fn main() {} diff --git a/tests/ui/tuple/tuple-struct-fields/test3.rs b/tests/ui/tuple/tuple-struct-fields/test3.rs index 98d19426e7733..9ebbb266b6b04 100644 --- a/tests/ui/tuple/tuple-struct-fields/test3.rs +++ b/tests/ui/tuple/tuple-struct-fields/test3.rs @@ -8,8 +8,8 @@ macro_rules! define_struct { } mod foo { - define_struct! { foo } //~ ERROR cannot find type `foo` in this scope - //~| ERROR cannot find type `foo` in this scope + define_struct! { foo } //~ ERROR cannot find type `foo` + //~| ERROR cannot find type `foo` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/nested-impl-trait-in-tait.rs b/tests/ui/type-alias-impl-trait/nested-impl-trait-in-tait.rs index 6a74d1dc4ef38..f7f808d22003d 100644 --- a/tests/ui/type-alias-impl-trait/nested-impl-trait-in-tait.rs +++ b/tests/ui/type-alias-impl-trait/nested-impl-trait-in-tait.rs @@ -2,7 +2,7 @@ pub type Tait = impl Iterator; //~^ ERROR use of undeclared lifetime name `'db` -//~| ERROR cannot find type `LocalKey` in this scope +//~| ERROR cannot find type `LocalKey` //~| ERROR unconstrained opaque type //~| ERROR unconstrained opaque type diff --git a/tests/ui/type-alias/issue-62263-self-in-atb.rs b/tests/ui/type-alias/issue-62263-self-in-atb.rs index 91522d8912f79..6af8670c1ac95 100644 --- a/tests/ui/type-alias/issue-62263-self-in-atb.rs +++ b/tests/ui/type-alias/issue-62263-self-in-atb.rs @@ -3,6 +3,6 @@ pub trait Trait { } pub type Alias = dyn Trait; -//~^ ERROR failed to resolve: `Self` +//~^ ERROR cannot find item `Self` fn main() {} diff --git a/tests/ui/type-alias/issue-62263-self-in-atb.stderr b/tests/ui/type-alias/issue-62263-self-in-atb.stderr index 18c8bc1a1b361..f983a5abc2e73 100644 --- a/tests/ui/type-alias/issue-62263-self-in-atb.stderr +++ b/tests/ui/type-alias/issue-62263-self-in-atb.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> $DIR/issue-62263-self-in-atb.rs:5:32 | LL | pub type Alias = dyn Trait; diff --git a/tests/ui/type-alias/issue-62305-self-assoc-ty.rs b/tests/ui/type-alias/issue-62305-self-assoc-ty.rs index a4d9a285485e7..56a81f1cdc409 100644 --- a/tests/ui/type-alias/issue-62305-self-assoc-ty.rs +++ b/tests/ui/type-alias/issue-62305-self-assoc-ty.rs @@ -1,4 +1,4 @@ type Alias = Self::Target; -//~^ ERROR failed to resolve: `Self` +//~^ ERROR cannot find item `Self` fn main() {} diff --git a/tests/ui/type-alias/issue-62305-self-assoc-ty.stderr b/tests/ui/type-alias/issue-62305-self-assoc-ty.stderr index a35e644d3aa89..471076336f59d 100644 --- a/tests/ui/type-alias/issue-62305-self-assoc-ty.stderr +++ b/tests/ui/type-alias/issue-62305-self-assoc-ty.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions +error[E0433]: cannot find item `Self` in this scope --> $DIR/issue-62305-self-assoc-ty.rs:1:14 | LL | type Alias = Self::Target; diff --git a/tests/ui/type-alias/issue-62364-self-ty-arg.rs b/tests/ui/type-alias/issue-62364-self-ty-arg.rs index bebb4a9021aab..0d5c7373e58f3 100644 --- a/tests/ui/type-alias/issue-62364-self-ty-arg.rs +++ b/tests/ui/type-alias/issue-62364-self-ty-arg.rs @@ -3,6 +3,6 @@ struct Struct { } type Alias<'a> = Struct<&'a Self>; -//~^ ERROR cannot find type `Self` in this scope [E0411] +//~^ ERROR cannot find type `Self` fn main() {} diff --git a/tests/ui/type/issue-7607-1.rs b/tests/ui/type/issue-7607-1.rs index 5221f2c529bc6..984617c0e653f 100644 --- a/tests/ui/type/issue-7607-1.rs +++ b/tests/ui/type/issue-7607-1.rs @@ -2,7 +2,7 @@ struct Foo { x: isize } -impl Fo { //~ ERROR cannot find type `Fo` in this scope +impl Fo { //~ ERROR cannot find type `Fo` fn foo() {} } diff --git a/tests/ui/type/type-path-err-node-types.rs b/tests/ui/type/type-path-err-node-types.rs index b3795772e6fe2..84eb0d7401b2c 100644 --- a/tests/ui/type/type-path-err-node-types.rs +++ b/tests/ui/type/type-path-err-node-types.rs @@ -4,7 +4,7 @@ trait Tr {} fn local_type() { - let _: Nonexistent; //~ ERROR cannot find type `Nonexistent` in this scope + let _: Nonexistent; //~ ERROR cannot find type `Nonexistent` } fn ufcs_trait() { @@ -12,7 +12,7 @@ fn ufcs_trait() { } fn ufcs_item() { - NonExistent::Assoc::; //~ ERROR undeclared type `NonExistent` + NonExistent::Assoc::; //~ ERROR cannot find item `NonExistent` } fn method() { diff --git a/tests/ui/type/type-path-err-node-types.stderr b/tests/ui/type/type-path-err-node-types.stderr index 8b12aa1a393b2..2b7f75c8f35dc 100644 --- a/tests/ui/type/type-path-err-node-types.stderr +++ b/tests/ui/type/type-path-err-node-types.stderr @@ -8,7 +8,7 @@ error[E0576]: cannot find method or associated constant `nonexistent` in trait ` --> $DIR/type-path-err-node-types.rs:11:21 | LL | >::nonexistent(); - | ^^^^^^^^^^^ not found in `Tr` + | ^^^^^^^^^^^ not found in trait `Tr` error[E0425]: cannot find value `nonexistent` in this scope --> $DIR/type-path-err-node-types.rs:19:5 @@ -16,7 +16,7 @@ error[E0425]: cannot find value `nonexistent` in this scope LL | nonexistent.nonexistent::(); | ^^^^^^^^^^^ not found in this scope -error[E0433]: failed to resolve: use of undeclared type `NonExistent` +error[E0433]: cannot find item `NonExistent` in this scope --> $DIR/type-path-err-node-types.rs:15:5 | LL | NonExistent::Assoc::; diff --git a/tests/ui/typeck/apit-with-error-type-in-sig.rs b/tests/ui/typeck/apit-with-error-type-in-sig.rs index 35990fc16c89a..7a24948bdd314 100644 --- a/tests/ui/typeck/apit-with-error-type-in-sig.rs +++ b/tests/ui/typeck/apit-with-error-type-in-sig.rs @@ -1,5 +1,5 @@ type Foo = Bar; -//~^ ERROR cannot find type `Bar` in this scope +//~^ ERROR cannot find type `Bar` fn check(f: impl FnOnce(Foo), val: Foo) { f(val); diff --git a/tests/ui/typeck/autoderef-with-param-env-error.rs b/tests/ui/typeck/autoderef-with-param-env-error.rs index ec96c61c63e3a..5c76bb4480514 100644 --- a/tests/ui/typeck/autoderef-with-param-env-error.rs +++ b/tests/ui/typeck/autoderef-with-param-env-error.rs @@ -1,7 +1,7 @@ fn foo() where T: Send, - //~^ cannot find type `T` in this scope + //~^ cannot find type `T` { let s = "abc".to_string(); } diff --git a/tests/ui/typeck/check-args-on-fn-err-2.rs b/tests/ui/typeck/check-args-on-fn-err-2.rs index af57dbe33177d..31d38975b4a60 100644 --- a/tests/ui/typeck/check-args-on-fn-err-2.rs +++ b/tests/ui/typeck/check-args-on-fn-err-2.rs @@ -1,5 +1,5 @@ fn main() { a((), 1i32 == 2u32); - //~^ ERROR cannot find function `a` in this scope + //~^ ERROR cannot find function `a` //~| ERROR mismatched types } diff --git a/tests/ui/typeck/check-args-on-fn-err.rs b/tests/ui/typeck/check-args-on-fn-err.rs index 04b98ddd95295..87ec4c314876a 100644 --- a/tests/ui/typeck/check-args-on-fn-err.rs +++ b/tests/ui/typeck/check-args-on-fn-err.rs @@ -1,6 +1,6 @@ fn main() { unknown(1, |glyf| { - //~^ ERROR: cannot find function `unknown` in this scope + //~^ ERROR: cannot find function `unknown` let actual = glyf; }); } diff --git a/tests/ui/typeck/issue-104510-ice.rs b/tests/ui/typeck/issue-104510-ice.rs index 627af1fe95230..a105675075fd4 100644 --- a/tests/ui/typeck/issue-104510-ice.rs +++ b/tests/ui/typeck/issue-104510-ice.rs @@ -2,7 +2,7 @@ //@ only-x86_64 struct W(Oops); -//~^ ERROR cannot find type `Oops` in this scope +//~^ ERROR cannot find type `Oops` unsafe fn test() { let j = W(()); diff --git a/tests/ui/typeck/issue-104513-ice.rs b/tests/ui/typeck/issue-104513-ice.rs index aaeee9cef48ac..5659cd49ed904 100644 --- a/tests/ui/typeck/issue-104513-ice.rs +++ b/tests/ui/typeck/issue-104513-ice.rs @@ -1,6 +1,6 @@ struct S; fn f() { - let _: S = S; //~ ERROR cannot find trait `Oops` in this scope + let _: S = S; //~ ERROR cannot find trait `Oops` //~^ ERROR `impl Trait` is not allowed in the type of variable bindings } fn main() {} diff --git a/tests/ui/typeck/issue-105946.rs b/tests/ui/typeck/issue-105946.rs index f53f31138f811..3d0b192e4ced6 100644 --- a/tests/ui/typeck/issue-105946.rs +++ b/tests/ui/typeck/issue-105946.rs @@ -4,7 +4,7 @@ fn digit() -> str { } fn main() { let [_y..] = [Box::new(1), Box::new(2)]; - //~^ ERROR: cannot find value `_y` in this scope [E0425] + //~^ ERROR: cannot find value `_y` //~| ERROR: `X..` patterns in slices are experimental [E0658] //~| ERROR: pattern requires 1 element but array has 2 [E0527] } diff --git a/tests/ui/typeck/issue-106929.rs b/tests/ui/typeck/issue-106929.rs index 91342229ae1a5..beaa6aae52a63 100644 --- a/tests/ui/typeck/issue-106929.rs +++ b/tests/ui/typeck/issue-106929.rs @@ -7,7 +7,7 @@ impl Client { fn f() { let c = Client; post(c, ()); - //~^ ERROR cannot find function `post` in this scope + //~^ ERROR cannot find function `post` } fn main() {} diff --git a/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.rs b/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.rs index da2dae1c46b06..642b821234e60 100644 --- a/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.rs +++ b/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.rs @@ -5,11 +5,11 @@ struct RGB { fn main() { let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); - //~^ ERROR cannot find value `e` in this scope - //~| ERROR cannot find value `e` in this scope + //~^ ERROR cannot find value `e` + //~| ERROR cannot find value `e` //~| ERROR mismatched types let _ = RGB { r, g, b }; - //~^ ERROR cannot find value `g` in this scope + //~^ ERROR cannot find value `g` //~| ERROR struct `RGB` has no field named `r` //~| ERROR mismatched types } diff --git a/tests/ui/typeck/issue-120856.rs b/tests/ui/typeck/issue-120856.rs index e435a0f9d8e89..9900a5191ae0b 100644 --- a/tests/ui/typeck/issue-120856.rs +++ b/tests/ui/typeck/issue-120856.rs @@ -1,5 +1,7 @@ pub type Archived = ::Archived; -//~^ ERROR failed to resolve: use of undeclared crate or module `m` -//~| ERROR failed to resolve: use of undeclared crate or module `n` +//~^ ERROR cannot find item `m` +//~| NOTE use of undeclared crate or module `m` +//~| ERROR cannot find item `n` +//~| NOTE use of undeclared crate or module `n` fn main() {} diff --git a/tests/ui/typeck/issue-120856.stderr b/tests/ui/typeck/issue-120856.stderr index 1fc8b20047355..7ce04c96221a8 100644 --- a/tests/ui/typeck/issue-120856.stderr +++ b/tests/ui/typeck/issue-120856.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `n` +error[E0433]: cannot find item `n` in this scope --> $DIR/issue-120856.rs:1:37 | LL | pub type Archived = ::Archived; @@ -7,7 +7,7 @@ LL | pub type Archived = ::Archived; | use of undeclared crate or module `n` | help: a trait with a similar name exists: `Fn` -error[E0433]: failed to resolve: use of undeclared crate or module `m` +error[E0433]: cannot find item `m` in this scope --> $DIR/issue-120856.rs:1:25 | LL | pub type Archived = ::Archived; diff --git a/tests/ui/typeck/issue-83693.rs b/tests/ui/typeck/issue-83693.rs index 02a0bb30d7ce1..5bb3d7ec8c358 100644 --- a/tests/ui/typeck/issue-83693.rs +++ b/tests/ui/typeck/issue-83693.rs @@ -4,16 +4,16 @@ #![crate_type="lib"] impl F { -//~^ ERROR: cannot find type `F` in this scope [E0412] +//~^ ERROR: cannot find type `F` fn call() { ::call - //~^ ERROR: cannot find type `TestResult` in this scope [E0412] + //~^ ERROR: cannot find type `TestResult` //~| associated item constraints are not allowed here [E0229] } } fn call() { ::call - //~^ ERROR: cannot find type `x` in this scope [E0412] + //~^ ERROR: cannot find type `x` //~| ERROR: associated item constraints are not allowed here [E0229] } diff --git a/tests/ui/typeck/issue-88844.rs b/tests/ui/typeck/issue-88844.rs index 116c75aabdbdf..57049818aff13 100644 --- a/tests/ui/typeck/issue-88844.rs +++ b/tests/ui/typeck/issue-88844.rs @@ -4,7 +4,7 @@ struct Struct { value: i32 } //~^ NOTE: similarly named struct `Struct` defined here impl Stuct { -//~^ ERROR: cannot find type `Stuct` in this scope [E0412] +//~^ ERROR: cannot find type `Stuct` //~| HELP: a struct with a similar name exists fn new() -> Self { Self { value: 42 } diff --git a/tests/ui/typeck/issue-90319.rs b/tests/ui/typeck/issue-90319.rs index 57e6ac7cf34f5..db2572b862d3d 100644 --- a/tests/ui/typeck/issue-90319.rs +++ b/tests/ui/typeck/issue-90319.rs @@ -11,7 +11,7 @@ fn get() -> T { } fn main() { - let thing = get::();//~ERROR cannot find type `Thing` in this scope [E0412] + let thing = get::();//~ERROR cannot find type `Thing` let wrapper = Wrapper(thing); Trait::method(&wrapper); } diff --git a/tests/ui/typeck/issue-91267.rs b/tests/ui/typeck/issue-91267.rs index 1bffa09e64360..b63800e10d6d9 100644 --- a/tests/ui/typeck/issue-91267.rs +++ b/tests/ui/typeck/issue-91267.rs @@ -2,7 +2,7 @@ fn main() { type_ascribe!(0, u8=e>) - //~^ ERROR: cannot find type `e` in this scope [E0412] + //~^ ERROR: cannot find type `e` //~| ERROR: associated item constraints are not allowed here [E0229] //~| ERROR: mismatched types [E0308] } diff --git a/tests/ui/typeck/nonexistent-field-not-ambiguous.rs b/tests/ui/typeck/nonexistent-field-not-ambiguous.rs index 1cd192b783cdb..78a53923a389b 100644 --- a/tests/ui/typeck/nonexistent-field-not-ambiguous.rs +++ b/tests/ui/typeck/nonexistent-field-not-ambiguous.rs @@ -1,6 +1,6 @@ struct Foo { val: MissingType, - //~^ ERROR cannot find type `MissingType` in this scope + //~^ ERROR cannot find type `MissingType` } fn main() { diff --git a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs index fb56b394493dc..f355accfcffe9 100644 --- a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs +++ b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs @@ -1,4 +1,5 @@ fn main() { let page_size = page_size::get(); - //~^ ERROR failed to resolve: use of undeclared crate or module `page_size` + //~^ ERROR cannot find item `page_size` + //~| NOTE use of undeclared crate or module `page_size` } diff --git a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr index 3e03c17f3b1c3..e61520f981a80 100644 --- a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr +++ b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `page_size` +error[E0433]: cannot find item `page_size` in this scope --> $DIR/path-to-method-sugg-unresolved-expr.rs:2:21 | LL | let page_size = page_size::get(); diff --git a/tests/ui/typeck/quiet-type-err-let-binding.rs b/tests/ui/typeck/quiet-type-err-let-binding.rs index a6eab536a6b09..9435c7308ea27 100644 --- a/tests/ui/typeck/quiet-type-err-let-binding.rs +++ b/tests/ui/typeck/quiet-type-err-let-binding.rs @@ -11,7 +11,7 @@ fn test2(s: String) { } fn main() { - let x = foo(); //~ERROR cannot find function `foo` in this scope + let x = foo(); //~ERROR cannot find function `foo` test(&x); test2(x); // Does not complain about `x` being a `&str`. } diff --git a/tests/ui/ufcs/ufcs-partially-resolved.rs b/tests/ui/ufcs/ufcs-partially-resolved.rs index 712668728c9e7..dd19943d255b8 100644 --- a/tests/ui/ufcs/ufcs-partially-resolved.rs +++ b/tests/ui/ufcs/ufcs-partially-resolved.rs @@ -16,10 +16,10 @@ enum E { Y } type A = u32; fn main() { - let _: ::N; //~ ERROR cannot find associated type `N` in trait `Tr` + let _: ::N; //~ ERROR cannot find associated type `N` let _: ::N; //~ ERROR expected trait, found enum `E` let _: ::N; //~ ERROR expected trait, found type alias `A` - ::N; //~ ERROR cannot find method or associated constant `N` in trait `Tr` + ::N; //~ ERROR cannot find method or associated constant `N` ::N; //~ ERROR expected trait, found enum `E` ::N; //~ ERROR expected trait, found type alias `A` let _: ::Y; // OK @@ -27,10 +27,10 @@ fn main() { ::Y; // OK ::Y; //~ ERROR expected trait, found enum `E` - let _: ::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr` + let _: ::N::NN; //~ ERROR cannot find associated type `N` let _: ::N::NN; //~ ERROR expected trait, found enum `E` let _: ::N::NN; //~ ERROR expected trait, found type alias `A` - ::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr` + ::N::NN; //~ ERROR cannot find associated type `N` ::N::NN; //~ ERROR expected trait, found enum `E` ::N::NN; //~ ERROR expected trait, found type alias `A` let _: ::Y::NN; //~ ERROR ambiguous associated type @@ -38,12 +38,12 @@ fn main() { ::Y::NN; //~ ERROR no associated item named `NN` found for type `u16` ::Y::NN; //~ ERROR expected trait, found enum `E` - let _: ::NN; //~ ERROR cannot find trait `N` in trait `Tr` - let _: ::NN; //~ ERROR cannot find trait `N` in enum `E` - let _: ::NN; //~ ERROR cannot find trait `N` in `A` - ::NN; //~ ERROR cannot find trait `N` in trait `Tr` - ::NN; //~ ERROR cannot find trait `N` in enum `E` - ::NN; //~ ERROR cannot find trait `N` in `A` + let _: ::NN; //~ ERROR cannot find trait `N` + let _: ::NN; //~ ERROR cannot find trait `N` + let _: ::NN; //~ ERROR cannot find trait `N` + ::NN; //~ ERROR cannot find trait `N` + ::NN; //~ ERROR cannot find trait `N` + ::NN; //~ ERROR cannot find trait `N` let _: ::NN; //~ ERROR expected trait, found associated type `Tr::Y let _: ::NN; //~ ERROR expected trait, found variant `E::Y` ::NN; //~ ERROR expected trait, found associated type `Tr::Y` diff --git a/tests/ui/ufcs/ufcs-partially-resolved.stderr b/tests/ui/ufcs/ufcs-partially-resolved.stderr index eef55c8dc686f..3b6b1b81ef152 100644 --- a/tests/ui/ufcs/ufcs-partially-resolved.stderr +++ b/tests/ui/ufcs/ufcs-partially-resolved.stderr @@ -154,13 +154,13 @@ error[E0405]: cannot find trait `N` in trait `Tr` --> $DIR/ufcs-partially-resolved.rs:41:23 | LL | let _: ::NN; - | ^ not found in `Tr` + | ^ not found in trait `Tr` error[E0405]: cannot find trait `N` in enum `E` --> $DIR/ufcs-partially-resolved.rs:42:22 | LL | let _: ::NN; - | ^ not found in `E` + | ^ not found in enum `E` error[E0405]: cannot find trait `N` in `A` --> $DIR/ufcs-partially-resolved.rs:43:22 @@ -172,13 +172,13 @@ error[E0405]: cannot find trait `N` in trait `Tr` --> $DIR/ufcs-partially-resolved.rs:44:16 | LL | ::NN; - | ^ not found in `Tr` + | ^ not found in trait `Tr` error[E0405]: cannot find trait `N` in enum `E` --> $DIR/ufcs-partially-resolved.rs:45:15 | LL | ::NN; - | ^ not found in `E` + | ^ not found in enum `E` error[E0405]: cannot find trait `N` in `A` --> $DIR/ufcs-partially-resolved.rs:46:15 diff --git a/tests/ui/underscore-imports/issue-110164.stderr b/tests/ui/underscore-imports/issue-110164.stderr index 5016c41e8a579..4540cdc96531a 100644 --- a/tests/ui/underscore-imports/issue-110164.stderr +++ b/tests/ui/underscore-imports/issue-110164.stderr @@ -38,33 +38,25 @@ error[E0432]: unresolved import `_` --> $DIR/issue-110164.rs:8:5 | LL | use _::*; - | ^ maybe a missing crate `_`? - | - = help: consider adding `extern crate _` to use the `_` crate + | ^ `_` is not a valid item name error[E0432]: unresolved import `_` --> $DIR/issue-110164.rs:5:5 | LL | use _::a; - | ^ maybe a missing crate `_`? - | - = help: consider adding `extern crate _` to use the `_` crate + | ^ `_` is not a valid item name error[E0432]: unresolved import `_` --> $DIR/issue-110164.rs:13:9 | LL | use _::a; - | ^ maybe a missing crate `_`? - | - = help: consider adding `extern crate _` to use the `_` crate + | ^ `_` is not a valid item name error[E0432]: unresolved import `_` --> $DIR/issue-110164.rs:16:9 | LL | use _::*; - | ^ maybe a missing crate `_`? - | - = help: consider adding `extern crate _` to use the `_` crate + | ^ `_` is not a valid item name error: aborting due to 10 previous errors diff --git a/tests/ui/union/unresolved-field-isnt-copy.rs b/tests/ui/union/unresolved-field-isnt-copy.rs index 7a6d79b2faa88..957b4fe4ec799 100644 --- a/tests/ui/union/unresolved-field-isnt-copy.rs +++ b/tests/ui/union/unresolved-field-isnt-copy.rs @@ -2,7 +2,7 @@ pub union Foo { x: *const Missing, - //~^ ERROR cannot find type `Missing` in this scope + //~^ ERROR cannot find type `Missing` } fn main() {} diff --git a/tests/ui/unresolved/unresolved-asterisk-imports.stderr b/tests/ui/unresolved/unresolved-asterisk-imports.stderr index 24ac2f8e6213a..4e3b46d56df0c 100644 --- a/tests/ui/unresolved/unresolved-asterisk-imports.stderr +++ b/tests/ui/unresolved/unresolved-asterisk-imports.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `not_existing_crate` --> $DIR/unresolved-asterisk-imports.rs:1:5 | LL | use not_existing_crate::*; - | ^^^^^^^^^^^^^^^^^^ maybe a missing crate `not_existing_crate`? + | ^^^^^^^^^^^^^^^^^^ you might be missing a crate named `not_existing_crate` | = help: consider adding `extern crate not_existing_crate` to use the `not_existing_crate` crate diff --git a/tests/ui/unresolved/unresolved-candidates.rs b/tests/ui/unresolved/unresolved-candidates.rs index 38b227f609b26..7e614a9bc430e 100644 --- a/tests/ui/unresolved/unresolved-candidates.rs +++ b/tests/ui/unresolved/unresolved-candidates.rs @@ -7,7 +7,7 @@ mod b { } mod c { - impl Trait for () {} //~ ERROR cannot find trait `Trait` in this scope + impl Trait for () {} //~ ERROR cannot find trait `Trait` } fn main() {} diff --git a/tests/ui/unresolved/unresolved-import.rs b/tests/ui/unresolved/unresolved-import.rs index 4125c593c747f..fd1a4f180ea5e 100644 --- a/tests/ui/unresolved/unresolved-import.rs +++ b/tests/ui/unresolved/unresolved-import.rs @@ -1,5 +1,5 @@ use foo::bar; //~ ERROR unresolved import `foo` [E0432] - //~^ maybe a missing crate `foo`? + //~^ you might be missing a crate named `foo` //~| HELP consider adding `extern crate foo` to use the `foo` crate use bar::Baz as x; //~ ERROR unresolved import `bar::Baz` [E0432] diff --git a/tests/ui/unresolved/unresolved-import.stderr b/tests/ui/unresolved/unresolved-import.stderr index 0dd928c8b6ffd..37553e32c3c3d 100644 --- a/tests/ui/unresolved/unresolved-import.stderr +++ b/tests/ui/unresolved/unresolved-import.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `foo` --> $DIR/unresolved-import.rs:1:5 | LL | use foo::bar; - | ^^^ maybe a missing crate `foo`? + | ^^^ you might be missing a crate named `foo` | = help: consider adding `extern crate foo` to use the `foo` crate diff --git a/tests/ui/use/use-self-type.rs b/tests/ui/use/use-self-type.rs index 3b4ce42970197..447e6aa42dc79 100644 --- a/tests/ui/use/use-self-type.rs +++ b/tests/ui/use/use-self-type.rs @@ -4,7 +4,7 @@ impl S { fn f() {} fn g() { use Self::f; //~ ERROR unresolved import - pub(in Self::f) struct Z; //~ ERROR failed to resolve: `Self` + pub(in Self::f) struct Z; //~ ERROR cannot find item `Self` } } diff --git a/tests/ui/use/use-self-type.stderr b/tests/ui/use/use-self-type.stderr index 498df34fe325e..cf8ba12f41e6e 100644 --- a/tests/ui/use/use-self-type.stderr +++ b/tests/ui/use/use-self-type.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve: `Self` cannot be used in imports +error[E0433]: cannot find item `Self` in this scope --> $DIR/use-self-type.rs:7:16 | LL | pub(in Self::f) struct Z; diff --git a/tests/ui/use/use-super-global-path.rs b/tests/ui/use/use-super-global-path.rs index 64bfd14b7e7da..56dfd6ddfe540 100644 --- a/tests/ui/use/use-super-global-path.rs +++ b/tests/ui/use/use-super-global-path.rs @@ -4,11 +4,15 @@ struct S; struct Z; mod foo { - use ::super::{S, Z}; //~ ERROR global paths cannot start with `super` - //~| ERROR global paths cannot start with `super` + use ::super::{S, Z}; //~ ERROR cannot find module `super` + //~| ERROR cannot find module `super` + //~| NOTE global paths cannot start with `super` + //~| NOTE global paths cannot start with `super` + //~| NOTE duplicate diagnostic pub fn g() { - use ::super::main; //~ ERROR global paths cannot start with `super` + use ::super::main; //~ ERROR cannot find module `super` + //~| NOTE global paths cannot start with `super` main(); } } diff --git a/tests/ui/use/use-super-global-path.stderr b/tests/ui/use/use-super-global-path.stderr index 00d172f4799ae..e6b2ac7764484 100644 --- a/tests/ui/use/use-super-global-path.stderr +++ b/tests/ui/use/use-super-global-path.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve: global paths cannot start with `super` +error[E0433]: cannot find module `super` in the crate root --> $DIR/use-super-global-path.rs:7:11 | LL | use ::super::{S, Z}; | ^^^^^ global paths cannot start with `super` -error[E0433]: failed to resolve: global paths cannot start with `super` +error[E0433]: cannot find module `super` in the crate root --> $DIR/use-super-global-path.rs:7:11 | LL | use ::super::{S, Z}; @@ -12,8 +12,8 @@ LL | use ::super::{S, Z}; | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0433]: failed to resolve: global paths cannot start with `super` - --> $DIR/use-super-global-path.rs:11:15 +error[E0433]: cannot find module `super` in the crate root + --> $DIR/use-super-global-path.rs:14:15 | LL | use ::super::main; | ^^^^^ global paths cannot start with `super` diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs index 3f43fbfc0cf41..bd6422cb37a8d 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs @@ -1,5 +1,5 @@ trait Trait { - //~^ ERROR cannot find value `bar` in this scope + //~^ ERROR cannot find value `bar` //~| ERROR cycle detected when computing type of `Trait::N` //~| ERROR the trait `Trait` cannot be made into an object //~| ERROR the trait `Trait` cannot be made into an object @@ -23,7 +23,7 @@ trait Trait { //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! bar - //~^ ERROR cannot find value `bar` in this scope + //~^ ERROR cannot find value `bar` } } diff --git a/tests/ui/wf/issue-110157.rs b/tests/ui/wf/issue-110157.rs index 1a3d13e93b0de..65136b79df7c7 100644 --- a/tests/ui/wf/issue-110157.rs +++ b/tests/ui/wf/issue-110157.rs @@ -4,9 +4,9 @@ impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F> //~^ ERROR not all trait items implemented where F: Fn(&Missing) -> Result, - //~^ ERROR cannot find type `Missing` in this scope + //~^ ERROR cannot find type `Missing` I: Iterator, - //~^ ERROR cannot find type `Missing` in this scope + //~^ ERROR cannot find type `Missing` {} fn main() {} diff --git a/tests/ui/where-clauses/ignore-err-clauses.rs b/tests/ui/where-clauses/ignore-err-clauses.rs index c76f0e1a8b2b5..83c4bc7fa7178 100644 --- a/tests/ui/where-clauses/ignore-err-clauses.rs +++ b/tests/ui/where-clauses/ignore-err-clauses.rs @@ -4,7 +4,7 @@ fn dbl(x: T) -> ::Output where T: Copy + Add, UUU: Copy, - //~^ ERROR cannot find type `UUU` in this scope + //~^ ERROR cannot find type `UUU` { x + x }