mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			242 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			242 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![feature(const_closures, const_trait_impl)]
 | |
| #![allow(incomplete_features)]
 | |
| 
 | |
| trait Foo {
 | |
|     fn foo(&self);
 | |
| }
 | |
| 
 | |
| impl Foo for () {
 | |
|     fn foo(&self) {}
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     (const || { (()).foo() })();
 | |
|     //~^ ERROR: cannot call non-const fn
 | |
| }
 | 
