Skip to content

Commit 44cde5d

Browse files
committed
Update error annotations in tests that successfully compile
Those annotation are silently ignored rather than begin validated against compiler output. Update them before validation is enabled, to avoid test failures.
1 parent b596a81 commit 44cde5d

16 files changed

+245
-229
lines changed

src/test/ui/conditional-compilation/cfg-attr-multi-true.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ impl MustUseDeprecated { //~ warning: use of deprecated item
1717

1818
fn main() {
1919
MustUseDeprecated::new(); //~ warning: use of deprecated item
20-
//| warning: unused `MustUseDeprecated` that must be used
20+
//~| warning: unused `MustUseDeprecated` that must be used
2121
}

src/test/ui/const-generics/cannot-infer-type-for-const-param.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88
struct Foo<const NUM_BYTES: usize>(pub [u8; NUM_BYTES]);
99

1010
fn main() {
11-
let _ = Foo::<3>([1, 2, 3]); //~ ERROR type annotations needed
12-
//~^ ERROR mismatched types
11+
let _ = Foo::<3>([1, 2, 3]);
1312
}

src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ impl<const L: usize> BitLen for [u8; L] {
1212
}
1313

1414
fn main() {
15-
let foo = <[u8; 2]>::BIT_LEN;
15+
let foo = <[u8; 2]>::BIT_LEN; //~ WARN unused variable
1616
}

src/test/ui/derive-uninhabited-enum-38885.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ enum Void {}
1010
#[derive(Debug)]
1111
enum Foo {
1212
Bar(u8),
13-
Void(Void), //~ WARN never used
13+
Void(Void), //~ WARN never constructed
1414
}
1515

1616
fn main() {

src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
// Exception, a gated and deprecated attribute.
3939

4040
#![plugin_registrar] //~ WARN unused attribute
41+
//~| WARN use of deprecated attribute
4142

4243
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
4344

@@ -90,7 +91,7 @@
9091
#![crate_id = "10"] //~ WARN use of deprecated attribute
9192

9293
// FIXME(#44232) we should warn that this isn't used.
93-
#![feature(rust1)]
94+
#![feature(rust1)] //~ WARN no longer requires an attribute to enable
9495

9596
#![no_start] //~ WARN use of deprecated attribute
9697

@@ -215,20 +216,25 @@ mod macro_export {
215216

216217
#[plugin_registrar]
217218
//~^ WARN unused attribute
219+
//~| WARN use of deprecated attribute
218220
mod plugin_registrar {
219221
mod inner { #![plugin_registrar] }
220222
//~^ WARN unused attribute
223+
//~| WARN use of deprecated attribute
221224

222225
// for `fn f()` case, see gated-plugin_registrar.rs
223226

224227
#[plugin_registrar] struct S;
225228
//~^ WARN unused attribute
229+
//~| WARN use of deprecated attribute
226230

227231
#[plugin_registrar] type T = S;
228232
//~^ WARN unused attribute
233+
//~| WARN use of deprecated attribute
229234

230235
#[plugin_registrar] impl S { }
231236
//~^ WARN unused attribute
237+
//~| WARN use of deprecated attribute
232238
}
233239

234240
#[main]

0 commit comments

Comments
 (0)