From 6dc27bf7de8dd306baba6e6904fa5234bc56d9f1 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Mon, 19 Jan 2026 21:50:29 +0100 Subject: [PATCH] Update uitests --- tests/pretty/delegation-inherit-attributes.pp | 2 +- tests/pretty/delegation-inline-attribute.pp | 20 ++++++------- ...ute-rejects-already-stable-features.stderr | 28 +++++++++---------- tests/ui/loop-match/invalid-attribute.stderr | 16 +++++------ 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/pretty/delegation-inherit-attributes.pp b/tests/pretty/delegation-inherit-attributes.pp index 2398cae90fdb..9d51a80da7b9 100644 --- a/tests/pretty/delegation-inherit-attributes.pp +++ b/tests/pretty/delegation-inherit-attributes.pp @@ -21,8 +21,8 @@ mod to_reuse { #[attr = Cold] fn foo_no_reason(x: usize) -> usize { x } - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] #[attr = Cold] + #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] fn bar(x: usize) -> usize { x } } diff --git a/tests/pretty/delegation-inline-attribute.pp b/tests/pretty/delegation-inline-attribute.pp index 5235fd8d0ef2..f83ae47b81f6 100644 --- a/tests/pretty/delegation-inline-attribute.pp +++ b/tests/pretty/delegation-inline-attribute.pp @@ -44,9 +44,9 @@ impl Trait for S { fn foo0(arg0: _) -> _ { to_reuse::foo(self + 1) } // Check that #[inline(hint)] is added when other attributes present in inner reuse - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] - #[attr = MustUse] #[attr = Cold] + #[attr = MustUse] + #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] #[attr = Inline(Hint)] fn foo1(arg0: _) -> _ { to_reuse::foo(self / 2) } @@ -59,18 +59,18 @@ impl Trait for S { fn foo3(arg0: _) -> _ { to_reuse::foo(self / 2) } // Check that #[inline(never)] is preserved when there are other attributes in inner reuse - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] - #[attr = Inline(Never)] - #[attr = MustUse] #[attr = Cold] + #[attr = MustUse] + #[attr = Inline(Never)] + #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] fn foo4(arg0: _) -> _ { to_reuse::foo(self / 2) } }.foo() } // Check that #[inline(hint)] is added when there are other attributes present in trait reuse - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] - #[attr = MustUse] #[attr = Cold] + #[attr = MustUse] + #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] #[attr = Inline(Hint)] fn foo1(self: _) -> _ { self.0.foo1() } @@ -83,10 +83,10 @@ impl Trait for S { fn foo3(self: _) -> _ { self.0.foo3() } // Check that #[inline(never)] is preserved when there are other attributes in trait reuse - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] - #[attr = Inline(Never)] - #[attr = MustUse] #[attr = Cold] + #[attr = MustUse] + #[attr = Inline(Never)] + #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] fn foo4(self: _) -> _ { self.0.foo4() } } diff --git a/tests/ui/feature-gates/unstable-attribute-rejects-already-stable-features.stderr b/tests/ui/feature-gates/unstable-attribute-rejects-already-stable-features.stderr index d599523c7274..319056a9c889 100644 --- a/tests/ui/feature-gates/unstable-attribute-rejects-already-stable-features.stderr +++ b/tests/ui/feature-gates/unstable-attribute-rejects-already-stable-features.stderr @@ -1,17 +1,3 @@ -error: can't mark as unstable using an already stable feature - --> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1 - | -LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this feature is already stable -LL | const fn my_fun() {} - | -------------------- the stability attribute annotates this item - | -help: consider removing the attribute - --> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1 - | -LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error: can't mark as unstable using an already stable feature --> $DIR/unstable-attribute-rejects-already-stable-features.rs:6:1 | @@ -27,5 +13,19 @@ help: consider removing the attribute LL | #[unstable(feature = "arbitrary_enum_discriminant", issue = "42")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: can't mark as unstable using an already stable feature + --> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1 + | +LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this feature is already stable +LL | const fn my_fun() {} + | -------------------- the stability attribute annotates this item + | +help: consider removing the attribute + --> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1 + | +LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: aborting due to 2 previous errors diff --git a/tests/ui/loop-match/invalid-attribute.stderr b/tests/ui/loop-match/invalid-attribute.stderr index ddb68aea31b6..c23452b9b844 100644 --- a/tests/ui/loop-match/invalid-attribute.stderr +++ b/tests/ui/loop-match/invalid-attribute.stderr @@ -94,14 +94,6 @@ LL | #[const_continue] | = help: `#[const_continue]` can be applied to -error: `#[const_continue]` should be applied to a break expression - --> $DIR/invalid-attribute.rs:40:9 - | -LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ -LL | 5 - | - not a break expression - error: `#[loop_match]` should be applied to a loop --> $DIR/invalid-attribute.rs:39:9 | @@ -111,5 +103,13 @@ LL | #[const_continue] LL | 5 | - not a loop +error: `#[const_continue]` should be applied to a break expression + --> $DIR/invalid-attribute.rs:40:9 + | +LL | #[const_continue] + | ^^^^^^^^^^^^^^^^^ +LL | 5 + | - not a break expression + error: aborting due to 14 previous errors