Create new error code E0734 for stability attributes used outside of standard library
This commit is contained in:
parent
c9edc02e83
commit
68d099a175
2 changed files with 7 additions and 2 deletions
|
|
@ -2247,4 +2247,5 @@ static X: u32 = 42;
|
|||
E0726, // non-explicit (not `'_`) elided lifetime in unsupported position
|
||||
E0727, // `async` generators are not yet supported
|
||||
E0728, // `await` must be in an `async` function or block
|
||||
E0734, // stability attributes may not be used outside of the standard library
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,8 +199,12 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
|
|||
let name = attr.name_or_empty();
|
||||
if [sym::unstable, sym::stable, sym::rustc_deprecated].contains(&name) {
|
||||
attr::mark_used(attr);
|
||||
self.tcx.sess.span_err(attr.span, "stability attributes may not be used \
|
||||
outside of the standard library");
|
||||
struct_span_err!(
|
||||
self.tcx.sess,
|
||||
attr.span,
|
||||
E0734,
|
||||
"stability attributes may not be used outside of the standard library",
|
||||
).emit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue