mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			323 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			323 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use std::marker::PhantomData;
 | |
| 
 | |
| struct AssertSync<T: Sync>(PhantomData<T>);
 | |
| 
 | |
| pub struct Foo {
 | |
|     bar: *const Bar,
 | |
|     phantom: PhantomData<Bar>,
 | |
| }
 | |
| 
 | |
| pub struct Bar {
 | |
|     foo: *const Foo,
 | |
|     phantom: PhantomData<Foo>,
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     let _: AssertSync<Foo> = unimplemented!();
 | |
|     //~^ ERROR E0277
 | |
|     //~| ERROR E0277
 | |
| }
 | 
