mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			302 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			302 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // build-pass (tests post-monomorphisation failure)
 | |
| #![crate_type = "lib"]
 | |
| 
 | |
| pub trait Nullable {
 | |
|     const NULL: Self;
 | |
| 
 | |
|     fn is_null(&self) -> bool;
 | |
| }
 | |
| 
 | |
| impl<T> Nullable for *const T {
 | |
|     const NULL: Self = core::ptr::null::<T>();
 | |
| 
 | |
|     fn is_null(&self) -> bool {
 | |
|         *self == Self::NULL
 | |
|     }
 | |
| }
 | 
