mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	 98934707eb
			
		
	
	
		98934707eb
		
	
	
	
	
		
			
			Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
		
			
				
	
	
		
			43 lines
		
	
	
		
			855 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			855 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //! Checks trailing commas are accepted in various places:
 | |
| //! - Generic parameters in function and struct definitions.
 | |
| //! - Function and method arguments.
 | |
| //! - Tuple and array literal expressions.
 | |
| //! - Tuple and array destructuring patterns, including those with `..`.
 | |
| //! - Enum variant declarations.
 | |
| //! - Attributes.
 | |
| 
 | |
| //@ run-pass
 | |
| 
 | |
| fn f<T,>(_: T,) {}
 | |
| 
 | |
| struct Foo<T,>(#[allow(dead_code)] T);
 | |
| 
 | |
| struct Bar;
 | |
| 
 | |
| impl Bar {
 | |
|     fn f(_: isize,) {}
 | |
|     fn g(self, _: isize,) {}
 | |
|     fn h(self,) {}
 | |
| }
 | |
| 
 | |
| enum Baz {
 | |
|     Qux(#[allow(dead_code)] isize,),
 | |
| }
 | |
| 
 | |
| #[allow(unused,)]
 | |
| pub fn main() {
 | |
|     f::<isize,>(0,);
 | |
|     let (_, _,) = (1, 1,);
 | |
|     let [_, _,] = [1, 1,];
 | |
|     let [_, _, .., _,] = [1, 1, 1, 1,];
 | |
|     let [_, _, _, ..,] = [1, 1, 1, 1,];
 | |
| 
 | |
|     let x: Foo<isize,> = Foo::<isize,>(1);
 | |
| 
 | |
|     Bar::f(0,);
 | |
|     Bar.g(0,);
 | |
|     Bar.h();
 | |
| 
 | |
|     let x = Baz::Qux(1,);
 | |
| }
 |