mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	 078332fdc8
			
		
	
	
		078332fdc8
		
	
	
	
	
		
			
			Implements https://www.github.com/rust-lang/rust/issues/141358. This has 2 primary benefits: 1. For rustdoc-json consumers, they no longer need to parse strings of attributes, but it's there in a structured and normalized way. 2. For rustc contributors, the output of HIR pretty printing is no longer a versioned thing in the output. People can work on https://github.com/rust-lang/rust/issues/131229 without needing to bump `FORMAT_VERSION`. (Over time, as the attribute refractor continues, I expect we'll add new things to `rustdoc_json_types::Attribute`. But this can be done separately to the rustc changes).
		
			
				
	
	
		
			14 lines
		
	
	
		
			397 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			397 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #[derive(Default)]
 | |
| pub struct Derive;
 | |
| 
 | |
| pub struct Manual;
 | |
| 
 | |
| impl Default for Manual {
 | |
|     fn default() -> Self {
 | |
|         Self
 | |
|     }
 | |
| }
 | |
| 
 | |
| //@ is '$.index[?(@.inner.impl.for.resolved_path.path == "Derive" && @.inner.impl.trait.path == "Default")].attrs' '["automatically_derived"]'
 | |
| //@ is '$.index[?(@.inner.impl.for.resolved_path.path == "Manual" && @.inner.impl.trait.path == "Default")].attrs' '[]'
 |