-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when #![staged_api]
crates are missing stability markers
#21910
Conversation
56a94c9
to
8e99079
Compare
} | ||
|
||
impl<'a> Annotator<'a> { | ||
// Determine the stability for a node based on its attributes and inherited | ||
// stability. The stability is recorded in the index and used as the parent. | ||
fn annotate<F>(&mut self, id: NodeId, use_parent: bool, | ||
attrs: &Vec<Attribute>, item_sp: Span, f: F) where | ||
attrs: &Vec<Attribute>, item_sp: Span, f: F, error: bool) where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can error
be renamed to something more descriptive: required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(addressed)
42d0cff
to
d02d4c3
Compare
I tweaked it so that it ignores errors when compiling tests. We don't need errors about testing when there are A more fine-grained option is to make the visitor not recurse for |
Nice work, @Manishearth! cc @SimonSapin |
\o/ |
Fixes #21884 |
Currently, if a `#![staged_api]` crate contains an exported item without a stability marker (or inherited stability), the item is useless. This change introduces a check to ensure that all exported items have a defined stability. it also introduces the `unmarked_api` feature, which lets users import unmarked features. While this PR should in theory forbid these from existing, in practice we can't be so sure; so this lets users bypass this check instead of having to wait for the library and/or compiler to be fixed (since otherwise this is a hard error). r? @aturon
Currently, if a
#![staged_api]
crate contains an exported item without a stability marker (or inherited stability),the item is useless.
This change introduces a check to ensure that all exported items have a defined stability.
it also introduces the
unmarked_api
feature, which lets users import unmarked features. While this PR should in theory forbid these from existing,in practice we can't be so sure; so this lets users bypass this check instead of having to wait for the library and/or compiler to be fixed (since otherwise this is a hard error).
r? @aturon