Skip to content
/ rust Public
forked from rust-lang/rust

Commit c1b8b7e

Browse files
committed
Auto merge of rust-lang#139555 - petrochenkov:errkind-ann, r=jieyouxu
UI tests: add missing diagnostic kinds where possible The subset of rust-lang#139427 that only adds diagnostic kinds to line annotations, without changing any other things in annotations or compiletest. After this only non-viral `NOTE`s and `HELP`s should be missing. r? `@jieyouxu`
2 parents de5b8a4 + b3f7535 commit c1b8b7e

File tree

370 files changed

+930
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+930
-928
lines changed

tests/rustdoc-ui/invalid-syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn baz() {}
4747
///
4848
/// Indented block end
4949
pub fn quux() {}
50-
//~^^^^^ could not parse code block as Rust code
50+
//~^^^^^ WARN could not parse code block as Rust code
5151

5252
/// Unclosed fence
5353
///

tests/rustdoc-ui/issues/ice-generic-type-alias-105742.rs

+37-37
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,63 @@ use std::ops::Index;
55
pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
66
//~^ expected 1 lifetime argument
77
//~| expected 1 generic argument
8-
//~| the trait `SVec` is not dyn compatible
8+
//~| ERROR the trait `SVec` is not dyn compatible
99
//~| `SVec` is not dyn compatible
10-
//~| missing generics for associated type `SVec::Item`
11-
//~| missing generics for associated type `SVec::Item`
10+
//~| ERROR missing generics for associated type `SVec::Item`
11+
//~| ERROR missing generics for associated type `SVec::Item`
1212
let _ = s;
1313
}
1414

1515
pub trait SVec: Index<
1616
<Self as SVec>::Item,
1717
//~^ expected 1 lifetime argument
1818
//~| expected 1 generic argument
19-
//~| missing generics for associated type `SVec::Item`
20-
//~| missing generics for associated type `SVec::Item`
21-
//~| missing generics for associated type `SVec::Item`
22-
//~| missing generics for associated type `SVec::Item`
23-
//~| missing generics for associated type `SVec::Item`
24-
//~| missing generics for associated type `SVec::Item`
25-
//~| missing generics for associated type `SVec::Item`
26-
//~| missing generics for associated type `SVec::Item`
19+
//~| ERROR missing generics for associated type `SVec::Item`
20+
//~| ERROR missing generics for associated type `SVec::Item`
21+
//~| ERROR missing generics for associated type `SVec::Item`
22+
//~| ERROR missing generics for associated type `SVec::Item`
23+
//~| ERROR missing generics for associated type `SVec::Item`
24+
//~| ERROR missing generics for associated type `SVec::Item`
25+
//~| ERROR missing generics for associated type `SVec::Item`
26+
//~| ERROR missing generics for associated type `SVec::Item`
2727
Output = <Index<<Self as SVec>::Item,
2828
//~^ expected 1 lifetime argument
2929
//~| expected 1 generic argument
30-
//~| missing generics for associated type `SVec::Item`
31-
//~| missing generics for associated type `SVec::Item`
32-
//~| missing generics for associated type `SVec::Item`
33-
//~| missing generics for associated type `SVec::Item`
34-
//~| missing generics for associated type `SVec::Item`
35-
//~| missing generics for associated type `SVec::Item`
36-
//~| missing generics for associated type `SVec::Item`
37-
//~| missing generics for associated type `SVec::Item`
30+
//~| ERROR missing generics for associated type `SVec::Item`
31+
//~| ERROR missing generics for associated type `SVec::Item`
32+
//~| ERROR missing generics for associated type `SVec::Item`
33+
//~| ERROR missing generics for associated type `SVec::Item`
34+
//~| ERROR missing generics for associated type `SVec::Item`
35+
//~| ERROR missing generics for associated type `SVec::Item`
36+
//~| ERROR missing generics for associated type `SVec::Item`
37+
//~| ERROR missing generics for associated type `SVec::Item`
3838
Output = <Self as SVec>::Item> as SVec>::Item,
3939
//~^ expected 1 lifetime argument
4040
//~| expected 1 generic argument
4141
//~| expected 1 lifetime argument
42-
//~| missing generics for associated type `SVec::Item`
43-
//~| missing generics for associated type `SVec::Item`
44-
//~| missing generics for associated type `SVec::Item`
45-
//~| missing generics for associated type `SVec::Item`
46-
//~| missing generics for associated type `SVec::Item`
47-
//~| missing generics for associated type `SVec::Item`
42+
//~| ERROR missing generics for associated type `SVec::Item`
43+
//~| ERROR missing generics for associated type `SVec::Item`
44+
//~| ERROR missing generics for associated type `SVec::Item`
45+
//~| ERROR missing generics for associated type `SVec::Item`
46+
//~| ERROR missing generics for associated type `SVec::Item`
47+
//~| ERROR missing generics for associated type `SVec::Item`
4848
//~| expected 1 generic argument
49-
//~| missing generics for associated type `SVec::Item`
50-
//~| missing generics for associated type `SVec::Item`
51-
//~| missing generics for associated type `SVec::Item`
52-
//~| missing generics for associated type `SVec::Item`
53-
//~| missing generics for associated type `SVec::Item`
54-
//~| missing generics for associated type `SVec::Item`
55-
//~| missing generics for associated type `SVec::Item`
56-
//~| missing generics for associated type `SVec::Item`
57-
//~| missing generics for associated type `SVec::Item`
58-
//~| missing generics for associated type `SVec::Item`
49+
//~| ERROR missing generics for associated type `SVec::Item`
50+
//~| ERROR missing generics for associated type `SVec::Item`
51+
//~| ERROR missing generics for associated type `SVec::Item`
52+
//~| ERROR missing generics for associated type `SVec::Item`
53+
//~| ERROR missing generics for associated type `SVec::Item`
54+
//~| ERROR missing generics for associated type `SVec::Item`
55+
//~| ERROR missing generics for associated type `SVec::Item`
56+
//~| ERROR missing generics for associated type `SVec::Item`
57+
//~| ERROR missing generics for associated type `SVec::Item`
58+
//~| ERROR missing generics for associated type `SVec::Item`
5959
> {
6060
type Item<'a, T>;
6161

6262
fn len(&self) -> <Self as SVec>::Item;
6363
//~^ expected 1 lifetime argument
64-
//~| missing generics for associated type `SVec::Item`
64+
//~| ERROR missing generics for associated type `SVec::Item`
6565
//~| expected 1 generic argument
66-
//~| missing generics for associated type `SVec::Item`
66+
//~| ERROR missing generics for associated type `SVec::Item`
6767
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// https://github.com/rust-lang/rust/issues/102986
22
struct Struct {
33
y: (typeof("hey"),),
4-
//~^ `typeof` is a reserved keyword but unimplemented
4+
//~^ ERROR `typeof` is a reserved keyword but unimplemented
55
}

tests/ui-fulldeps/hash-stable-is-unstable.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
//@ compile-flags: -Zdeduplicate-diagnostics=yes
22
extern crate rustc_data_structures;
3-
//~^ use of unstable library feature `rustc_private`
3+
//~^ ERROR use of unstable library feature `rustc_private`
44
//~| NOTE: issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
55
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
66
extern crate rustc_macros;
7-
//~^ use of unstable library feature `rustc_private`
7+
//~^ ERROR use of unstable library feature `rustc_private`
88
//~| NOTE: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
99
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010
extern crate rustc_query_system;
11-
//~^ use of unstable library feature `rustc_private`
11+
//~^ ERROR use of unstable library feature `rustc_private`
1212
//~| NOTE: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
1313
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1414

1515
use rustc_macros::HashStable;
16-
//~^ use of unstable library feature `rustc_private`
16+
//~^ ERROR use of unstable library feature `rustc_private`
1717
//~| NOTE: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
1818
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1919

2020
#[derive(HashStable)]
21-
//~^ use of unstable library feature `rustc_private`
21+
//~^ ERROR use of unstable library feature `rustc_private`
2222
//~| NOTE: in this expansion of #[derive(HashStable)]
2323
//~| NOTE: in this expansion of #[derive(HashStable)]
2424
//~| NOTE: in this expansion of #[derive(HashStable)]

tests/ui-fulldeps/try-from-u32/errors.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ extern crate rustc_macros;
88
use rustc_macros::TryFromU32;
99

1010
#[derive(TryFromU32)]
11-
struct MyStruct {} //~ type is not an enum
11+
struct MyStruct {} //~ ERROR type is not an enum
1212

1313
#[derive(TryFromU32)]
1414
enum NonTrivial {
1515
A,
1616
B(),
1717
C {},
18-
D(bool), //~ enum variant cannot have fields
19-
E(bool, bool), //~ enum variant cannot have fields
20-
F { x: bool }, //~ enum variant cannot have fields
21-
G { x: bool, y: bool }, //~ enum variant cannot have fields
18+
D(bool), //~ ERROR enum variant cannot have fields
19+
E(bool, bool), //~ ERROR enum variant cannot have fields
20+
F { x: bool }, //~ ERROR enum variant cannot have fields
21+
G { x: bool, y: bool }, //~ ERROR enum variant cannot have fields
2222
}
2323

2424
fn main() {}

tests/ui/abi/simd-abi-checks-avx.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ use std::arch::x86_64::*;
1414
struct Wrapper(__m256);
1515

1616
unsafe extern "C" fn w(_: Wrapper) {
17-
//~^ requires the `avx` target feature, which is not enabled
17+
//~^ WARN requires the `avx` target feature, which is not enabled
1818
//~| WARNING this was previously accepted by the compiler
1919
todo!()
2020
}
2121

2222
unsafe extern "C" fn f(_: __m256) {
23-
//~^ requires the `avx` target feature, which is not enabled
23+
//~^ WARN requires the `avx` target feature, which is not enabled
2424
//~| WARNING this was previously accepted by the compiler
2525
todo!()
2626
}
2727

2828
unsafe extern "C" fn g() -> __m256 {
29-
//~^ requires the `avx` target feature, which is not enabled
29+
//~^ WARN requires the `avx` target feature, which is not enabled
3030
//~| WARNING this was previously accepted by the compiler
3131
todo!()
3232
}

tests/ui/abi/simd-abi-checks-empty-list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ use minicore::*;
1414
pub struct SimdVec([i32; 4]);
1515

1616
pub extern "C" fn pass_by_vec(_: SimdVec) {}
17-
//~^ this function definition uses SIMD vector type `SimdVec` which is not currently supported with the chosen ABI
17+
//~^ WARN this function definition uses SIMD vector type `SimdVec` which is not currently supported with the chosen ABI
1818
//~| WARNING this was previously accepted by the compiler

tests/ui/abi/simd-abi-checks-sse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ pub struct SseVector([i64; 2]);
1818

1919
#[no_mangle]
2020
pub unsafe extern "C" fn f(_: SseVector) {
21-
//~^ this function definition uses SIMD vector type `SseVector` which (with the chosen ABI) requires the `sse` target feature, which is not enabled
21+
//~^ WARN this function definition uses SIMD vector type `SseVector` which (with the chosen ABI) requires the `sse` target feature, which is not enabled
2222
//~| WARNING this was previously accepted by the compiler
2323
}

tests/ui/abi/vectorcall-abi-checks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use minicore::*;
1111

1212
#[no_mangle]
1313
pub extern "vectorcall" fn f() {
14-
//~^ ABI "vectorcall" which requires the `sse2` target feature
14+
//~^ ERROR ABI "vectorcall" which requires the `sse2` target feature
1515
}
1616

1717
#[no_mangle]
1818
pub fn call_site() {
1919
f();
20-
//~^ ABI "vectorcall" which requires the `sse2` target feature
20+
//~^ ERROR ABI "vectorcall" which requires the `sse2` target feature
2121
}

tests/ui/anon-params/anon-params-denied-2018.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ edition:2018
44

55
trait T {
6-
fn foo(i32); //~ expected one of `:`, `@`, or `|`, found `)`
6+
fn foo(i32); //~ ERROR expected one of `:`, `@`, or `|`, found `)`
77

88
// Also checks with `&`
99
fn foo_with_ref(&mut i32);

tests/ui/argument-suggestions/issue-100478.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn main() {
4545
let p8 = Arc::default();
4646

4747
foo(
48-
//~^ 47:5: 47:8: this function takes 8 arguments but 7 arguments were supplied [E0061]
48+
//~^ ERROR this function takes 8 arguments but 7 arguments were supplied [E0061]
4949
p1, //p2,
5050
p3, p4, p5, p6, p7, p8,
5151
);

tests/ui/argument-suggestions/issue-101097.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn f(
1515
fn main() {
1616
f(C, A, A, A, B, B, C); //~ ERROR function takes 6 arguments but 7 arguments were supplied [E0061]
1717
f(C, C, A, A, B, B); //~ ERROR arguments to this function are incorrect [E0308]
18-
f(A, A, D, D, B, B); //~ arguments to this function are incorrect [E0308]
19-
f(C, C, B, B, A, A); //~ arguments to this function are incorrect [E0308]
20-
f(C, C, A, B, A, A); //~ arguments to this function are incorrect [E0308]
18+
f(A, A, D, D, B, B); //~ ERROR arguments to this function are incorrect [E0308]
19+
f(C, C, B, B, A, A); //~ ERROR arguments to this function are incorrect [E0308]
20+
f(C, C, A, B, A, A); //~ ERROR arguments to this function are incorrect [E0308]
2121
}

tests/ui/array-slice-vec/array_const_index-0.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const A: &'static [i32] = &[];
22
const B: i32 = (&A)[1];
3-
//~^ index out of bounds: the length is 0 but the index is 1
3+
//~^ NOTE index out of bounds: the length is 0 but the index is 1
44
//~| ERROR evaluation of constant value failed
55

66
fn main() {

tests/ui/array-slice-vec/array_const_index-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const A: [i32; 0] = [];
22
const B: i32 = A[1];
3-
//~^ index out of bounds: the length is 0 but the index is 1
3+
//~^ NOTE index out of bounds: the length is 0 but the index is 1
44
//~| ERROR evaluation of constant value failed
55

66
fn main() {

tests/ui/asm/issue-85247.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ use minicore::*;
1818
fn main() {
1919
unsafe {
2020
asm!("", out("r9") _);
21-
//[rwpi]~^ cannot use register `r9`
21+
//[rwpi]~^ ERROR cannot use register `r9`
2222
}
2323
}

tests/ui/asm/issue-99071.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ use minicore::*;
1313
pub fn foo() {
1414
unsafe {
1515
asm!("", in("r8") 0);
16-
//~^ cannot use register `r8`: high registers (r8+) can only be used as clobbers in Thumb-1 code
16+
//~^ ERROR cannot use register `r8`: high registers (r8+) can only be used as clobbers in Thumb-1 code
1717
}
1818
}

tests/ui/asm/type-check-4.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ fn main() {
1111
let mut a = 0isize;
1212
let p = &a;
1313
asm!("{}", out(reg) a);
14-
//~^ cannot assign to `a` because it is borrowed
14+
//~^ ERROR cannot assign to `a` because it is borrowed
1515
println!("{}", p);
1616

1717
// Can't read from mutable borrowed values.
1818

1919
let mut a = 0isize;
2020
let p = &mut a;
2121
asm!("{}", in(reg) a);
22-
//~^ cannot use `a` because it was mutably borrowed
22+
//~^ ERROR cannot use `a` because it was mutably borrowed
2323
println!("{}", p);
2424
}
2525
}

tests/ui/asm/x86_64/issue-82869.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ pub unsafe fn aarch64(a: f64, b: f64) -> f64 {
1212
|| {};
1313
b
1414
});
15-
//~^^^^ invalid register class
16-
//~^^^^^ invalid register class
17-
//~^^^^^^ invalid register
15+
//~^^^^ ERROR invalid register class
16+
//~^^^^^ ERROR invalid register class
17+
//~^^^^^^ ERROR invalid register
1818
c
1919
}
2020

tests/ui/associated-consts/defaults-cyclic-fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Cyclic assoc. const defaults don't error unless *used*
44
trait Tr {
55
const A: u8 = Self::B;
6-
//~^ cycle detected
6+
//~^ ERROR cycle detected
77

88
const B: u8 = Self::A;
99
}

tests/ui/associated-inherent-types/generic-associated-types-bad.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ impl Ty {
1313
}
1414

1515
#[cfg(item)]
16-
const _: Ty::Pr<String> = String::new(); //[item]~ the trait bound `String: Copy` is not satisfied
17-
//[item]~^ the trait bound `String: Copy` is not satisfied
16+
const _: Ty::Pr<String> = String::new(); //[item]~ ERROR the trait bound `String: Copy` is not satisfied
17+
//[item]~^ ERROR the trait bound `String: Copy` is not satisfied
1818

1919
fn main() {
2020
#[cfg(local)]

tests/ui/associated-type-bounds/return-type-notation/path-missing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ where
1717
fn type_dependent<T: A>()
1818
where
1919
T::method(..): Send,
20-
//~^ associated function `method` not found for `T`
20+
//~^ ERROR associated function `method` not found for `T`
2121
{
2222
}
2323

tests/ui/associated-types/hr-associated-type-bound-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ where
88
}
99
}
1010

11-
impl X<'_> for u32 //~ overflow evaluating the requirement `for<'b> u32: X<'b>`
11+
impl X<'_> for u32 //~ ERROR overflow evaluating the requirement `for<'b> u32: X<'b>`
1212
where
1313
for<'b> <Self as X<'b>>::U: Clone,
1414
{

tests/ui/associated-types/hr-associated-type-bound-param-2.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
trait Z<'a, T: ?Sized>
22
where
33
T: Z<'a, u16>,
4-
//~^ the trait bound `str: Clone` is not satisfied
5-
//~| the trait bound `str: Clone` is not satisfied
4+
//~^ ERROR the trait bound `str: Clone` is not satisfied
5+
//~| ERROR the trait bound `str: Clone` is not satisfied
66
for<'b> <T as Z<'b, u16>>::W: Clone,
77
{
88
type W: ?Sized;
99
fn h(&self, x: &T::W) {
1010
<T::W>::clone(x);
11-
//~^ the trait bound `str: Clone` is not satisfied
12-
//~| the trait bound `str: Clone` is not satisfied
13-
//~| the trait bound `str: Clone` is not satisfied
11+
//~^ ERROR the trait bound `str: Clone` is not satisfied
12+
//~| ERROR the trait bound `str: Clone` is not satisfied
13+
//~| ERROR the trait bound `str: Clone` is not satisfied
1414
}
1515
}
1616

tests/ui/associated-types/hr-associated-type-projection-1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ where
1212

1313
impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
1414
type Item = T;
15-
//~^ type mismatch resolving `<T as Deref>::Target == T`
15+
//~^ ERROR type mismatch resolving `<T as Deref>::Target == T`
1616
}
1717

1818
pub fn main() {
1919
<&'static str>::bug(&"");
20-
//~^ type mismatch resolving `<&str as Deref>::Target == &str`
20+
//~^ ERROR type mismatch resolving `<&str as Deref>::Target == &str`
2121
}

tests/ui/associated-types/issue-85103-layout-debug.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ use std::borrow::Cow;
44

55
#[rustc_layout(debug)]
66
type Edges<'a, E> = Cow<'a, [E]>;
7-
//~^ the trait bound `[E]: ToOwned` is not satisfied
7+
//~^ ERROR the trait bound `[E]: ToOwned` is not satisfied
88

99
fn main() {}

0 commit comments

Comments
 (0)