mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-29 20:15:27 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			254 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			254 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-pass
 | |
| 
 | |
| // Check that `Allocator` is object safe, this allows for polymorphic allocators
 | |
| 
 | |
| #![feature(allocator_api)]
 | |
| 
 | |
| use std::alloc::{Allocator, System};
 | |
| 
 | |
| fn ensure_object_safe(_: &dyn Allocator) {}
 | |
| 
 | |
| fn main() {
 | |
|     ensure_object_safe(&System);
 | |
| }
 | 
