mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			301 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			301 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // Regression test for #69615.
 | |
| 
 | |
| #![feature(const_trait_impl)]
 | |
| 
 | |
| #[const_trait]
 | |
| pub trait MyTrait {
 | |
|     fn method(&self) -> Option<()>;
 | |
| }
 | |
| 
 | |
| impl const MyTrait for () {
 | |
|     fn method(&self) -> Option<()> {
 | |
|         Some(())?; //~ ERROR `?` is not allowed in a `const fn`
 | |
|         None
 | |
|     }
 | |
| }
 | |
| 
 | |
| fn main() {}
 | 
