-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #98450 - lqd:doc-metadata, r=lqd,GuillaumeGomez
Remove more attributes from metadata A lot of the attributes that are currently stored in the metadata aren't used at all. The biggest metadata usage comes from the doc attributes currently but they are needed by rustdoc so we only removed the ones that cannot be used in downstream crates (doc comments on private items). r? `@ghost`
- Loading branch information
Showing
5 changed files
with
111 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// aux-build:attr-from-macro.rs | ||
// run-pass | ||
|
||
extern crate attr_from_macro; | ||
|
||
attr_from_macro::creator! { | ||
struct Foo; | ||
enum Bar; | ||
enum FooBar; | ||
} | ||
|
||
fn main() { | ||
// Checking the `repr(u32)` on the enum. | ||
assert_eq!(4, std::mem::size_of::<Bar>()); | ||
// Checking the `repr(u16)` on the enum. | ||
assert_eq!(2, std::mem::size_of::<FooBar>()); | ||
|
||
// Checking the Debug impl on the types. | ||
eprintln!("{:?} {:?} {:?}", Foo, Bar::A, FooBar::A); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#[macro_export] | ||
macro_rules! creator { | ||
(struct $name1:ident; enum $name2:ident; enum $name3:ident;) => { | ||
#[derive(Debug)] | ||
pub struct $name1; | ||
|
||
#[derive(Debug)] | ||
#[repr(u32)] | ||
pub enum $name2 { A } | ||
|
||
#[derive(Debug)] | ||
#[repr(u16)] | ||
pub enum $name3 { A } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// check-pass | ||
// Check that it doesn't panic when `Input` gets its visibility checked. | ||
|
||
#![crate_type = "lib"] | ||
|
||
pub trait Layer< | ||
/// Hello. | ||
Input, | ||
> {} |