mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
24 lines
402 B
Rust
24 lines
402 B
Rust
|
// Test that empty type parameter list (<>) is synonymous with
|
||
|
// no type parameters at all
|
||
|
|
||
|
struct S<>;
|
||
|
trait T<> {}
|
||
|
enum E<> { V }
|
||
|
impl<> T<> for S<> {}
|
||
|
impl T for E {}
|
||
|
fn foo<>() {}
|
||
|
fn bar() {}
|
||
|
|
||
|
fn main() {
|
||
|
let _ = S;
|
||
|
let _ = S::<>;
|
||
|
let _ = E::V;
|
||
|
let _ = E::<>::V;
|
||
|
foo();
|
||
|
foo::<>();
|
||
|
|
||
|
// Test that we can supply <> to non generic things
|
||
|
bar::<>();
|
||
|
let _: i32<>;
|
||
|
}
|