Skip to content

Commit 427952e

Browse files
committed
Make error and warning annotations mandatory in UI tests
This change makes error and warning annotations mandatory in UI tests. The only exception are tests that use error patterns to match compiler output and don't have any annotations.
1 parent 70b146c commit 427952e

File tree

75 files changed

+380
-326
lines changed

Some content is hidden

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

75 files changed

+380
-326
lines changed

src/test/ui/associated-type-bounds/dyn-lcsit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![feature(associated_type_bounds)]
44
#![feature(impl_trait_in_bindings)]
5-
5+
//~^ WARNING `impl_trait_in_bindings` is incomplete
66
#![allow(non_upper_case_globals)]
77

88
use std::ops::Add;

src/test/ui/associated-type-bounds/lcsit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![feature(associated_type_bounds)]
44
#![feature(impl_trait_in_bindings)]
5-
5+
//~^ WARNING `impl_trait_in_bindings` is incomplete
66
#![allow(non_upper_case_globals)]
77

88
use std::ops::Add;
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// check-pass
22

33
#![feature(associated_type_bounds)]
44

5-
type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
6-
type _TaWhere2<T> where T: Iterator<Item: 'static> = T;
7-
type _TaWhere3<T> where T: Iterator<Item: 'static> = T;
8-
type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T;
9-
type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T;
10-
type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T;
5+
type _TaWhere1<T> where T: Iterator<Item: Copy> = T; //~ WARNING type_alias_bounds
6+
type _TaWhere2<T> where T: Iterator<Item: 'static> = T; //~ WARNING type_alias_bounds
7+
type _TaWhere3<T> where T: Iterator<Item: 'static> = T; //~ WARNING type_alias_bounds
8+
type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T; //~ WARNING type_alias_bounds
9+
type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T; //~ WARNING type_alias_bounds
10+
type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T; //~ WARNING type_alias_bounds
1111

12-
type _TaInline1<T: Iterator<Item: Copy>> = T;
13-
type _TaInline2<T: Iterator<Item: 'static>> = T;
14-
type _TaInline3<T: Iterator<Item: 'static>> = T;
15-
type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T;
16-
type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T;
17-
type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T;
12+
type _TaInline1<T: Iterator<Item: Copy>> = T; //~ WARNING type_alias_bounds
13+
type _TaInline2<T: Iterator<Item: 'static>> = T; //~ WARNING type_alias_bounds
14+
type _TaInline3<T: Iterator<Item: 'static>> = T; //~ WARNING type_alias_bounds
15+
type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T; //~ WARNING type_alias_bounds
16+
type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T; //~ WARNING type_alias_bounds
17+
type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T; //~ WARNING type_alias_bounds
1818

1919
fn main() {}

src/test/ui/async-await/issues/issue-54752-async-block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
// pp-exact
55

66
fn main() { let _a = (async { }); }
7+
//~^ WARNING unnecessary parentheses around assigned value

src/test/ui/block-expr-precedence.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ pub fn main() {
5858
if (true) { 12; } {-num};
5959
if (true) { 12; }; {-num};
6060
if (true) { 12; };;; -num;
61+
//~^ WARNING unnecessary trailing semicolons
6162
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// build-pass (FIXME(62277): could be check-pass?)
22

33
fn main() {
4-
let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
4+
let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; } //~ WARNING while_true
55
println!("{}", s);
66
}

src/test/ui/consts/const-eval/const_fn_ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ fn double(x: usize) -> usize { x * 2 }
66
const fn double_const(x: usize) -> usize { x * 2 }
77

88
const X: fn(usize) -> usize = double;
9-
const X_const: fn(usize) -> usize = double_const;
9+
const X_CONST: fn(usize) -> usize = double_const;
1010

1111
const fn bar(x: usize) -> usize {
12-
X(x)
12+
X(x) //~ WARNING skipping const checks
1313
}
1414

1515
const fn bar_const(x: usize) -> usize {
16-
X_const(x)
16+
X_CONST(x) //~ WARNING skipping const checks
1717
}
1818

1919
const fn foo(x: fn(usize) -> usize, y: usize) -> usize {
20-
x(y)
20+
x(y) //~ WARNING skipping const checks
2121
}
2222

2323
fn main() {

src/test/ui/consts/const-eval/const_fn_ptr.stderr

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | X(x)
77
warning: skipping const checks
88
--> $DIR/const_fn_ptr.rs:16:5
99
|
10-
LL | X_const(x)
10+
LL | X_CONST(x)
1111
| ^^^^^^^^^^
1212

1313
warning: skipping const checks
@@ -16,11 +16,3 @@ warning: skipping const checks
1616
LL | x(y)
1717
| ^^^^
1818

19-
warning: constant `X_const` should have an upper case name
20-
--> $DIR/const_fn_ptr.rs:9:7
21-
|
22-
LL | const X_const: fn(usize) -> usize = double_const;
23-
| ^^^^^^^ help: convert the identifier to upper case: `X_CONST`
24-
|
25-
= note: `#[warn(non_upper_case_globals)]` on by default
26-

src/test/ui/consts/const-eval/issue-64970.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ fn foo(mut n: i32) {
1010
}
1111

1212
if n > 0i32 {
13-
1i32 / n;
13+
let _ = 1i32 / n;
1414
}
1515
}

src/test/ui/consts/const-eval/issue-64970.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)