diff --git a/src/librustc_resolve/macros.rs b/src/librustc_resolve/macros.rs index 9096d14645100..3900a3dbb3872 100644 --- a/src/librustc_resolve/macros.rs +++ b/src/librustc_resolve/macros.rs @@ -323,7 +323,7 @@ impl<'a> Resolver<'a> { self.check_stability_and_deprecation(&ext, path); Ok(if ext.macro_kind() != kind { - let expected = if kind == MacroKind::Attr { "attribute" } else { kind.descr() }; + let expected = kind.descr_expected(); let msg = format!("expected {}, found {} `{}`", expected, res.descr(), path); self.session.struct_span_err(path.span, &msg) .span_label(path.span, format!("not {} {}", kind.article(), expected)) @@ -774,9 +774,8 @@ impl<'a> Resolver<'a> { } Err(..) => { assert!(initial_binding.is_none()); - let bang = if kind == MacroKind::Bang { "!" } else { "" }; - let msg = - format!("cannot find {} `{}{}` in this scope", kind.descr(), ident, bang); + let expected = kind.descr_expected(); + let msg = format!("cannot find {} `{}` in this scope", expected, ident); let mut err = self.session.struct_span_err(ident.span, &msg); self.unresolved_macro_suggestions(&mut err, kind, &parent_scope, ident); err.emit(); diff --git a/src/libsyntax_pos/hygiene.rs b/src/libsyntax_pos/hygiene.rs index f0e7344c1b986..8971638d0ffe0 100644 --- a/src/libsyntax_pos/hygiene.rs +++ b/src/libsyntax_pos/hygiene.rs @@ -677,6 +677,13 @@ impl MacroKind { } } + pub fn descr_expected(self) -> &'static str { + match self { + MacroKind::Attr => "attribute", + _ => self.descr(), + } + } + pub fn article(self) -> &'static str { match self { MacroKind::Attr => "an", diff --git a/src/test/ui/attributes/obsolete-attr.rs b/src/test/ui/attributes/obsolete-attr.rs index cf6dd338552b8..42f90eda166b6 100644 --- a/src/test/ui/attributes/obsolete-attr.rs +++ b/src/test/ui/attributes/obsolete-attr.rs @@ -1,9 +1,9 @@ // Obsolete attributes fall back to unstable custom attributes. #[ab_isize="stdcall"] extern {} -//~^ ERROR cannot find attribute macro `ab_isize` in this scope +//~^ ERROR cannot find attribute `ab_isize` in this scope #[fixed_stack_segment] fn f() {} -//~^ ERROR cannot find attribute macro `fixed_stack_segment` in this scope +//~^ ERROR cannot find attribute `fixed_stack_segment` in this scope fn main() {} diff --git a/src/test/ui/attributes/obsolete-attr.stderr b/src/test/ui/attributes/obsolete-attr.stderr index 9c6909f65f3ea..2d7c257c6208c 100644 --- a/src/test/ui/attributes/obsolete-attr.stderr +++ b/src/test/ui/attributes/obsolete-attr.stderr @@ -1,10 +1,10 @@ -error: cannot find attribute macro `fixed_stack_segment` in this scope +error: cannot find attribute `fixed_stack_segment` in this scope --> $DIR/obsolete-attr.rs:6:3 | LL | #[fixed_stack_segment] fn f() {} | ^^^^^^^^^^^^^^^^^^^ -error: cannot find attribute macro `ab_isize` in this scope +error: cannot find attribute `ab_isize` in this scope --> $DIR/obsolete-attr.rs:3:3 | LL | #[ab_isize="stdcall"] extern {} diff --git a/src/test/ui/attributes/unknown-attr.rs b/src/test/ui/attributes/unknown-attr.rs index 544a6e2a7e78a..70fef04e95c67 100644 --- a/src/test/ui/attributes/unknown-attr.rs +++ b/src/test/ui/attributes/unknown-attr.rs @@ -3,10 +3,10 @@ #![feature(custom_inner_attributes)] #![mutable_doc] -//~^ ERROR cannot find attribute macro `mutable_doc` in this scope +//~^ ERROR cannot find attribute `mutable_doc` in this scope #[dance] mod a {} -//~^ ERROR cannot find attribute macro `dance` in this scope +//~^ ERROR cannot find attribute `dance` in this scope #[dance] fn main() {} -//~^ ERROR cannot find attribute macro `dance` in this scope +//~^ ERROR cannot find attribute `dance` in this scope diff --git a/src/test/ui/attributes/unknown-attr.stderr b/src/test/ui/attributes/unknown-attr.stderr index 4d463874d669e..85c227dc83aa6 100644 --- a/src/test/ui/attributes/unknown-attr.stderr +++ b/src/test/ui/attributes/unknown-attr.stderr @@ -1,16 +1,16 @@ -error: cannot find attribute macro `mutable_doc` in this scope +error: cannot find attribute `mutable_doc` in this scope --> $DIR/unknown-attr.rs:5:4 | LL | #![mutable_doc] | ^^^^^^^^^^^ -error: cannot find attribute macro `dance` in this scope +error: cannot find attribute `dance` in this scope --> $DIR/unknown-attr.rs:8:3 | LL | #[dance] mod a {} | ^^^^^ -error: cannot find attribute macro `dance` in this scope +error: cannot find attribute `dance` in this scope --> $DIR/unknown-attr.rs:11:3 | LL | #[dance] fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs b/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs index 22dbac766707d..45b757e928302 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs +++ b/src/test/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 macro `unknown` in this scope + //~^ ERROR cannot find attribute `unknown` in this scope fn foo() {} } } diff --git a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr b/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr index c7c52a2923a59..ef434ec82610e 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr +++ b/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr @@ -1,4 +1,4 @@ -error: cannot find attribute macro `unknown` in this scope +error: cannot find attribute `unknown` in this scope --> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27 | LL | #[cfg_attr(all(), unknown)] diff --git a/src/test/ui/conditional-compilation/cfg-generic-params.rs b/src/test/ui/conditional-compilation/cfg-generic-params.rs index faf01957c7e4f..53aa3556362f9 100644 --- a/src/test/ui/conditional-compilation/cfg-generic-params.rs +++ b/src/test/ui/conditional-compilation/cfg-generic-params.rs @@ -17,22 +17,22 @@ struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy; fn f_lt_no<#[cfg_attr(no, unknown)] 'a>() {} // OK fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {} -//~^ ERROR cannot find attribute macro `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` in this scope fn f_ty_no<#[cfg_attr(no, unknown)] T>() {} // OK fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {} -//~^ ERROR cannot find attribute macro `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` in this scope type FnNo = for<#[cfg_attr(no, unknown)] 'a> fn(); // OK type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn(); -//~^ ERROR cannot find attribute macro `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` in this scope type PolyNo = dyn for<#[cfg_attr(no, unknown)] 'a> Copy; // OK type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy; -//~^ ERROR cannot find attribute macro `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` in this scope struct WhereNo where for<#[cfg_attr(no, unknown)] 'a> u8: Copy; // OK struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy; -//~^ ERROR cannot find attribute macro `unknown` in this scope +//~^ ERROR cannot find attribute `unknown` in this scope fn main() { f_lt::<'static>(); diff --git a/src/test/ui/conditional-compilation/cfg-generic-params.stderr b/src/test/ui/conditional-compilation/cfg-generic-params.stderr index f6e5732916b91..d9e29c8262c63 100644 --- a/src/test/ui/conditional-compilation/cfg-generic-params.stderr +++ b/src/test/ui/conditional-compilation/cfg-generic-params.stderr @@ -16,31 +16,31 @@ error: only lifetime parameters can be used in this context LL | struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy; | ^ -error: cannot find attribute macro `unknown` in this scope +error: cannot find attribute `unknown` in this scope --> $DIR/cfg-generic-params.rs:34:43 | LL | struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy; | ^^^^^^^ -error: cannot find attribute macro `unknown` in this scope +error: cannot find attribute `unknown` in this scope --> $DIR/cfg-generic-params.rs:30:40 | LL | type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy; | ^^^^^^^ -error: cannot find attribute macro `unknown` in this scope +error: cannot find attribute `unknown` in this scope --> $DIR/cfg-generic-params.rs:26:34 | LL | type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn(); | ^^^^^^^ -error: cannot find attribute macro `unknown` in this scope +error: cannot find attribute `unknown` in this scope --> $DIR/cfg-generic-params.rs:22:29 | LL | fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {} | ^^^^^^^ -error: cannot find attribute macro `unknown` in this scope +error: cannot find attribute `unknown` in this scope --> $DIR/cfg-generic-params.rs:19:29 | LL | fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {} diff --git a/src/test/ui/custom_attribute.rs b/src/test/ui/custom_attribute.rs index 13c873c3b7e48..4957184229da0 100644 --- a/src/test/ui/custom_attribute.rs +++ b/src/test/ui/custom_attribute.rs @@ -1,9 +1,9 @@ #![feature(stmt_expr_attributes)] -#[foo] //~ ERROR cannot find attribute macro `foo` in this scope +#[foo] //~ ERROR cannot find attribute `foo` in this scope fn main() { - #[foo] //~ ERROR cannot find attribute macro `foo` in this scope + #[foo] //~ ERROR cannot find attribute `foo` in this scope let x = (); - #[foo] //~ ERROR cannot find attribute macro `foo` in this scope + #[foo] //~ ERROR cannot find attribute `foo` in this scope x } diff --git a/src/test/ui/custom_attribute.stderr b/src/test/ui/custom_attribute.stderr index b4f9f3f49b235..4023892d29466 100644 --- a/src/test/ui/custom_attribute.stderr +++ b/src/test/ui/custom_attribute.stderr @@ -1,16 +1,16 @@ -error: cannot find attribute macro `foo` in this scope +error: cannot find attribute `foo` in this scope --> $DIR/custom_attribute.rs:3:3 | LL | #[foo] | ^^^ -error: cannot find attribute macro `foo` in this scope +error: cannot find attribute `foo` in this scope --> $DIR/custom_attribute.rs:5:7 | LL | #[foo] | ^^^ -error: cannot find attribute macro `foo` in this scope +error: cannot find attribute `foo` in this scope --> $DIR/custom_attribute.rs:7:7 | LL | #[foo] diff --git a/src/test/ui/empty/empty-macro-use.stderr b/src/test/ui/empty/empty-macro-use.stderr index 16300411c8cef..8e3e06896ee78 100644 --- a/src/test/ui/empty/empty-macro-use.stderr +++ b/src/test/ui/empty/empty-macro-use.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `macro_two!` in this scope +error: cannot find macro `macro_two` in this scope --> $DIR/empty-macro-use.rs:7:5 | LL | macro_two!(); diff --git a/src/test/ui/ext-nonexistent.stderr b/src/test/ui/ext-nonexistent.stderr index 3fbbb4952649f..f3aa83fd50806 100644 --- a/src/test/ui/ext-nonexistent.stderr +++ b/src/test/ui/ext-nonexistent.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `iamnotanextensionthatexists!` in this scope +error: cannot find macro `iamnotanextensionthatexists` in this scope --> $DIR/ext-nonexistent.rs:2:13 | LL | fn main() { iamnotanextensionthatexists!(""); } diff --git a/src/test/ui/feature-gates/feature-gate-custom_attribute.rs b/src/test/ui/feature-gates/feature-gate-custom_attribute.rs index d34936b42a6ff..936cab268d2c9 100644 --- a/src/test/ui/feature-gates/feature-gate-custom_attribute.rs +++ b/src/test/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 macro `fake_attr` in this scope -#[fake_attr(100)] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_attr(1, 2, 3)] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_attr("hello")] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_attr(name = "hello")] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR cannot find attribute macro `fake_attr` in th -#[fake_attr(key = "hello", val = 10)] //~ ERROR cannot find attribute macro `fake_attr` in this scop -#[fake_attr(key("hello"), val(10))] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_attr(enabled = true, disabled = false)] //~ ERROR cannot find attribute macro `fake_attr` in -#[fake_attr(true)] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_attr(pi = 3.14159)] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_attr(b"hi")] //~ ERROR cannot find attribute macro `fake_attr` in this scope -#[fake_doc(r"doc")] //~ ERROR cannot find attribute macro `fake_doc` in this scope +#[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 struct Q {} fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-custom_attribute.stderr b/src/test/ui/feature-gates/feature-gate-custom_attribute.stderr index efdc2d1cd31ed..b7c45ec1fb7ea 100644 --- a/src/test/ui/feature-gates/feature-gate-custom_attribute.stderr +++ b/src/test/ui/feature-gates/feature-gate-custom_attribute.stderr @@ -1,76 +1,76 @@ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:3:3 | LL | #[fake_attr] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:4:3 | LL | #[fake_attr(100)] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:5:3 | LL | #[fake_attr(1, 2, 3)] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:6:3 | LL | #[fake_attr("hello")] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:7:3 | LL | #[fake_attr(name = "hello")] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:8:3 | LL | #[fake_attr(1, "hi", key = 12, true, false)] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:9:3 | LL | #[fake_attr(key = "hello", val = 10)] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:10:3 | LL | #[fake_attr(key("hello"), val(10))] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:11:3 | LL | #[fake_attr(enabled = true, disabled = false)] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:12:3 | LL | #[fake_attr(true)] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:13:3 | LL | #[fake_attr(pi = 3.14159)] | ^^^^^^^^^ -error: cannot find attribute macro `fake_attr` in this scope +error: cannot find attribute `fake_attr` in this scope --> $DIR/feature-gate-custom_attribute.rs:14:3 | LL | #[fake_attr(b"hi")] | ^^^^^^^^^ -error: cannot find attribute macro `fake_doc` in this scope +error: cannot find attribute `fake_doc` in this scope --> $DIR/feature-gate-custom_attribute.rs:15:3 | LL | #[fake_doc(r"doc")] diff --git a/src/test/ui/feature-gates/feature-gate-custom_attribute2.rs b/src/test/ui/feature-gates/feature-gate-custom_attribute2.rs index 51b5bf5387b5f..e4c80141aa2a5 100644 --- a/src/test/ui/feature-gates/feature-gate-custom_attribute2.rs +++ b/src/test/ui/feature-gates/feature-gate-custom_attribute2.rs @@ -4,54 +4,54 @@ // gate-test-custom_attribute struct StLt<#[lt_struct] 'a>(&'a u32); -//~^ ERROR cannot find attribute macro `lt_struct` in this scope +//~^ ERROR cannot find attribute `lt_struct` in this scope struct StTy<#[ty_struct] I>(I); -//~^ ERROR cannot find attribute macro `ty_struct` in this scope +//~^ ERROR cannot find attribute `ty_struct` in this scope enum EnLt<#[lt_enum] 'b> { A(&'b u32), B } -//~^ ERROR cannot find attribute macro `lt_enum` in this scope +//~^ ERROR cannot find attribute `lt_enum` in this scope enum EnTy<#[ty_enum] J> { A(J), B } -//~^ ERROR cannot find attribute macro `ty_enum` in this scope +//~^ ERROR cannot find attribute `ty_enum` in this scope trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; } -//~^ ERROR cannot find attribute macro `lt_trait` in this scope +//~^ ERROR cannot find attribute `lt_trait` in this scope trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); } -//~^ ERROR cannot find attribute macro `ty_trait` in this scope +//~^ ERROR cannot find attribute `ty_trait` in this scope type TyLt<#[lt_type] 'd> = &'d u32; -//~^ ERROR cannot find attribute macro `lt_type` in this scope +//~^ ERROR cannot find attribute `lt_type` in this scope type TyTy<#[ty_type] L> = (L, ); -//~^ ERROR cannot find attribute macro `ty_type` in this scope +//~^ ERROR cannot find attribute `ty_type` in this scope impl<#[lt_inherent] 'e> StLt<'e> { } -//~^ ERROR cannot find attribute macro `lt_inherent` in this scope +//~^ ERROR cannot find attribute `lt_inherent` in this scope impl<#[ty_inherent] M> StTy { } -//~^ ERROR cannot find attribute macro `ty_inherent` in this scope +//~^ ERROR cannot find attribute `ty_inherent` in this scope impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> { - //~^ ERROR cannot find attribute macro `lt_impl_for` in this scope + //~^ ERROR cannot find attribute `lt_impl_for` in this scope fn foo(&self, _: &'f [u32]) -> &'f u32 { loop { } } } impl<#[ty_impl_for] N> TrTy for StTy { - //~^ ERROR cannot find attribute macro `ty_impl_for` in this scope + //~^ ERROR cannot find attribute `ty_impl_for` in this scope fn foo(&self, _: N) { } } fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } } -//~^ ERROR cannot find attribute macro `lt_fn` in this scope +//~^ ERROR cannot find attribute `lt_fn` in this scope fn f_ty<#[ty_fn] O>(_: O) { } -//~^ ERROR cannot find attribute macro `ty_fn` in this scope +//~^ ERROR cannot find attribute `ty_fn` in this scope impl StTy { fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } } - //~^ ERROR cannot find attribute macro `lt_meth` in this scope + //~^ ERROR cannot find attribute `lt_meth` in this scope fn m_ty<#[ty_meth] P>(_: P) { } - //~^ ERROR cannot find attribute macro `ty_meth` in this scope + //~^ ERROR cannot find attribute `ty_meth` in this scope } fn hof_lt(_: Q) where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32 - //~^ ERROR cannot find attribute macro `lt_hof` in this scope + //~^ ERROR cannot find attribute `lt_hof` in this scope { } diff --git a/src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr b/src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr index 9250616127f3d..bc89caddb4439 100644 --- a/src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr +++ b/src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr @@ -1,100 +1,100 @@ -error: cannot find attribute macro `lt_hof` in this scope +error: cannot find attribute `lt_hof` in this scope --> $DIR/feature-gate-custom_attribute2.rs:53:21 | LL | where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32 | ^^^^^^ -error: cannot find attribute macro `ty_meth` in this scope +error: cannot find attribute `ty_meth` in this scope --> $DIR/feature-gate-custom_attribute2.rs:48:15 | LL | fn m_ty<#[ty_meth] P>(_: P) { } | ^^^^^^^ -error: cannot find attribute macro `lt_meth` in this scope +error: cannot find attribute `lt_meth` in this scope --> $DIR/feature-gate-custom_attribute2.rs:46:15 | LL | fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } } | ^^^^^^^ -error: cannot find attribute macro `ty_fn` in this scope +error: cannot find attribute `ty_fn` in this scope --> $DIR/feature-gate-custom_attribute2.rs:42:11 | LL | fn f_ty<#[ty_fn] O>(_: O) { } | ^^^^^ -error: cannot find attribute macro `lt_fn` in this scope +error: cannot find attribute `lt_fn` in this scope --> $DIR/feature-gate-custom_attribute2.rs:40:11 | LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } } | ^^^^^ -error: cannot find attribute macro `ty_impl_for` in this scope +error: cannot find attribute `ty_impl_for` in this scope --> $DIR/feature-gate-custom_attribute2.rs:35:8 | LL | impl<#[ty_impl_for] N> TrTy for StTy { | ^^^^^^^^^^^ -error: cannot find attribute macro `lt_impl_for` in this scope +error: cannot find attribute `lt_impl_for` in this scope --> $DIR/feature-gate-custom_attribute2.rs:31:8 | LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> { | ^^^^^^^^^^^ -error: cannot find attribute macro `ty_inherent` in this scope +error: cannot find attribute `ty_inherent` in this scope --> $DIR/feature-gate-custom_attribute2.rs:28:8 | LL | impl<#[ty_inherent] M> StTy { } | ^^^^^^^^^^^ -error: cannot find attribute macro `lt_inherent` in this scope +error: cannot find attribute `lt_inherent` in this scope --> $DIR/feature-gate-custom_attribute2.rs:26:8 | LL | impl<#[lt_inherent] 'e> StLt<'e> { } | ^^^^^^^^^^^ -error: cannot find attribute macro `ty_type` in this scope +error: cannot find attribute `ty_type` in this scope --> $DIR/feature-gate-custom_attribute2.rs:23:13 | LL | type TyTy<#[ty_type] L> = (L, ); | ^^^^^^^ -error: cannot find attribute macro `lt_type` in this scope +error: cannot find attribute `lt_type` in this scope --> $DIR/feature-gate-custom_attribute2.rs:21:13 | LL | type TyLt<#[lt_type] 'd> = &'d u32; | ^^^^^^^ -error: cannot find attribute macro `ty_trait` in this scope +error: cannot find attribute `ty_trait` in this scope --> $DIR/feature-gate-custom_attribute2.rs:18:14 | LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); } | ^^^^^^^^ -error: cannot find attribute macro `lt_trait` in this scope +error: cannot find attribute `lt_trait` in this scope --> $DIR/feature-gate-custom_attribute2.rs:16:14 | LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; } | ^^^^^^^^ -error: cannot find attribute macro `ty_enum` in this scope +error: cannot find attribute `ty_enum` in this scope --> $DIR/feature-gate-custom_attribute2.rs:13:13 | LL | enum EnTy<#[ty_enum] J> { A(J), B } | ^^^^^^^ -error: cannot find attribute macro `lt_enum` in this scope +error: cannot find attribute `lt_enum` in this scope --> $DIR/feature-gate-custom_attribute2.rs:11:13 | LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B } | ^^^^^^^ -error: cannot find attribute macro `ty_struct` in this scope +error: cannot find attribute `ty_struct` in this scope --> $DIR/feature-gate-custom_attribute2.rs:8:15 | LL | struct StTy<#[ty_struct] I>(I); | ^^^^^^^^^ -error: cannot find attribute macro `lt_struct` in this scope +error: cannot find attribute `lt_struct` in this scope --> $DIR/feature-gate-custom_attribute2.rs:6:15 | LL | struct StLt<#[lt_struct] 'a>(&'a u32); diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs b/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs index 4044fd2b895e4..c985298a30aed 100644 --- a/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs +++ b/src/test/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 macro `rustc_unknown` in this scope +//~| ERROR cannot find attribute `rustc_unknown` in this scope fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr b/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr index c1063027fa444..d6fdab2b0412d 100644 --- a/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr +++ b/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr @@ -37,7 +37,7 @@ LL | #[rustc_unknown] = note: for more information, see https://github.com/rust-lang/rust/issues/29642 = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable -error: cannot find attribute macro `rustc_unknown` in this scope +error: cannot find attribute `rustc_unknown` in this scope --> $DIR/feature-gate-rustc-attrs.rs:20:3 | LL | #[rustc_unknown] diff --git a/src/test/ui/hygiene/no_implicit_prelude-2018.rs b/src/test/ui/hygiene/no_implicit_prelude-2018.rs index 3ad7435fecf29..83ca28167a468 100644 --- a/src/test/ui/hygiene/no_implicit_prelude-2018.rs +++ b/src/test/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` in this scope } } diff --git a/src/test/ui/hygiene/no_implicit_prelude-2018.stderr b/src/test/ui/hygiene/no_implicit_prelude-2018.stderr index 0fdb18d967a6c..f31b75238dffe 100644 --- a/src/test/ui/hygiene/no_implicit_prelude-2018.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude-2018.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `print!` in this scope +error: cannot find macro `print` in this scope --> $DIR/no_implicit_prelude-2018.rs:7:9 | LL | print!(); diff --git a/src/test/ui/hygiene/no_implicit_prelude.rs b/src/test/ui/hygiene/no_implicit_prelude.rs index 890c8307543f3..204e7b248797a 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.rs +++ b/src/test/ui/hygiene/no_implicit_prelude.rs @@ -13,7 +13,7 @@ mod bar { } fn f() { ::foo::m!(); - assert_eq!(0, 0); //~ ERROR cannot find macro `panic!` in this scope + assert_eq!(0, 0); //~ ERROR cannot find macro `panic` in this scope } } diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index 8fa55d05bddcb..bc0ce746be925 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `panic!` in this scope +error: cannot find macro `panic` in this scope --> $DIR/no_implicit_prelude.rs:16:9 | LL | assert_eq!(0, 0); diff --git a/src/test/ui/issues/issue-11692-1.rs b/src/test/ui/issues/issue-11692-1.rs index 70b712c560830..b6f3bb8ef0549 100644 --- a/src/test/ui/issues/issue-11692-1.rs +++ b/src/test/ui/issues/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` in this scope } diff --git a/src/test/ui/issues/issue-11692-1.stderr b/src/test/ui/issues/issue-11692-1.stderr index bfd1647e8bee4..386463436b8e6 100644 --- a/src/test/ui/issues/issue-11692-1.stderr +++ b/src/test/ui/issues/issue-11692-1.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `testo!` in this scope +error: cannot find macro `testo` in this scope --> $DIR/issue-11692-1.rs:2:12 | LL | print!(testo!()); diff --git a/src/test/ui/issues/issue-11692-2.rs b/src/test/ui/issues/issue-11692-2.rs index 61be284d7320e..5957ed338f4e7 100644 --- a/src/test/ui/issues/issue-11692-2.rs +++ b/src/test/ui/issues/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` in this scope } diff --git a/src/test/ui/issues/issue-11692-2.stderr b/src/test/ui/issues/issue-11692-2.stderr index 740c3555e52f0..f021943da32da 100644 --- a/src/test/ui/issues/issue-11692-2.stderr +++ b/src/test/ui/issues/issue-11692-2.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `test!` in this scope +error: cannot find macro `test` in this scope --> $DIR/issue-11692-2.rs:2:13 | LL | concat!(test!()); diff --git a/src/test/ui/issues/issue-19734.rs b/src/test/ui/issues/issue-19734.rs index b730e19a1e632..fe4a327aef49c 100644 --- a/src/test/ui/issues/issue-19734.rs +++ b/src/test/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` in this scope } diff --git a/src/test/ui/issues/issue-19734.stderr b/src/test/ui/issues/issue-19734.stderr index fc1a7d0381be2..81757974de9dd 100644 --- a/src/test/ui/issues/issue-19734.stderr +++ b/src/test/ui/issues/issue-19734.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `undef!` in this scope +error: cannot find macro `undef` in this scope --> $DIR/issue-19734.rs:6:5 | LL | undef!(); diff --git a/src/test/ui/issues/issue-32655.rs b/src/test/ui/issues/issue-32655.rs index fad7bf55cf4ea..f52e092312968 100644 --- a/src/test/ui/issues/issue-32655.rs +++ b/src/test/ui/issues/issue-32655.rs @@ -1,6 +1,6 @@ macro_rules! foo ( () => ( - #[derive_Clone] //~ ERROR cannot find attribute macro `derive_Clone` in this scope + #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` in this scope struct T; ); ); @@ -12,7 +12,7 @@ macro_rules! bar ( foo!(); bar!( - #[derive_Clone] //~ ERROR cannot find attribute macro `derive_Clone` in this scope + #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` in this scope struct S; ); diff --git a/src/test/ui/issues/issue-32655.stderr b/src/test/ui/issues/issue-32655.stderr index e13bed0fbfd66..ca085b25c2ddf 100644 --- a/src/test/ui/issues/issue-32655.stderr +++ b/src/test/ui/issues/issue-32655.stderr @@ -1,4 +1,4 @@ -error: cannot find attribute macro `derive_Clone` in this scope +error: cannot find attribute `derive_Clone` in this scope --> $DIR/issue-32655.rs:3:11 | LL | #[derive_Clone] @@ -7,7 +7,7 @@ LL | #[derive_Clone] LL | foo!(); | ------- in this macro invocation -error: cannot find attribute macro `derive_Clone` in this scope +error: cannot find attribute `derive_Clone` in this scope --> $DIR/issue-32655.rs:15:7 | LL | #[derive_Clone] diff --git a/src/test/ui/issues/issue-40845.rs b/src/test/ui/issues/issue-40845.rs index c9102f4417c17..a4ede6adfa3c2 100644 --- a/src/test/ui/issues/issue-40845.rs +++ b/src/test/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` in this scope struct S; -impl S { m!(); } //~ ERROR cannot find macro `m!` in this scope +impl S { m!(); } //~ ERROR cannot find macro `m` in this scope fn main() {} diff --git a/src/test/ui/issues/issue-40845.stderr b/src/test/ui/issues/issue-40845.stderr index a8be38ebf0657..2744330a4e58e 100644 --- a/src/test/ui/issues/issue-40845.stderr +++ b/src/test/ui/issues/issue-40845.stderr @@ -1,10 +1,10 @@ -error: cannot find macro `m!` in this scope +error: cannot find macro `m` in this scope --> $DIR/issue-40845.rs:4:10 | LL | impl S { m!(); } | ^ -error: cannot find macro `m!` in this scope +error: cannot find macro `m` in this scope --> $DIR/issue-40845.rs:1:11 | LL | trait T { m!(); } diff --git a/src/test/ui/issues/issue-49074.rs b/src/test/ui/issues/issue-49074.rs index 38074d5b05ca2..752bb345b703e 100644 --- a/src/test/ui/issues/issue-49074.rs +++ b/src/test/ui/issues/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 macro `marco_use` in this scope +//~^ ERROR cannot find attribute `marco_use` in this scope 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` in this scope } diff --git a/src/test/ui/issues/issue-49074.stderr b/src/test/ui/issues/issue-49074.stderr index e0d3bb3ecc2e1..bbfeb4ea9483a 100644 --- a/src/test/ui/issues/issue-49074.stderr +++ b/src/test/ui/issues/issue-49074.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `bar!` in this scope +error: cannot find macro `bar` in this scope --> $DIR/issue-49074.rs:12:4 | LL | bar!(); @@ -6,7 +6,7 @@ LL | bar!(); | = help: have you added the `#[macro_use]` on the module/import? -error: cannot find attribute macro `marco_use` in this scope +error: cannot find attribute `marco_use` in this scope --> $DIR/issue-49074.rs:3:3 | LL | #[marco_use] // typo diff --git a/src/test/ui/macros/macro-expansion-tests.stderr b/src/test/ui/macros/macro-expansion-tests.stderr index 4ad9ade95a052..8b3f7ca88171c 100644 --- a/src/test/ui/macros/macro-expansion-tests.stderr +++ b/src/test/ui/macros/macro-expansion-tests.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `m!` in this scope +error: cannot find macro `m` in this scope --> $DIR/macro-expansion-tests.rs:7:21 | LL | fn g() -> i32 { m!() } @@ -6,7 +6,7 @@ LL | fn g() -> i32 { m!() } | = 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 this scope --> $DIR/macro-expansion-tests.rs:15:21 | LL | fn g() -> i32 { m!() } diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr index 967f4f3c4ac4a..ce2e1985b38ce 100644 --- a/src/test/ui/macros/macro-name-typo.stderr +++ b/src/test/ui/macros/macro-name-typo.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `printlx!` in this scope +error: cannot find macro `printlx` in this scope --> $DIR/macro-name-typo.rs:2:5 | LL | printlx!("oh noes!"); diff --git a/src/test/ui/macros/macro-path-prelude-fail-3.rs b/src/test/ui/macros/macro-path-prelude-fail-3.rs index 597053d625134..68eb350a95614 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-3.rs +++ b/src/test/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` in this scope } diff --git a/src/test/ui/macros/macro-path-prelude-fail-3.stderr b/src/test/ui/macros/macro-path-prelude-fail-3.stderr index 96b8a24cff293..ec00760de6c6f 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-3.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-3.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `inline!` in this scope +error: cannot find macro `inline` in this scope --> $DIR/macro-path-prelude-fail-3.rs:2:5 | LL | inline!(); diff --git a/src/test/ui/macros/macro-reexport-removed.rs b/src/test/ui/macros/macro-reexport-removed.rs index b69a1fa4df08a..874c94d08e06a 100644 --- a/src/test/ui/macros/macro-reexport-removed.rs +++ b/src/test/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 `macro_reexport` in this scope +#[macro_reexport(macro_one)] //~ ERROR cannot find attribute `macro_reexport` in this scope extern crate two_macros; fn main() {} diff --git a/src/test/ui/macros/macro-reexport-removed.stderr b/src/test/ui/macros/macro-reexport-removed.stderr index 25778fba68f7c..4bec70850aff7 100644 --- a/src/test/ui/macros/macro-reexport-removed.stderr +++ b/src/test/ui/macros/macro-reexport-removed.stderr @@ -10,7 +10,7 @@ note: subsumed by `pub use` LL | #![feature(macro_reexport)] | ^^^^^^^^^^^^^^ -error: cannot find attribute macro `macro_reexport` in this scope +error: cannot find attribute `macro_reexport` in this scope --> $DIR/macro-reexport-removed.rs:5:3 | LL | #[macro_reexport(macro_one)] diff --git a/src/test/ui/macros/macro-use-wrong-name.stderr b/src/test/ui/macros/macro-use-wrong-name.stderr index 28f727d6a5808..8b4e90a5798f1 100644 --- a/src/test/ui/macros/macro-use-wrong-name.stderr +++ b/src/test/ui/macros/macro-use-wrong-name.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `macro_two!` in this scope +error: cannot find macro `macro_two` in this scope --> $DIR/macro-use-wrong-name.rs:7:5 | LL | macro_two!(); diff --git a/src/test/ui/macros/macro_undefined.stderr b/src/test/ui/macros/macro_undefined.stderr index 9239b2a51e62b..01c8ebea62a2c 100644 --- a/src/test/ui/macros/macro_undefined.stderr +++ b/src/test/ui/macros/macro_undefined.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `k!` in this scope +error: cannot find macro `k` in this scope --> $DIR/macro_undefined.rs:11:5 | LL | k!(); diff --git a/src/test/ui/missing/missing-macro-use.rs b/src/test/ui/missing/missing-macro-use.rs index dff4c94fcf413..d494c4471a31c 100644 --- a/src/test/ui/missing/missing-macro-use.rs +++ b/src/test/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` in this scope } diff --git a/src/test/ui/missing/missing-macro-use.stderr b/src/test/ui/missing/missing-macro-use.stderr index 01a7beb3b0502..711e249d2bca1 100644 --- a/src/test/ui/missing/missing-macro-use.stderr +++ b/src/test/ui/missing/missing-macro-use.stderr @@ -1,4 +1,4 @@ -error: cannot find macro `macro_two!` in this scope +error: cannot find macro `macro_two` in this scope --> $DIR/missing-macro-use.rs:6:5 | LL | macro_two!(); diff --git a/src/test/ui/proc-macro/derive-still-gated.rs b/src/test/ui/proc-macro/derive-still-gated.rs index 4e6f9b072205d..3f8d6f0716b3a 100644 --- a/src/test/ui/proc-macro/derive-still-gated.rs +++ b/src/test/ui/proc-macro/derive-still-gated.rs @@ -3,7 +3,7 @@ #[macro_use] extern crate test_macros; -#[derive_Empty] //~ ERROR cannot find attribute macro `derive_Empty` in this scope +#[derive_Empty] //~ ERROR cannot find attribute `derive_Empty` in this scope struct A; fn main() {} diff --git a/src/test/ui/proc-macro/derive-still-gated.stderr b/src/test/ui/proc-macro/derive-still-gated.stderr index 4df1715db9467..99289fdfe7fd5 100644 --- a/src/test/ui/proc-macro/derive-still-gated.stderr +++ b/src/test/ui/proc-macro/derive-still-gated.stderr @@ -1,4 +1,4 @@ -error: cannot find attribute macro `derive_Empty` in this scope +error: cannot find attribute `derive_Empty` in this scope --> $DIR/derive-still-gated.rs:6:3 | LL | #[derive_Empty] diff --git a/src/test/ui/proc-macro/macro-namespace-reserved-2.rs b/src/test/ui/proc-macro/macro-namespace-reserved-2.rs index 8a26df9e76ade..b17c0565932fd 100644 --- a/src/test/ui/proc-macro/macro-namespace-reserved-2.rs +++ b/src/test/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` in this scope 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` in this scope 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 macro `my_macro` in this scope +#[my_macro] //~ ERROR cannot find attribute `my_macro` in this scope #[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() {} diff --git a/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr b/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr index 0c863e919670d..c011a70cd0c84 100644 --- a/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr +++ b/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr @@ -88,19 +88,19 @@ error: expected derive macro, found macro `crate::my_macro` LL | #[derive(crate::my_macro)] | ^^^^^^^^^^^^^^^ not a derive macro -error: cannot find macro `my_macro_attr!` in this scope +error: cannot find macro `my_macro_attr` in this scope --> $DIR/macro-namespace-reserved-2.rs:28:5 | LL | my_macro_attr!(); | ^^^^^^^^^^^^^ -error: cannot find macro `MyTrait!` in this scope +error: cannot find macro `MyTrait` in this scope --> $DIR/macro-namespace-reserved-2.rs:33:5 | LL | MyTrait!(); | ^^^^^^^ -error: cannot find attribute macro `my_macro` in this scope +error: cannot find attribute `my_macro` in this scope --> $DIR/macro-namespace-reserved-2.rs:38:3 | LL | #[my_macro] diff --git a/src/test/ui/proc-macro/proc-macro-attributes.rs b/src/test/ui/proc-macro/proc-macro-attributes.rs index 04215226c6d41..6401522bdf89c 100644 --- a/src/test/ui/proc-macro/proc-macro-attributes.rs +++ b/src/test/ui/proc-macro/proc-macro-attributes.rs @@ -4,7 +4,7 @@ extern crate derive_b; #[B] //~ ERROR `B` is ambiguous -#[C] //~ ERROR cannot find attribute macro `C` in this scope +#[C] //~ ERROR cannot find attribute `C` in this scope #[B(D)] //~ ERROR `B` is ambiguous #[B(E = "foo")] //~ ERROR `B` is ambiguous #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous diff --git a/src/test/ui/proc-macro/proc-macro-attributes.stderr b/src/test/ui/proc-macro/proc-macro-attributes.stderr index b068c6bc83bf3..3ac93a748523a 100644 --- a/src/test/ui/proc-macro/proc-macro-attributes.stderr +++ b/src/test/ui/proc-macro/proc-macro-attributes.stderr @@ -1,4 +1,4 @@ -error: cannot find attribute macro `C` in this scope +error: cannot find attribute `C` in this scope --> $DIR/proc-macro-attributes.rs:7:3 | LL | #[C] diff --git a/src/test/ui/proc-macro/resolve-error.rs b/src/test/ui/proc-macro/resolve-error.rs index 088f39c6665ff..d2282af27f543 100644 --- a/src/test/ui/proc-macro/resolve-error.rs +++ b/src/test/ui/proc-macro/resolve-error.rs @@ -24,11 +24,11 @@ macro_rules! attr_proc_mac { struct Foo; // Interpreted as an unstable custom attribute -#[attr_proc_macra] //~ ERROR cannot find attribute macro `attr_proc_macra` in this scope +#[attr_proc_macra] //~ ERROR cannot find attribute `attr_proc_macra` in this scope struct Bar; // Interpreted as an unstable custom attribute -#[FooWithLongNan] //~ ERROR cannot find attribute macro `FooWithLongNan` in this scope +#[FooWithLongNan] //~ ERROR cannot find attribute `FooWithLongNan` in this scope struct Asdf; #[derive(Dlone)] diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index 2a5f2b883813d..3dca5cee63caa 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -1,22 +1,22 @@ -error: cannot find macro `bang_proc_macrp!` in this scope +error: cannot find macro `bang_proc_macrp` in this scope --> $DIR/resolve-error.rs:56:5 | LL | bang_proc_macrp!(); | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` -error: cannot find macro `Dlona!` in this scope +error: cannot find macro `Dlona` in this scope --> $DIR/resolve-error.rs:53:5 | LL | Dlona!(); | ^^^^^ -error: cannot find macro `attr_proc_macra!` in this scope +error: cannot find macro `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:50:5 | LL | attr_proc_macra!(); | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac` -error: cannot find macro `FooWithLongNama!` in this scope +error: cannot find macro `FooWithLongNama` in this scope --> $DIR/resolve-error.rs:47:5 | LL | FooWithLongNama!(); @@ -40,13 +40,13 @@ error: cannot find derive macro `Dlone` in this scope LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` -error: cannot find attribute macro `FooWithLongNan` in this scope +error: cannot find attribute `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:31:3 | LL | #[FooWithLongNan] | ^^^^^^^^^^^^^^ -error: cannot find attribute macro `attr_proc_macra` in this scope +error: cannot find attribute `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:27:3 | LL | #[attr_proc_macra] diff --git a/src/test/ui/reserved/reserved-attr-on-macro.rs b/src/test/ui/reserved/reserved-attr-on-macro.rs index fddb991da822c..2630db0d09785 100644 --- a/src/test/ui/reserved/reserved-attr-on-macro.rs +++ b/src/test/ui/reserved/reserved-attr-on-macro.rs @@ -1,5 +1,5 @@ #[rustc_attribute_should_be_reserved] -//~^ ERROR cannot find attribute macro `rustc_attribute_should_be_reserved` in this scope +//~^ ERROR cannot find attribute `rustc_attribute_should_be_reserved` in this scope //~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler macro_rules! foo { diff --git a/src/test/ui/reserved/reserved-attr-on-macro.stderr b/src/test/ui/reserved/reserved-attr-on-macro.stderr index 856162b318dea..685960588a2cb 100644 --- a/src/test/ui/reserved/reserved-attr-on-macro.stderr +++ b/src/test/ui/reserved/reserved-attr-on-macro.stderr @@ -15,7 +15,7 @@ LL | foo!(); | = note: import resolution is stuck, try simplifying macro imports -error: cannot find attribute macro `rustc_attribute_should_be_reserved` in this scope +error: cannot find attribute `rustc_attribute_should_be_reserved` in this scope --> $DIR/reserved-attr-on-macro.rs:1:3 | LL | #[rustc_attribute_should_be_reserved] diff --git a/src/test/ui/resolve/visibility-indeterminate.rs b/src/test/ui/resolve/visibility-indeterminate.rs index 198ea752881f1..0e1142db37d2d 100644 --- a/src/test/ui/resolve/visibility-indeterminate.rs +++ b/src/test/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` in this scope pub(in ::bar) struct Baz {} //~ ERROR cannot determine resolution for the visibility diff --git a/src/test/ui/resolve/visibility-indeterminate.stderr b/src/test/ui/resolve/visibility-indeterminate.stderr index 17927a5967dcb..b9678291ee40b 100644 --- a/src/test/ui/resolve/visibility-indeterminate.stderr +++ b/src/test/ui/resolve/visibility-indeterminate.stderr @@ -4,7 +4,7 @@ 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 this scope --> $DIR/visibility-indeterminate.rs:3:1 | LL | foo!(); diff --git a/src/test/ui/self/self_type_keyword.rs b/src/test/ui/self/self_type_keyword.rs index 844f13c2f896a..dfb7d6583d9dd 100644 --- a/src/test/ui/self/self_type_keyword.rs +++ b/src/test/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` in this scope Foo { Self } => (), //~^ ERROR expected identifier, found keyword `Self` } diff --git a/src/test/ui/self/self_type_keyword.stderr b/src/test/ui/self/self_type_keyword.stderr index bb631194bf3df..11b3b012c5f5e 100644 --- a/src/test/ui/self/self_type_keyword.stderr +++ b/src/test/ui/self/self_type_keyword.stderr @@ -54,7 +54,7 @@ error: lifetimes cannot use keyword names LL | struct Bar<'Self>; | ^^^^^ -error: cannot find macro `Self!` in this scope +error: cannot find macro `Self` in this scope --> $DIR/self_type_keyword.rs:21:9 | LL | Self!() => (), diff --git a/src/test/ui/suggestions/attribute-typos.rs b/src/test/ui/suggestions/attribute-typos.rs index 74f63f2b0ed07..7c8231bbb24f8 100644 --- a/src/test/ui/suggestions/attribute-typos.rs +++ b/src/test/ui/suggestions/attribute-typos.rs @@ -1,11 +1,11 @@ -#[deprcated] //~ ERROR cannot find attribute macro `deprcated` in this scope +#[deprcated] //~ ERROR cannot find attribute `deprcated` in this scope fn foo() {} -#[tests] //~ ERROR cannot find attribute macro `tests` in this scope +#[tests] //~ ERROR cannot find attribute `tests` in this scope fn bar() {} #[rustc_err] -//~^ ERROR cannot find attribute macro `rustc_err` in this scope +//~^ ERROR cannot find attribute `rustc_err` in this scope //~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler fn main() {} diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr index 6b2f591b9e7d9..e40329382fd40 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/src/test/ui/suggestions/attribute-typos.stderr @@ -7,19 +7,19 @@ LL | #[rustc_err] = note: for more information, see https://github.com/rust-lang/rust/issues/29642 = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable -error: cannot find attribute macro `rustc_err` in this scope +error: cannot find attribute `rustc_err` in this scope --> $DIR/attribute-typos.rs:7:3 | LL | #[rustc_err] | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `rustc_error` -error: cannot find attribute macro `tests` in this scope +error: cannot find attribute `tests` in this scope --> $DIR/attribute-typos.rs:4:3 | LL | #[tests] | ^^^^^ help: an attribute macro with a similar name exists: `test` -error: cannot find attribute macro `deprcated` in this scope +error: cannot find attribute `deprcated` in this scope --> $DIR/attribute-typos.rs:1:3 | LL | #[deprcated] diff --git a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs index c07da4345f7d9..d5698be8d4c57 100644 --- a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs +++ b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs @@ -5,13 +5,13 @@ type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt:: struct S; // Interpreted as an unstable custom attribute -#[rustfmt] //~ ERROR cannot find attribute macro `rustfmt` in this scope +#[rustfmt] //~ ERROR cannot find attribute `rustfmt` in this scope 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` in this scope rustfmt::skip; //~ ERROR expected value, found tool attribute `rustfmt::skip` } diff --git a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr index 33581a170822b..6bef793e0e71b 100644 --- a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr +++ b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr @@ -4,13 +4,13 @@ error: cannot find derive macro `rustfmt` in this scope LL | #[derive(rustfmt)] | ^^^^^^^ -error: cannot find attribute macro `rustfmt` in this scope +error: cannot find attribute `rustfmt` in this scope --> $DIR/tool-attributes-misplaced-1.rs:8:3 | LL | #[rustfmt] | ^^^^^^^ -error: cannot find macro `rustfmt!` in this scope +error: cannot find macro `rustfmt` in this scope --> $DIR/tool-attributes-misplaced-1.rs:14:5 | LL | rustfmt!();