1
Fork 0

Fix "unstable in stable" error

The "otherwise" note is printed before the suggestion currently.
This commit is contained in:
Dylan MacKenzie 2020-09-29 13:18:43 -07:00
parent 782a595d7c
commit ce50939952
4 changed files with 18 additions and 4 deletions

View file

@ -33,7 +33,12 @@ pub fn non_const<O: NonConstOp>(ccx: &ConstCx<'_, '_>, op: O, span: Span) -> boo
concat!(r#"#[rustc_const_unstable(feature = "...", issue = "...")]"#, '\n').to_owned(),
Applicability::HasPlaceholders,
)
.note("otherwise `#[allow_internal_unstable]` can be used to bypass stability checks")
.span_suggestion(
ccx.body.span,
"otherwise `#[allow_internal_unstable]` can be used to bypass stability checks",
format!("#[allow_internal_unstable({})]", gate),
Applicability:: MaybeIncorrect,
)
.emit();
}