From 39c96a0f534366b3970ff0f8cd831be4386961dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 14 Oct 2019 17:20:50 -0700 Subject: [PATCH 1/4] Point at the span for the definition of crate foreign ADTs --- .../rmeta/decoder/cstore_impl.rs | 4 ++ src/librustc_resolve/diagnostics.rs | 8 +-- .../deriving-meta-unknown-trait.stderr | 5 ++ .../ui/empty/empty-struct-braces-expr.stderr | 20 ++++++++ .../ui/empty/empty-struct-braces-pat-1.stderr | 5 ++ .../ui/empty/empty-struct-braces-pat-2.stderr | 20 ++++++++ .../ui/empty/empty-struct-braces-pat-3.stderr | 10 ++++ .../ui/empty/empty-struct-tuple-pat.stderr | 5 ++ .../ui/empty/empty-struct-unit-pat.stderr | 30 ++++++++++++ src/test/ui/issues/issue-17546.stderr | 30 ++++++++++-- src/test/ui/issues/issue-7607-1.stderr | 13 ++++- src/test/ui/macros/macro-name-typo.stderr | 14 +++++- .../macros/macro-path-prelude-fail-3.stderr | 5 ++ .../ui/macros/macro-use-wrong-name.stderr | 5 ++ src/test/ui/namespace/namespace-mix.stderr | 10 ++++ .../ui/proc-macro/parent-source-spans.stderr | 15 ++++++ src/test/ui/proc-macro/resolve-error.stderr | 49 ++++++++++++++++--- src/test/ui/resolve/levenshtein.stderr | 15 +++++- .../ui/suggestions/attribute-typos.stderr | 5 ++ 19 files changed, 247 insertions(+), 21 deletions(-) diff --git a/src/librustc_metadata/rmeta/decoder/cstore_impl.rs b/src/librustc_metadata/rmeta/decoder/cstore_impl.rs index eb5754bf99bfb..cb7d031fdfef1 100644 --- a/src/librustc_metadata/rmeta/decoder/cstore_impl.rs +++ b/src/librustc_metadata/rmeta/decoder/cstore_impl.rs @@ -479,6 +479,10 @@ impl CStore { self.get_crate_data(cnum).source.clone() } + pub fn get_span_untracked(&self, def_id: DefId, sess: &Session) -> Span { + self.get_crate_data(def_id.krate).get_span(def_id.index, sess) + } + pub fn item_generics_num_lifetimes(&self, def_id: DefId, sess: &Session) -> usize { self.get_crate_data(def_id.krate).get_generics(def_id.index, sess).own_counts().lifetimes } diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index b81e71f0acfd7..6fd45e78f2d95 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -9,7 +9,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_feature::BUILTIN_ATTRIBUTES; use rustc_hir::def::Namespace::{self, *}; use rustc_hir::def::{self, DefKind, NonMacroAttrKind}; -use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX}; +use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_span::hygiene::MacroKind; use rustc_span::source_map::SourceMap; use rustc_span::symbol::{kw, Symbol}; @@ -780,8 +780,10 @@ impl<'a> Resolver<'a> { suggestion.candidate.to_string(), Applicability::MaybeIncorrect, ); - let def_span = - suggestion.res.opt_def_id().and_then(|def_id| self.definitions.opt_span(def_id)); + let def_span = suggestion.res.opt_def_id().and_then(|def_id| match def_id.krate { + LOCAL_CRATE => self.definitions.opt_span(def_id), + _ => Some(self.cstore().get_span_untracked(def_id, self.session)), + }); if let Some(span) = def_span { err.span_label( span, diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr index 8d0f9e9fc89a8..ab382e9284eb7 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr +++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr @@ -3,6 +3,11 @@ error: cannot find derive macro `Eqr` in this scope | LL | #[derive(Eqr)] | ^^^ help: a derive macro with a similar name exists: `Eq` + | + ::: $SRC_DIR/libcore/cmp.rs:LL:COL + | +LL | pub macro Eq($item:item) { /* compiler built-in */ } + | ---------------------------------------------------- similarly named derive macro `Eq` defined here error: cannot find derive macro `Eqr` in this scope --> $DIR/deriving-meta-unknown-trait.rs:1:10 diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr index f427c1ba0adfb..cccb06d49a6fe 100644 --- a/src/test/ui/empty/empty-struct-braces-expr.stderr +++ b/src/test/ui/empty/empty-struct-braces-expr.stderr @@ -9,6 +9,11 @@ LL | let e1 = Empty1; | | | did you mean `Empty1 { /* fields */ }`? | help: a unit struct with a similar name exists: `XEmpty2` + | + ::: $DIR/auxiliary/empty-struct.rs:2:1 + | +LL | pub struct XEmpty2; + | ------------------- similarly named unit struct `XEmpty2` defined here error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1` --> $DIR/empty-struct-braces-expr.rs:16:14 @@ -21,6 +26,11 @@ LL | let e1 = Empty1(); | | | did you mean `Empty1 { /* fields */ }`? | help: a unit struct with a similar name exists: `XEmpty2` + | + ::: $DIR/auxiliary/empty-struct.rs:2:1 + | +LL | pub struct XEmpty2; + | ------------------- similarly named unit struct `XEmpty2` defined here error[E0423]: expected value, found struct variant `E::Empty3` --> $DIR/empty-struct-braces-expr.rs:18:14 @@ -48,6 +58,11 @@ LL | let xe1 = XEmpty1; | | | did you mean `XEmpty1 { /* fields */ }`? | help: a unit struct with a similar name exists: `XEmpty2` + | + ::: $DIR/auxiliary/empty-struct.rs:2:1 + | +LL | pub struct XEmpty2; + | ------------------- similarly named unit struct `XEmpty2` defined here error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1` --> $DIR/empty-struct-braces-expr.rs:23:15 @@ -57,6 +72,11 @@ LL | let xe1 = XEmpty1(); | | | did you mean `XEmpty1 { /* fields */ }`? | help: a unit struct with a similar name exists: `XEmpty2` + | + ::: $DIR/auxiliary/empty-struct.rs:2:1 + | +LL | pub struct XEmpty2; + | ------------------- similarly named unit struct `XEmpty2` defined here error[E0599]: no variant or associated item named `Empty3` found for type `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:25:19 diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.stderr b/src/test/ui/empty/empty-struct-braces-pat-1.stderr index 9b5f31157d1bb..0ff21c91b78fd 100644 --- a/src/test/ui/empty/empty-struct-braces-pat-1.stderr +++ b/src/test/ui/empty/empty-struct-braces-pat-1.stderr @@ -15,6 +15,11 @@ LL | XE::XEmpty3 => () | | | | | help: a unit variant with a similar name exists: `XEmpty4` | did you mean `XE::XEmpty3 { /* fields */ }`? + | + ::: $DIR/auxiliary/empty-struct.rs:7:5 + | +LL | XEmpty4, + | ------- similarly named unit variant `XEmpty4` defined here error: aborting due to 2 previous errors diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.stderr b/src/test/ui/empty/empty-struct-braces-pat-2.stderr index 0b3c9ae51519e..80c29db8d9b77 100644 --- a/src/test/ui/empty/empty-struct-braces-pat-2.stderr +++ b/src/test/ui/empty/empty-struct-braces-pat-2.stderr @@ -9,6 +9,11 @@ LL | Empty1() => () | | | did you mean `Empty1 { /* fields */ }`? | help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` --> $DIR/empty-struct-braces-pat-2.rs:18:9 @@ -18,6 +23,11 @@ LL | XEmpty1() => () | | | did you mean `XEmpty1 { /* fields */ }`? | help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error[E0532]: expected tuple struct or tuple variant, found struct `Empty1` --> $DIR/empty-struct-braces-pat-2.rs:21:9 @@ -30,6 +40,11 @@ LL | Empty1(..) => () | | | did you mean `Empty1 { /* fields */ }`? | help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` --> $DIR/empty-struct-braces-pat-2.rs:24:9 @@ -39,6 +54,11 @@ LL | XEmpty1(..) => () | | | did you mean `XEmpty1 { /* fields */ }`? | help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error: aborting due to 4 previous errors diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.stderr b/src/test/ui/empty/empty-struct-braces-pat-3.stderr index 785396c448bb0..05439b39ea39d 100644 --- a/src/test/ui/empty/empty-struct-braces-pat-3.stderr +++ b/src/test/ui/empty/empty-struct-braces-pat-3.stderr @@ -15,6 +15,11 @@ LL | XE::XEmpty3() => () | | | | | help: a tuple variant with a similar name exists: `XEmpty5` | did you mean `XE::XEmpty3 { /* fields */ }`? + | + ::: $DIR/auxiliary/empty-struct.rs:8:5 + | +LL | XEmpty5(), + | --------- similarly named tuple variant `XEmpty5` defined here error[E0532]: expected tuple struct or tuple variant, found struct variant `E::Empty3` --> $DIR/empty-struct-braces-pat-3.rs:25:9 @@ -33,6 +38,11 @@ LL | XE::XEmpty3(..) => () | | | | | help: a tuple variant with a similar name exists: `XEmpty5` | did you mean `XE::XEmpty3 { /* fields */ }`? + | + ::: $DIR/auxiliary/empty-struct.rs:8:5 + | +LL | XEmpty5(), + | --------- similarly named tuple variant `XEmpty5` defined here error: aborting due to 4 previous errors diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr index cfbb468e5e633..9388ed2665710 100644 --- a/src/test/ui/empty/empty-struct-tuple-pat.stderr +++ b/src/test/ui/empty/empty-struct-tuple-pat.stderr @@ -33,6 +33,11 @@ LL | XE::XEmpty5 => (), | | | | | help: a unit variant with a similar name exists: `XEmpty4` | did you mean `XE::XEmpty5( /* fields */ )`? + | + ::: $DIR/auxiliary/empty-struct.rs:7:5 + | +LL | XEmpty4, + | ------- similarly named unit variant `XEmpty4` defined here error: aborting due to 4 previous errors diff --git a/src/test/ui/empty/empty-struct-unit-pat.stderr b/src/test/ui/empty/empty-struct-unit-pat.stderr index fd41a6ed38284..8ee14a3d01d89 100644 --- a/src/test/ui/empty/empty-struct-unit-pat.stderr +++ b/src/test/ui/empty/empty-struct-unit-pat.stderr @@ -3,24 +3,44 @@ error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2` | LL | Empty2() => () | ^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` --> $DIR/empty-struct-unit-pat.rs:24:9 | LL | XEmpty2() => () | ^^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2` --> $DIR/empty-struct-unit-pat.rs:28:9 | LL | Empty2(..) => () | ^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` --> $DIR/empty-struct-unit-pat.rs:32:9 | LL | XEmpty2(..) => () | ^^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` + | + ::: $DIR/auxiliary/empty-struct.rs:3:1 + | +LL | pub struct XEmpty6(); + | --------------------- similarly named tuple struct `XEmpty6` defined here error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:37:9 @@ -35,6 +55,11 @@ LL | XE::XEmpty4() => (), | ^^^^------- | | | help: a tuple variant with a similar name exists: `XEmpty5` + | + ::: $DIR/auxiliary/empty-struct.rs:8:5 + | +LL | XEmpty5(), + | --------- similarly named tuple variant `XEmpty5` defined here error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:46:9 @@ -49,6 +74,11 @@ LL | XE::XEmpty4(..) => (), | ^^^^------- | | | help: a tuple variant with a similar name exists: `XEmpty5` + | + ::: $DIR/auxiliary/empty-struct.rs:8:5 + | +LL | XEmpty5(), + | --------- similarly named tuple variant `XEmpty5` defined here error: aborting due to 8 previous errors diff --git a/src/test/ui/issues/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr index f3242919e0105..255521a0be90a 100644 --- a/src/test/ui/issues/issue-17546.stderr +++ b/src/test/ui/issues/issue-17546.stderr @@ -1,8 +1,19 @@ error[E0573]: expected type, found variant `NoResult` --> $DIR/issue-17546.rs:12:17 | -LL | fn new() -> NoResult { - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | fn new() -> NoResult { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | / pub enum Result { +LL | | /// Contains the success value +LL | | #[stable(feature = "rust1", since = "1.0.0")] +LL | | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), +... | +LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), +LL | | } + | |_- similarly named enum `Result` defined here | help: try using the variant's enum | @@ -52,8 +63,19 @@ LL | use std::result::Result; error[E0573]: expected type, found variant `NoResult` --> $DIR/issue-17546.rs:33:15 | -LL | fn newer() -> NoResult { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | fn newer() -> NoResult { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | / pub enum Result { +LL | | /// Contains the success value +LL | | #[stable(feature = "rust1", since = "1.0.0")] +LL | | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), +... | +LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), +LL | | } + | |_- similarly named enum `Result` defined here | help: try using the variant's enum | diff --git a/src/test/ui/issues/issue-7607-1.stderr b/src/test/ui/issues/issue-7607-1.stderr index 9320943a82766..40c25b9f78c55 100644 --- a/src/test/ui/issues/issue-7607-1.stderr +++ b/src/test/ui/issues/issue-7607-1.stderr @@ -1,8 +1,17 @@ error[E0412]: cannot find type `Fo` in this scope --> $DIR/issue-7607-1.rs:5:6 | -LL | impl Fo { - | ^^ help: a trait with a similar name exists: `Fn` +LL | impl Fo { + | ^^ help: a trait with a similar name exists: `Fn` + | + ::: $SRC_DIR/libcore/ops/function.rs:LL:COL + | +LL | / pub trait Fn : FnMut { +LL | | /// Performs the call operation. +LL | | #[unstable(feature = "fn_traits", issue = "29625")] +LL | | extern "rust-call" fn call(&self, args: Args) -> Self::Output; +LL | | } + | |_- similarly named trait `Fn` defined here error: aborting due to previous error diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr index ce2e1985b38ce..7e5dfe20e9616 100644 --- a/src/test/ui/macros/macro-name-typo.stderr +++ b/src/test/ui/macros/macro-name-typo.stderr @@ -1,8 +1,18 @@ 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` +LL | printlx!("oh noes!"); + | ^^^^^^^ help: a macro with a similar name exists: `println` + | + ::: $SRC_DIR/libstd/macros.rs:LL:COL + | +LL | / macro_rules! println { +LL | | () => ($crate::print!("\n")); +LL | | ($($arg:tt)*) => ({ +LL | | $crate::io::_print($crate::format_args_nl!($($arg)*)); +LL | | }) +LL | | } + | |_- similarly named macro `println` defined here error: aborting due to previous error 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 ec00760de6c6f..3d72cc82cbdfc 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-3.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-3.stderr @@ -3,6 +3,11 @@ error: cannot find macro `inline` in this scope | LL | inline!(); | ^^^^^^ help: a macro with a similar name exists: `line` + | + ::: $SRC_DIR/libcore/macros.rs:LL:COL + | +LL | macro_rules! line { () => { /* compiler built-in */ } } + | ------------------------------------------------------- similarly named macro `line` defined here error: aborting due to previous error diff --git a/src/test/ui/macros/macro-use-wrong-name.stderr b/src/test/ui/macros/macro-use-wrong-name.stderr index 8b4e90a5798f1..d76eb69b3c4c9 100644 --- a/src/test/ui/macros/macro-use-wrong-name.stderr +++ b/src/test/ui/macros/macro-use-wrong-name.stderr @@ -3,6 +3,11 @@ error: cannot find macro `macro_two` in this scope | LL | macro_two!(); | ^^^^^^^^^ help: a macro with a similar name exists: `macro_one` + | + ::: $DIR/auxiliary/two_macros.rs:2:1 + | +LL | macro_rules! macro_one { () => ("one") } + | ---------------------------------------- similarly named macro `macro_one` defined here error: aborting due to previous error diff --git a/src/test/ui/namespace/namespace-mix.stderr b/src/test/ui/namespace/namespace-mix.stderr index 0484661a2e154..13d727de441cb 100644 --- a/src/test/ui/namespace/namespace-mix.stderr +++ b/src/test/ui/namespace/namespace-mix.stderr @@ -24,6 +24,11 @@ error[E0423]: expected value, found type alias `xm1::S` | LL | check(xm1::S); | ^^^^^^ + | + ::: $DIR/auxiliary/namespace-mix.rs:3:5 + | +LL | pub struct TS(); + | ---------------- similarly named tuple struct `TS` defined here | = note: can't use a type alias as a constructor help: a tuple struct with a similar name exists @@ -64,6 +69,11 @@ error[E0423]: expected value, found struct variant `xm7::V` | LL | check(xm7::V); | ^^^^^^ did you mean `xm7::V { /* fields */ }`? + | + ::: $DIR/auxiliary/namespace-mix.rs:7:9 + | +LL | TV(), + | ---- similarly named tuple variant `TV` defined here | help: a tuple variant with a similar name exists | diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr index 3e54a71f0e810..2a36ac78d78c1 100644 --- a/src/test/ui/proc-macro/parent-source-spans.stderr +++ b/src/test/ui/proc-macro/parent-source-spans.stderr @@ -132,6 +132,11 @@ LL | parent_source_spans!($($tokens)*); ... LL | one!("hello", "world"); | ----------------------- in this macro invocation + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), + | --------------------------------------------------- similarly named tuple variant `Ok` defined here error[E0425]: cannot find value `ok` in this scope --> $DIR/parent-source-spans.rs:28:5 @@ -141,6 +146,11 @@ LL | parent_source_spans!($($tokens)*); ... LL | two!("yay", "rust"); | -------------------- in this macro invocation + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), + | --------------------------------------------------- similarly named tuple variant `Ok` defined here error[E0425]: cannot find value `ok` in this scope --> $DIR/parent-source-spans.rs:28:5 @@ -150,6 +160,11 @@ LL | parent_source_spans!($($tokens)*); ... LL | three!("hip", "hop"); | --------------------- in this macro invocation + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), + | --------------------------------------------------- similarly named tuple variant `Ok` defined here error: aborting due to 21 previous errors diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index f7e00ed77d9b0..4663a8df9daf0 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -1,8 +1,15 @@ 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` +LL | bang_proc_macrp!(); + | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` + | + ::: $DIR/auxiliary/test-macros.rs:15:1 + | +LL | / pub fn empty(_: TokenStream) -> TokenStream { +LL | | TokenStream::new() +LL | | } + | |_- similarly named macro `bang_proc_macro` defined here error: cannot find macro `Dlona` in this scope --> $DIR/resolve-error.rs:57:5 @@ -53,8 +60,15 @@ LL | #[derive(Dlona)] error: cannot find derive macro `Dlona` in this scope --> $DIR/resolve-error.rs:40:10 | -LL | #[derive(Dlona)] - | ^^^^^ help: a derive macro with a similar name exists: `Clona` +LL | #[derive(Dlona)] + | ^^^^^ 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 { +LL | | "".parse().unwrap() +LL | | } + | |_- similarly named derive macro `Clona` defined here error: cannot find derive macro `Dlone` in this scope --> $DIR/resolve-error.rs:35:10 @@ -67,6 +81,11 @@ error: cannot find derive macro `Dlone` in this scope | LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | pub macro Clone($item:item) { /* compiler built-in */ } + | ------------------------------------------------------- similarly named derive macro `Clone` defined here error: cannot find attribute `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:32:3 @@ -77,14 +96,28 @@ LL | #[FooWithLongNan] error: cannot find attribute `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:28:3 | -LL | #[attr_proc_macra] - | ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro` +LL | #[attr_proc_macra] + | ^^^^^^^^^^^^^^^ 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 { +LL | | TokenStream::new() +LL | | } + | |_- similarly named attribute macro `attr_proc_macro` defined here error: cannot find derive macro `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:22:10 | -LL | #[derive(FooWithLongNan)] - | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` +LL | #[derive(FooWithLongNan)] + | ^^^^^^^^^^^^^^ 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 { +LL | | "".parse().unwrap() +LL | | } + | |_- similarly named derive macro `FooWithLongName` defined here error: cannot find derive macro `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:22:10 diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index 8d8f3f35211e2..c7497afd0257d 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -16,8 +16,19 @@ LL | type A = Baz; // Misspelled type name. error[E0412]: cannot find type `Opiton` in this scope --> $DIR/levenshtein.rs:12:10 | -LL | type B = Opiton; // Misspelled type name from the prelude. - | ^^^^^^ help: an enum with a similar name exists: `Option` +LL | type B = Opiton; // Misspelled type name from the prelude. + | ^^^^^^ help: an enum with a similar name exists: `Option` + | + ::: $SRC_DIR/libcore/option.rs:LL:COL + | +LL | / pub enum Option { +LL | | /// No value +LL | | #[stable(feature = "rust1", since = "1.0.0")] +LL | | None, +... | +LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), +LL | | } + | |_- similarly named enum `Option` defined here error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:16:14 diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr index e40329382fd40..d91b1cc707cb7 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/src/test/ui/suggestions/attribute-typos.stderr @@ -18,6 +18,11 @@ error: cannot find attribute `tests` in this scope | LL | #[tests] | ^^^^^ help: an attribute macro with a similar name exists: `test` + | + ::: $SRC_DIR/libcore/macros.rs:LL:COL + | +LL | pub macro test($item:item) { /* compiler built-in */ } + | ------------------------------------------------------ similarly named attribute macro `test` defined here error: cannot find attribute `deprcated` in this scope --> $DIR/attribute-typos.rs:1:3 From 8eb7ac561eb42b70bc7db3852c502dd63186a119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 28 Oct 2019 14:48:49 -0700 Subject: [PATCH 2/4] Use `def_span` to minimize definition span to first line when possible --- src/librustc_resolve/diagnostics.rs | 5 ++- .../deriving-meta-unknown-trait.stderr | 2 +- src/test/ui/issues/issue-17546.stderr | 28 ++++--------- src/test/ui/issues/issue-7607-1.stderr | 12 ++---- src/test/ui/macros/macro-name-typo.stderr | 13 ++---- .../macros/macro-path-prelude-fail-3.stderr | 2 +- .../ui/macros/macro-use-wrong-name.stderr | 2 +- src/test/ui/proc-macro/resolve-error.stderr | 42 ++++++++----------- src/test/ui/resolve/levenshtein.stderr | 14 ++----- .../ui/suggestions/attribute-typos.stderr | 2 +- 10 files changed, 45 insertions(+), 77 deletions(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 6fd45e78f2d95..411a72447a4f6 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -782,7 +782,10 @@ impl<'a> Resolver<'a> { ); let def_span = suggestion.res.opt_def_id().and_then(|def_id| match def_id.krate { LOCAL_CRATE => self.definitions.opt_span(def_id), - _ => Some(self.cstore().get_span_untracked(def_id, self.session)), + _ => Some(self.session.source_map().def_span(self.cstore().get_span_untracked( + def_id, + self.session, + ))), }); if let Some(span) = def_span { err.span_label( diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr index ab382e9284eb7..666cc69f6e967 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr +++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr @@ -7,7 +7,7 @@ LL | #[derive(Eqr)] ::: $SRC_DIR/libcore/cmp.rs:LL:COL | LL | pub macro Eq($item:item) { /* compiler built-in */ } - | ---------------------------------------------------- similarly named derive macro `Eq` defined here + | ------------------------ similarly named derive macro `Eq` defined here error: cannot find derive macro `Eqr` in this scope --> $DIR/deriving-meta-unknown-trait.rs:1:10 diff --git a/src/test/ui/issues/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr index 255521a0be90a..5bbe6d3b17176 100644 --- a/src/test/ui/issues/issue-17546.stderr +++ b/src/test/ui/issues/issue-17546.stderr @@ -1,19 +1,13 @@ error[E0573]: expected type, found variant `NoResult` --> $DIR/issue-17546.rs:12:17 | -LL | fn new() -> NoResult { - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | fn new() -> NoResult { + | ^^^^^^^^^^^^^^^^^^^^^^^^ | ::: $SRC_DIR/libcore/result.rs:LL:COL | -LL | / pub enum Result { -LL | | /// Contains the success value -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), -... | -LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), -LL | | } - | |_- similarly named enum `Result` defined here +LL | pub enum Result { + | --------------------- similarly named enum `Result` defined here | help: try using the variant's enum | @@ -63,19 +57,13 @@ LL | use std::result::Result; error[E0573]: expected type, found variant `NoResult` --> $DIR/issue-17546.rs:33:15 | -LL | fn newer() -> NoResult { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | fn newer() -> NoResult { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ::: $SRC_DIR/libcore/result.rs:LL:COL | -LL | / pub enum Result { -LL | | /// Contains the success value -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), -... | -LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), -LL | | } - | |_- similarly named enum `Result` defined here +LL | pub enum Result { + | --------------------- similarly named enum `Result` defined here | help: try using the variant's enum | diff --git a/src/test/ui/issues/issue-7607-1.stderr b/src/test/ui/issues/issue-7607-1.stderr index 40c25b9f78c55..472f8e013a922 100644 --- a/src/test/ui/issues/issue-7607-1.stderr +++ b/src/test/ui/issues/issue-7607-1.stderr @@ -1,17 +1,13 @@ error[E0412]: cannot find type `Fo` in this scope --> $DIR/issue-7607-1.rs:5:6 | -LL | impl Fo { - | ^^ help: a trait with a similar name exists: `Fn` +LL | impl Fo { + | ^^ help: a trait with a similar name exists: `Fn` | ::: $SRC_DIR/libcore/ops/function.rs:LL:COL | -LL | / pub trait Fn : FnMut { -LL | | /// Performs the call operation. -LL | | #[unstable(feature = "fn_traits", issue = "29625")] -LL | | extern "rust-call" fn call(&self, args: Args) -> Self::Output; -LL | | } - | |_- similarly named trait `Fn` defined here +LL | pub trait Fn : FnMut { + | -------------------------------- similarly named trait `Fn` defined here error: aborting due to previous error diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr index 7e5dfe20e9616..5604341fa34dc 100644 --- a/src/test/ui/macros/macro-name-typo.stderr +++ b/src/test/ui/macros/macro-name-typo.stderr @@ -1,18 +1,13 @@ 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` +LL | printlx!("oh noes!"); + | ^^^^^^^ help: a macro with a similar name exists: `println` | ::: $SRC_DIR/libstd/macros.rs:LL:COL | -LL | / macro_rules! println { -LL | | () => ($crate::print!("\n")); -LL | | ($($arg:tt)*) => ({ -LL | | $crate::io::_print($crate::format_args_nl!($($arg)*)); -LL | | }) -LL | | } - | |_- similarly named macro `println` defined here +LL | macro_rules! println { + | -------------------- similarly named macro `println` defined here error: aborting due to previous error 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 3d72cc82cbdfc..e26a914e243ee 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-3.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-3.stderr @@ -7,7 +7,7 @@ LL | inline!(); ::: $SRC_DIR/libcore/macros.rs:LL:COL | LL | macro_rules! line { () => { /* compiler built-in */ } } - | ------------------------------------------------------- similarly named macro `line` defined here + | ----------------- similarly named macro `line` defined here error: aborting due to previous error diff --git a/src/test/ui/macros/macro-use-wrong-name.stderr b/src/test/ui/macros/macro-use-wrong-name.stderr index d76eb69b3c4c9..74fb519cc82ff 100644 --- a/src/test/ui/macros/macro-use-wrong-name.stderr +++ b/src/test/ui/macros/macro-use-wrong-name.stderr @@ -7,7 +7,7 @@ LL | macro_two!(); ::: $DIR/auxiliary/two_macros.rs:2:1 | LL | macro_rules! macro_one { () => ("one") } - | ---------------------------------------- similarly named macro `macro_one` defined here + | ---------------------- similarly named macro `macro_one` defined here error: aborting due to previous error diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index 4663a8df9daf0..61868f4203bb0 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -1,15 +1,13 @@ 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` +LL | bang_proc_macrp!(); + | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` | ::: $DIR/auxiliary/test-macros.rs:15:1 | -LL | / pub fn empty(_: TokenStream) -> TokenStream { -LL | | TokenStream::new() -LL | | } - | |_- similarly named macro `bang_proc_macro` defined here +LL | pub fn empty(_: TokenStream) -> TokenStream { + | ------------------------------------------- similarly named macro `bang_proc_macro` defined here error: cannot find macro `Dlona` in this scope --> $DIR/resolve-error.rs:57:5 @@ -60,15 +58,13 @@ LL | #[derive(Dlona)] error: cannot find derive macro `Dlona` in this scope --> $DIR/resolve-error.rs:40:10 | -LL | #[derive(Dlona)] - | ^^^^^ help: a derive macro with a similar name exists: `Clona` +LL | #[derive(Dlona)] + | ^^^^^ 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 { -LL | | "".parse().unwrap() -LL | | } - | |_- similarly named derive macro `Clona` defined here +LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { + | ------------------------------------------------------- similarly named derive macro `Clona` defined here error: cannot find derive macro `Dlone` in this scope --> $DIR/resolve-error.rs:35:10 @@ -85,7 +81,7 @@ LL | #[derive(Dlone)] ::: $SRC_DIR/libcore/clone.rs:LL:COL | LL | pub macro Clone($item:item) { /* compiler built-in */ } - | ------------------------------------------------------- similarly named derive macro `Clone` defined here + | --------------------------- similarly named derive macro `Clone` defined here error: cannot find attribute `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:32:3 @@ -96,28 +92,24 @@ LL | #[FooWithLongNan] error: cannot find attribute `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:28:3 | -LL | #[attr_proc_macra] - | ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro` +LL | #[attr_proc_macra] + | ^^^^^^^^^^^^^^^ 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 { -LL | | TokenStream::new() -LL | | } - | |_- similarly named attribute macro `attr_proc_macro` defined here +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 --> $DIR/resolve-error.rs:22:10 | -LL | #[derive(FooWithLongNan)] - | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` +LL | #[derive(FooWithLongNan)] + | ^^^^^^^^^^^^^^ 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 { -LL | | "".parse().unwrap() -LL | | } - | |_- similarly named derive macro `FooWithLongName` defined here +LL | pub fn derive_foo(input: TokenStream) -> TokenStream { + | ---------------------------------------------------- similarly named derive macro `FooWithLongName` defined here error: cannot find derive macro `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:22:10 diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index c7497afd0257d..a176a19da08a2 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -16,19 +16,13 @@ LL | type A = Baz; // Misspelled type name. error[E0412]: cannot find type `Opiton` in this scope --> $DIR/levenshtein.rs:12:10 | -LL | type B = Opiton; // Misspelled type name from the prelude. - | ^^^^^^ help: an enum with a similar name exists: `Option` +LL | type B = Opiton; // Misspelled type name from the prelude. + | ^^^^^^ help: an enum with a similar name exists: `Option` | ::: $SRC_DIR/libcore/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | None, -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), -LL | | } - | |_- similarly named enum `Option` defined here +LL | pub enum Option { + | ------------------ similarly named enum `Option` defined here error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:16:14 diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr index d91b1cc707cb7..952ed26ccc07a 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/src/test/ui/suggestions/attribute-typos.stderr @@ -22,7 +22,7 @@ LL | #[tests] ::: $SRC_DIR/libcore/macros.rs:LL:COL | LL | pub macro test($item:item) { /* compiler built-in */ } - | ------------------------------------------------------ similarly named attribute macro `test` defined here + | -------------------------- similarly named attribute macro `test` defined here error: cannot find attribute `deprcated` in this scope --> $DIR/attribute-typos.rs:1:3 From 6d97718886eadcbce29950db8fc05dc86f7d89d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Tue, 7 Jan 2020 12:22:47 -0800 Subject: [PATCH 3/4] ./x.py fmt --- src/librustc_resolve/diagnostics.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 411a72447a4f6..e3ae5672d4008 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -782,10 +782,11 @@ impl<'a> Resolver<'a> { ); let def_span = suggestion.res.opt_def_id().and_then(|def_id| match def_id.krate { LOCAL_CRATE => self.definitions.opt_span(def_id), - _ => Some(self.session.source_map().def_span(self.cstore().get_span_untracked( - def_id, - self.session, - ))), + _ => Some( + self.session + .source_map() + .def_span(self.cstore().get_span_untracked(def_id, self.session)), + ), }); if let Some(span) = def_span { err.span_label( From 38a3506c451d097ed19263b3734421b3e5ee5bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Tue, 7 Jan 2020 12:59:24 -0800 Subject: [PATCH 4/4] Ignore platforms that can't point to std --- .../ui/derives/deriving-meta-unknown-trait.rs | 4 ++ .../deriving-meta-unknown-trait.stderr | 11 +++-- src/test/ui/issues/issue-17546.rs | 4 ++ src/test/ui/issues/issue-17546.stderr | 8 ++-- src/test/ui/issues/issue-7607-1.rs | 4 ++ src/test/ui/issues/issue-7607-1.stderr | 6 +-- src/test/ui/macros/macro-name-typo.rs | 4 ++ src/test/ui/macros/macro-name-typo.stderr | 2 +- .../ui/macros/macro-path-prelude-fail-3.rs | 4 ++ .../macros/macro-path-prelude-fail-3.stderr | 6 +-- src/test/ui/proc-macro/parent-source-spans.rs | 4 ++ .../ui/proc-macro/parent-source-spans.stderr | 42 ++++++++--------- src/test/ui/proc-macro/resolve-error.rs | 4 ++ src/test/ui/proc-macro/resolve-error.stderr | 45 ++++++++++++------- src/test/ui/resolve/levenshtein.rs | 4 ++ src/test/ui/resolve/levenshtein.stderr | 16 +++---- src/test/ui/suggestions/attribute-typos.rs | 4 ++ .../ui/suggestions/attribute-typos.stderr | 12 ++--- 18 files changed, 120 insertions(+), 64 deletions(-) diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.rs b/src/test/ui/derives/deriving-meta-unknown-trait.rs index 6463a7664de93..d1af5b458cc0a 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.rs +++ b/src/test/ui/derives/deriving-meta-unknown-trait.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl #[derive(Eqr)] //~^ ERROR cannot find derive macro `Eqr` in this scope //~| ERROR cannot find derive macro `Eqr` in this scope diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr index 666cc69f6e967..ead131323246a 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr +++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr @@ -1,19 +1,24 @@ error: cannot find derive macro `Eqr` in this scope - --> $DIR/deriving-meta-unknown-trait.rs:1:10 + --> $DIR/deriving-meta-unknown-trait.rs:5:10 | LL | #[derive(Eqr)] | ^^^ help: a derive macro with a similar name exists: `Eq` | ::: $SRC_DIR/libcore/cmp.rs:LL:COL | -LL | pub macro Eq($item:item) { /* compiler built-in */ } +LL | pub macro Eq($item:item) { | ------------------------ similarly named derive macro `Eq` defined here error: cannot find derive macro `Eqr` in this scope - --> $DIR/deriving-meta-unknown-trait.rs:1:10 + --> $DIR/deriving-meta-unknown-trait.rs:5:10 | LL | #[derive(Eqr)] | ^^^ help: a derive macro with a similar name exists: `Eq` + | + ::: $SRC_DIR/libcore/cmp.rs:LL:COL + | +LL | pub macro Eq($item:item) { + | ------------------------ similarly named derive macro `Eq` defined here error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-17546.rs b/src/test/ui/issues/issue-17546.rs index dbfdad25e5be8..c93a03cdec66a 100644 --- a/src/test/ui/issues/issue-17546.rs +++ b/src/test/ui/issues/issue-17546.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl use foo::MyEnum::Result; use foo::NoResult; // Through a re-export diff --git a/src/test/ui/issues/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr index 5bbe6d3b17176..2d532cdb9d8a9 100644 --- a/src/test/ui/issues/issue-17546.stderr +++ b/src/test/ui/issues/issue-17546.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `NoResult` - --> $DIR/issue-17546.rs:12:17 + --> $DIR/issue-17546.rs:16:17 | LL | fn new() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | fn new() -> Result { | ^^^^^^ error[E0573]: expected type, found variant `Result` - --> $DIR/issue-17546.rs:22:17 + --> $DIR/issue-17546.rs:26:17 | LL | fn new() -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type @@ -37,7 +37,7 @@ LL | use std::result::Result; and 1 other candidate error[E0573]: expected type, found variant `Result` - --> $DIR/issue-17546.rs:28:13 + --> $DIR/issue-17546.rs:32:13 | LL | fn new() -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type @@ -55,7 +55,7 @@ LL | use std::result::Result; and 1 other candidate error[E0573]: expected type, found variant `NoResult` - --> $DIR/issue-17546.rs:33:15 + --> $DIR/issue-17546.rs:37:15 | LL | fn newer() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-7607-1.rs b/src/test/ui/issues/issue-7607-1.rs index 5221f2c529bc6..1571cd2bbf683 100644 --- a/src/test/ui/issues/issue-7607-1.rs +++ b/src/test/ui/issues/issue-7607-1.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl struct Foo { x: isize } diff --git a/src/test/ui/issues/issue-7607-1.stderr b/src/test/ui/issues/issue-7607-1.stderr index 472f8e013a922..94f489e209e32 100644 --- a/src/test/ui/issues/issue-7607-1.stderr +++ b/src/test/ui/issues/issue-7607-1.stderr @@ -1,13 +1,13 @@ error[E0412]: cannot find type `Fo` in this scope - --> $DIR/issue-7607-1.rs:5:6 + --> $DIR/issue-7607-1.rs:9:6 | LL | impl Fo { | ^^ help: a trait with a similar name exists: `Fn` | ::: $SRC_DIR/libcore/ops/function.rs:LL:COL | -LL | pub trait Fn : FnMut { - | -------------------------------- similarly named trait `Fn` defined here +LL | pub trait Fn: FnMut { + | ------------------------------- similarly named trait `Fn` defined here error: aborting due to previous error diff --git a/src/test/ui/macros/macro-name-typo.rs b/src/test/ui/macros/macro-name-typo.rs index 1ddc419d302ac..b2892f3b6c239 100644 --- a/src/test/ui/macros/macro-name-typo.rs +++ b/src/test/ui/macros/macro-name-typo.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl fn main() { printlx!("oh noes!"); //~ ERROR cannot find } diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr index 5604341fa34dc..00afbde8932fc 100644 --- a/src/test/ui/macros/macro-name-typo.stderr +++ b/src/test/ui/macros/macro-name-typo.stderr @@ -1,5 +1,5 @@ error: cannot find macro `printlx` in this scope - --> $DIR/macro-name-typo.rs:2:5 + --> $DIR/macro-name-typo.rs:6:5 | LL | printlx!("oh noes!"); | ^^^^^^^ help: a macro with a similar name exists: `println` 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 68eb350a95614..3c3948ca3c361 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,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl fn main() { 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 e26a914e243ee..536459067437d 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-3.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-3.stderr @@ -1,12 +1,12 @@ error: cannot find macro `inline` in this scope - --> $DIR/macro-path-prelude-fail-3.rs:2:5 + --> $DIR/macro-path-prelude-fail-3.rs:6:5 | LL | inline!(); | ^^^^^^ help: a macro with a similar name exists: `line` | - ::: $SRC_DIR/libcore/macros.rs:LL:COL + ::: $SRC_DIR/libcore/macros/mod.rs:LL:COL | -LL | macro_rules! line { () => { /* compiler built-in */ } } +LL | macro_rules! line { | ----------------- similarly named macro `line` defined here error: aborting due to previous error diff --git a/src/test/ui/proc-macro/parent-source-spans.rs b/src/test/ui/proc-macro/parent-source-spans.rs index 7b2ffefb05b19..95a3f96951270 100644 --- a/src/test/ui/proc-macro/parent-source-spans.rs +++ b/src/test/ui/proc-macro/parent-source-spans.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl // aux-build:parent-source-spans.rs #![feature(decl_macro, proc_macro_hygiene)] diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr index 2a36ac78d78c1..9f0fefcfe6c03 100644 --- a/src/test/ui/proc-macro/parent-source-spans.stderr +++ b/src/test/ui/proc-macro/parent-source-spans.stderr @@ -1,5 +1,5 @@ error: first final: "hello" - --> $DIR/parent-source-spans.rs:15:12 + --> $DIR/parent-source-spans.rs:19:12 | LL | three!($a, $b); | ^^ @@ -8,7 +8,7 @@ LL | one!("hello", "world"); | ----------------------- in this macro invocation error: second final: "world" - --> $DIR/parent-source-spans.rs:15:16 + --> $DIR/parent-source-spans.rs:19:16 | LL | three!($a, $b); | ^^ @@ -17,7 +17,7 @@ LL | one!("hello", "world"); | ----------------------- in this macro invocation error: first parent: "hello" - --> $DIR/parent-source-spans.rs:9:5 + --> $DIR/parent-source-spans.rs:13:5 | LL | two!($a, $b); | ^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | one!("hello", "world"); | ----------------------- in this macro invocation error: second parent: "world" - --> $DIR/parent-source-spans.rs:9:5 + --> $DIR/parent-source-spans.rs:13:5 | LL | two!($a, $b); | ^^^^^^^^^^^^^ @@ -35,31 +35,31 @@ LL | one!("hello", "world"); | ----------------------- in this macro invocation error: first grandparent: "hello" - --> $DIR/parent-source-spans.rs:35:5 + --> $DIR/parent-source-spans.rs:39:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ error: second grandparent: "world" - --> $DIR/parent-source-spans.rs:35:5 + --> $DIR/parent-source-spans.rs:39:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ error: first source: "hello" - --> $DIR/parent-source-spans.rs:35:5 + --> $DIR/parent-source-spans.rs:39:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ error: second source: "world" - --> $DIR/parent-source-spans.rs:35:5 + --> $DIR/parent-source-spans.rs:39:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ error: first final: "yay" - --> $DIR/parent-source-spans.rs:15:12 + --> $DIR/parent-source-spans.rs:19:12 | LL | three!($a, $b); | ^^ @@ -68,7 +68,7 @@ LL | two!("yay", "rust"); | -------------------- in this macro invocation error: second final: "rust" - --> $DIR/parent-source-spans.rs:15:16 + --> $DIR/parent-source-spans.rs:19:16 | LL | three!($a, $b); | ^^ @@ -77,55 +77,55 @@ LL | two!("yay", "rust"); | -------------------- in this macro invocation error: first parent: "yay" - --> $DIR/parent-source-spans.rs:41:5 + --> $DIR/parent-source-spans.rs:45:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: second parent: "rust" - --> $DIR/parent-source-spans.rs:41:5 + --> $DIR/parent-source-spans.rs:45:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: first source: "yay" - --> $DIR/parent-source-spans.rs:41:5 + --> $DIR/parent-source-spans.rs:45:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: second source: "rust" - --> $DIR/parent-source-spans.rs:41:5 + --> $DIR/parent-source-spans.rs:45:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: first final: "hip" - --> $DIR/parent-source-spans.rs:47:12 + --> $DIR/parent-source-spans.rs:51:12 | LL | three!("hip", "hop"); | ^^^^^ error: second final: "hop" - --> $DIR/parent-source-spans.rs:47:19 + --> $DIR/parent-source-spans.rs:51:19 | LL | three!("hip", "hop"); | ^^^^^ error: first source: "hip" - --> $DIR/parent-source-spans.rs:47:12 + --> $DIR/parent-source-spans.rs:51:12 | LL | three!("hip", "hop"); | ^^^^^ error: second source: "hop" - --> $DIR/parent-source-spans.rs:47:19 + --> $DIR/parent-source-spans.rs:51:19 | LL | three!("hip", "hop"); | ^^^^^ error[E0425]: cannot find value `ok` in this scope - --> $DIR/parent-source-spans.rs:28:5 + --> $DIR/parent-source-spans.rs:32:5 | LL | parent_source_spans!($($tokens)*); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok` @@ -139,7 +139,7 @@ LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), | --------------------------------------------------- similarly named tuple variant `Ok` defined here error[E0425]: cannot find value `ok` in this scope - --> $DIR/parent-source-spans.rs:28:5 + --> $DIR/parent-source-spans.rs:32:5 | LL | parent_source_spans!($($tokens)*); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok` @@ -153,7 +153,7 @@ LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), | --------------------------------------------------- similarly named tuple variant `Ok` defined here error[E0425]: cannot find value `ok` in this scope - --> $DIR/parent-source-spans.rs:28:5 + --> $DIR/parent-source-spans.rs:32:5 | LL | parent_source_spans!($($tokens)*); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok` diff --git a/src/test/ui/proc-macro/resolve-error.rs b/src/test/ui/proc-macro/resolve-error.rs index ad8a5bbb0f9ff..8ff36ff0a26e2 100644 --- a/src/test/ui/proc-macro/resolve-error.rs +++ b/src/test/ui/proc-macro/resolve-error.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl // aux-build:derive-foo.rs // aux-build:derive-clona.rs // aux-build:test-macros.rs diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index 61868f4203bb0..73a6ab1cfb910 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -1,5 +1,5 @@ error: cannot find macro `bang_proc_macrp` in this scope - --> $DIR/resolve-error.rs:60:5 + --> $DIR/resolve-error.rs:64:5 | LL | bang_proc_macrp!(); | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` @@ -10,13 +10,13 @@ LL | pub fn empty(_: TokenStream) -> TokenStream { | ------------------------------------------- similarly named macro `bang_proc_macro` defined here error: cannot find macro `Dlona` in this scope - --> $DIR/resolve-error.rs:57:5 + --> $DIR/resolve-error.rs:61:5 | LL | Dlona!(); | ^^^^^ error: cannot find macro `attr_proc_macra` in this scope - --> $DIR/resolve-error.rs:54:5 + --> $DIR/resolve-error.rs:58:5 | LL | / macro_rules! attr_proc_mac { LL | | () => {} @@ -27,7 +27,7 @@ LL | attr_proc_macra!(); | ^^^^^^^^^^^^^^^ 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 + --> $DIR/resolve-error.rs:55:5 | LL | / macro_rules! FooWithLongNam { LL | | () => {} @@ -38,25 +38,30 @@ LL | FooWithLongNama!(); | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam` error: cannot find derive macro `attr_proc_macra` in this scope - --> $DIR/resolve-error.rs:45:10 + --> $DIR/resolve-error.rs:49:10 | LL | #[derive(attr_proc_macra)] | ^^^^^^^^^^^^^^^ error: cannot find derive macro `attr_proc_macra` in this scope - --> $DIR/resolve-error.rs:45:10 + --> $DIR/resolve-error.rs:49:10 | LL | #[derive(attr_proc_macra)] | ^^^^^^^^^^^^^^^ error: cannot find derive macro `Dlona` in this scope - --> $DIR/resolve-error.rs:40:10 + --> $DIR/resolve-error.rs:44:10 | LL | #[derive(Dlona)] | ^^^^^ 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 - --> $DIR/resolve-error.rs:40:10 + --> $DIR/resolve-error.rs:44:10 | LL | #[derive(Dlona)] | ^^^^^ help: a derive macro with a similar name exists: `Clona` @@ -67,30 +72,35 @@ LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { | ------------------------------------------------------- similarly named derive macro `Clona` defined here error: cannot find derive macro `Dlone` in this scope - --> $DIR/resolve-error.rs:35:10 + --> $DIR/resolve-error.rs:39:10 | LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | pub macro Clone($item:item) { + | --------------------------- similarly named derive macro `Clone` defined here error: cannot find derive macro `Dlone` in this scope - --> $DIR/resolve-error.rs:35:10 + --> $DIR/resolve-error.rs:39:10 | LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` | ::: $SRC_DIR/libcore/clone.rs:LL:COL | -LL | pub macro Clone($item:item) { /* compiler built-in */ } +LL | pub macro Clone($item:item) { | --------------------------- similarly named derive macro `Clone` defined here error: cannot find attribute `FooWithLongNan` in this scope - --> $DIR/resolve-error.rs:32:3 + --> $DIR/resolve-error.rs:36:3 | LL | #[FooWithLongNan] | ^^^^^^^^^^^^^^ error: cannot find attribute `attr_proc_macra` in this scope - --> $DIR/resolve-error.rs:28:3 + --> $DIR/resolve-error.rs:32:3 | LL | #[attr_proc_macra] | ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro` @@ -101,7 +111,7 @@ 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 - --> $DIR/resolve-error.rs:22:10 + --> $DIR/resolve-error.rs:26:10 | LL | #[derive(FooWithLongNan)] | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` @@ -112,10 +122,15 @@ LL | pub fn derive_foo(input: TokenStream) -> TokenStream { | ---------------------------------------------------- similarly named derive macro `FooWithLongName` defined here error: cannot find derive macro `FooWithLongNan` in this scope - --> $DIR/resolve-error.rs:22:10 + --> $DIR/resolve-error.rs:26:10 | LL | #[derive(FooWithLongNan)] | ^^^^^^^^^^^^^^ 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: aborting due to 14 previous errors diff --git a/src/test/ui/resolve/levenshtein.rs b/src/test/ui/resolve/levenshtein.rs index a6f4716256881..6a98782a9badf 100644 --- a/src/test/ui/resolve/levenshtein.rs +++ b/src/test/ui/resolve/levenshtein.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl const MAX_ITEM: usize = 10; fn foo_bar() {} diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index a176a19da08a2..a622d6cb34948 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -1,11 +1,11 @@ error[E0412]: cannot find type `esize` in this scope - --> $DIR/levenshtein.rs:5:11 + --> $DIR/levenshtein.rs:9:11 | LL | fn foo(c: esize) {} // Misspelled primitive type name. | ^^^^^ help: a builtin type with a similar name exists: `isize` error[E0412]: cannot find type `Baz` in this scope - --> $DIR/levenshtein.rs:10:10 + --> $DIR/levenshtein.rs:14:10 | LL | enum Bar { } | ------------ similarly named enum `Bar` defined here @@ -14,7 +14,7 @@ LL | type A = Baz; // Misspelled type name. | ^^^ help: an enum with a similar name exists: `Bar` error[E0412]: cannot find type `Opiton` in this scope - --> $DIR/levenshtein.rs:12:10 + --> $DIR/levenshtein.rs:16:10 | LL | type B = Opiton; // Misspelled type name from the prelude. | ^^^^^^ help: an enum with a similar name exists: `Option` @@ -25,13 +25,13 @@ LL | pub enum Option { | ------------------ similarly named enum `Option` defined here error[E0412]: cannot find type `Baz` in this scope - --> $DIR/levenshtein.rs:16:14 + --> $DIR/levenshtein.rs:20:14 | LL | type A = Baz; // No suggestion here, Bar is not visible | ^^^ not found in this scope error[E0425]: cannot find value `MAXITEM` in this scope - --> $DIR/levenshtein.rs:24:20 + --> $DIR/levenshtein.rs:28:20 | LL | const MAX_ITEM: usize = 10; | --------------------------- similarly named constant `MAX_ITEM` defined here @@ -40,7 +40,7 @@ LL | let v = [0u32; MAXITEM]; // Misspelled constant name. | ^^^^^^^ help: a constant with a similar name exists: `MAX_ITEM` error[E0425]: cannot find function `foobar` in this scope - --> $DIR/levenshtein.rs:26:5 + --> $DIR/levenshtein.rs:30:5 | LL | fn foo_bar() {} | --------------- similarly named function `foo_bar` defined here @@ -49,7 +49,7 @@ LL | foobar(); // Misspelled function name. | ^^^^^^ help: a function with a similar name exists: `foo_bar` error[E0412]: cannot find type `first` in module `m` - --> $DIR/levenshtein.rs:28:15 + --> $DIR/levenshtein.rs:32:15 | LL | pub struct First; | ----------------- similarly named struct `First` defined here @@ -58,7 +58,7 @@ LL | let b: m::first = m::second; // Misspelled item in module. | ^^^^^ help: a struct with a similar name exists (notice the capitalization): `First` error[E0425]: cannot find value `second` in module `m` - --> $DIR/levenshtein.rs:28:26 + --> $DIR/levenshtein.rs:32:26 | LL | pub struct Second; | ------------------ similarly named unit struct `Second` defined here diff --git a/src/test/ui/suggestions/attribute-typos.rs b/src/test/ui/suggestions/attribute-typos.rs index 7c8231bbb24f8..e1e3317093a31 100644 --- a/src/test/ui/suggestions/attribute-typos.rs +++ b/src/test/ui/suggestions/attribute-typos.rs @@ -1,3 +1,7 @@ +// FIXME: missing sysroot spans (#53081) +// ignore-i586-unknown-linux-gnu +// ignore-i586-unknown-linux-musl +// ignore-i686-unknown-linux-musl #[deprcated] //~ ERROR cannot find attribute `deprcated` in this scope fn foo() {} diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr index 952ed26ccc07a..a0943592539af 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/src/test/ui/suggestions/attribute-typos.stderr @@ -1,5 +1,5 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rustc` compiler - --> $DIR/attribute-typos.rs:7:3 + --> $DIR/attribute-typos.rs:11:3 | LL | #[rustc_err] | ^^^^^^^^^ @@ -8,24 +8,24 @@ LL | #[rustc_err] = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable error: cannot find attribute `rustc_err` in this scope - --> $DIR/attribute-typos.rs:7:3 + --> $DIR/attribute-typos.rs:11:3 | LL | #[rustc_err] | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `rustc_error` error: cannot find attribute `tests` in this scope - --> $DIR/attribute-typos.rs:4:3 + --> $DIR/attribute-typos.rs:8:3 | LL | #[tests] | ^^^^^ help: an attribute macro with a similar name exists: `test` | - ::: $SRC_DIR/libcore/macros.rs:LL:COL + ::: $SRC_DIR/libcore/macros/mod.rs:LL:COL | -LL | pub macro test($item:item) { /* compiler built-in */ } +LL | pub macro test($item:item) { | -------------------------- similarly named attribute macro `test` defined here error: cannot find attribute `deprcated` in this scope - --> $DIR/attribute-typos.rs:1:3 + --> $DIR/attribute-typos.rs:5:3 | LL | #[deprcated] | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `deprecated`