mirror of
https://github.com/rust-lang/rust
synced 2024-10-01 22:34:35 +00:00
add test case for issue 105601
This commit is contained in:
parent
c67903ef21
commit
644ee8d250
11
tests/ui/lint/unused/issue-105061-array-lint.rs
Normal file
11
tests/ui/lint/unused/issue-105061-array-lint.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
#![warn(unused)]
|
||||
#![deny(warnings)]
|
||||
|
||||
fn main() {
|
||||
let _x: ([u32; 3]); //~ ERROR unnecessary parentheses around type
|
||||
let _y: [u8; (3)]; //~ ERROR unnecessary parentheses around const expression
|
||||
let _z: ([u8; (3)]);
|
||||
//~^ ERROR unnecessary parentheses around const expression
|
||||
//~| ERROR unnecessary parentheses around type
|
||||
|
||||
}
|
56
tests/ui/lint/unused/issue-105061-array-lint.stderr
Normal file
56
tests/ui/lint/unused/issue-105061-array-lint.stderr
Normal file
|
@ -0,0 +1,56 @@
|
|||
error: unnecessary parentheses around type
|
||||
--> $DIR/issue-105061-array-lint.rs:5:13
|
||||
|
|
||||
LL | let _x: ([u32; 3]);
|
||||
| ^ ^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/issue-105061-array-lint.rs:2:9
|
||||
|
|
||||
LL | #![deny(warnings)]
|
||||
| ^^^^^^^^
|
||||
= note: `#[deny(unused_parens)]` implied by `#[deny(warnings)]`
|
||||
help: remove these parentheses
|
||||
|
|
||||
LL - let _x: ([u32; 3]);
|
||||
LL + let _x: [u32; 3];
|
||||
|
|
||||
|
||||
error: unnecessary parentheses around const expression
|
||||
--> $DIR/issue-105061-array-lint.rs:6:18
|
||||
|
|
||||
LL | let _y: [u8; (3)];
|
||||
| ^ ^
|
||||
|
|
||||
help: remove these parentheses
|
||||
|
|
||||
LL - let _y: [u8; (3)];
|
||||
LL + let _y: [u8; 3];
|
||||
|
|
||||
|
||||
error: unnecessary parentheses around type
|
||||
--> $DIR/issue-105061-array-lint.rs:7:13
|
||||
|
|
||||
LL | let _z: ([u8; (3)]);
|
||||
| ^ ^
|
||||
|
|
||||
help: remove these parentheses
|
||||
|
|
||||
LL - let _z: ([u8; (3)]);
|
||||
LL + let _z: [u8; (3)];
|
||||
|
|
||||
|
||||
error: unnecessary parentheses around const expression
|
||||
--> $DIR/issue-105061-array-lint.rs:7:19
|
||||
|
|
||||
LL | let _z: ([u8; (3)]);
|
||||
| ^ ^
|
||||
|
|
||||
help: remove these parentheses
|
||||
|
|
||||
LL - let _z: ([u8; (3)]);
|
||||
LL + let _z: ([u8; 3]);
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
17
tests/ui/lint/unused/issue-105061-should-lint.rs
Normal file
17
tests/ui/lint/unused/issue-105061-should-lint.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
#![warn(unused)]
|
||||
#![deny(warnings)]
|
||||
|
||||
struct Inv<'a>(&'a mut &'a ());
|
||||
|
||||
trait Trait<'a> {}
|
||||
impl<'b> Trait<'b> for for<'a> fn(Inv<'a>) {}
|
||||
|
||||
|
||||
fn with_bound()
|
||||
where
|
||||
for<'b> (for<'a> fn(Inv<'a>)): Trait<'b>, //~ ERROR unnecessary parentheses around type
|
||||
{}
|
||||
|
||||
fn main() {
|
||||
with_bound();
|
||||
}
|
20
tests/ui/lint/unused/issue-105061-should-lint.stderr
Normal file
20
tests/ui/lint/unused/issue-105061-should-lint.stderr
Normal file
|
@ -0,0 +1,20 @@
|
|||
error: unnecessary parentheses around type
|
||||
--> $DIR/issue-105061-should-lint.rs:12:13
|
||||
|
|
||||
LL | for<'b> (for<'a> fn(Inv<'a>)): Trait<'b>,
|
||||
| ^ ^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/issue-105061-should-lint.rs:2:9
|
||||
|
|
||||
LL | #![deny(warnings)]
|
||||
| ^^^^^^^^
|
||||
= note: `#[deny(unused_parens)]` implied by `#[deny(warnings)]`
|
||||
help: remove these parentheses
|
||||
|
|
||||
LL - for<'b> (for<'a> fn(Inv<'a>)): Trait<'b>,
|
||||
LL + for<'b> for<'a> fn(Inv<'a>): Trait<'b>,
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in a new issue