From 94a33cb550e615eedfc9c4382deaf8a1f68cc360 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 13 Jan 2024 18:15:36 -0800 Subject: [PATCH 1/2] Add test of compiler build date note --- src/tests/gated-feature.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/tests/gated-feature.rs diff --git a/src/tests/gated-feature.rs b/src/tests/gated-feature.rs new file mode 100644 index 0000000..9300297 --- /dev/null +++ b/src/tests/gated-feature.rs @@ -0,0 +1,20 @@ +test_normalize! {" +error[E0658]: `#[used(linker)]` is currently unstable + --> tests/ui/used-linker.rs:6:5 + | +6 | #![used(linker)] + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #93798 for more information + = help: add `#![feature(used_with_arg)]` to the crate attributes to enable + = note: this compiler was built on 2024-01-13; consider upgrading it if it is out of date +" " +error[E0658]: `#[used(linker)]` is currently unstable + --> tests/ui/used-linker.rs:6:5 + | +6 | #![used(linker)] + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #93798 for more information + = help: add `#![feature(used_with_arg)]` to the crate attributes to enable +"} From 7126507ebffc717ed815e53c5a504cc422be11ae Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 13 Jan 2024 18:20:16 -0800 Subject: [PATCH 2/2] Normalize compiler build date note --- src/normalize.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/normalize.rs b/src/normalize.rs index 8171114..bb1285b 100644 --- a/src/normalize.rs +++ b/src/normalize.rs @@ -336,6 +336,12 @@ impl<'a> Filter<'a> { return None; } + if trim_start.starts_with("= note: this compiler was built on 2") + && trim_start.ends_with("; consider upgrading it if it is out of date") + { + return None; + } + if self.normalization >= StripCouldNotCompile { if line.starts_with("error: Could not compile `") { return None;