Skip to content

Commit 690b050

Browse files
committed
moved renamed docs stderr formatted | empty-type-parameter-list.rs
1 parent 8901a6f commit 690b050

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

tests/ui/empty-type-parameter-list.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//! Test that empty type parameter list <> is equivalent to no type parameters
2+
//!
3+
//! Verifies that empty angle brackets <> are syntactically valid and equivalent
4+
//! to omitting type parameters entirely across various language constructs.
5+
6+
//@ run-pass
7+
8+
struct S;
9+
trait T {} //~ WARN trait `T` is never used
10+
enum E {
11+
V,
12+
}
13+
14+
impl T for S {}
15+
impl T for E {}
16+
17+
fn foo() {}
18+
fn bar() {}
19+
20+
fn main() {
21+
let _ = S;
22+
let _ = S;
23+
let _ = E::V;
24+
let _ = E::V;
25+
26+
foo();
27+
foo();
28+
29+
// Test that we can supply <> to non-generic things
30+
bar();
31+
let _: i32;
32+
}

tests/ui/empty-type-parameter-list.stderr renamed to tests/ui/generics/empty-generic-brackets-equiv.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
warning: trait `T` is never used
2-
--> $DIR/empty-type-parameter-list.rs:6:7
2+
--> $DIR/empty-generic-brackets-equiv.rs:9:7
33
|
4-
LL | trait T<> {}
4+
LL | trait T {}
55
| ^
66
|
77
= note: `#[warn(dead_code)]` on by default

0 commit comments

Comments
 (0)