rust/tests/ui/trailing-comma.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
595 B
Rust
Raw Normal View History

// run-pass
// pretty-expanded FIXME #23616
fn f<T,>(_: T,) {}
2022-07-25 20:36:03 +00:00
struct Foo<T,>(#[allow(unused_tuple_struct_fields)] T);
struct Bar;
impl Bar {
fn f(_: isize,) {}
fn g(self, _: isize,) {}
fn h(self,) {}
}
enum Baz {
2022-07-25 20:36:03 +00:00
Qux(#[allow(unused_tuple_struct_fields)] isize,),
}
#[allow(unused,)]
pub fn main() {
f::<isize,>(0,);
2015-01-25 21:05:03 +00:00
let (_, _,) = (1, 1,);
let [_, _,] = [1, 1,];
let [_, _, .., _,] = [1, 1, 1, 1,];
2019-07-07 23:47:46 +00:00
let [_, _, _, ..,] = [1, 1, 1, 1,];
let x: Foo<isize,> = Foo::<isize,>(1);
2015-01-25 21:05:03 +00:00
Bar::f(0,);
Bar.g(0,);
Bar.h();
let x = Baz::Qux(1,);
}