mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			451 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			451 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-pass
 | |
| 
 | |
| #![allow(non_camel_case_types)]
 | |
| enum clam<T> { a(T, isize), b, }
 | |
| 
 | |
| fn uhoh<T>(v: Vec<clam<T>> ) {
 | |
|     match v[1] {
 | |
|       clam::a::<T>(ref _t, ref u) => {
 | |
|           println!("incorrect");
 | |
|           println!("{}", u);
 | |
|           panic!();
 | |
|       }
 | |
|       clam::b::<T> => { println!("correct"); }
 | |
|     }
 | |
| }
 | |
| 
 | |
| pub fn main() {
 | |
|     let v: Vec<clam<isize>> = vec![clam::b::<isize>, clam::b::<isize>, clam::a::<isize>(42, 17)];
 | |
|     uhoh::<isize>(v);
 | |
| }
 | 
