From 547e46a91335cae24ceb16795cf03ea91ae26b95 Mon Sep 17 00:00:00 2001 From: Julian Wollersberger Date: Sat, 27 Apr 2019 22:20:16 +0200 Subject: [PATCH 1/7] Began changing the type in `StabilityLevel::Unstable` from `issue: i32` to `issue: Option` https://github.com/rust-lang/rust/issues/41260 --- src/libsyntax/attr/builtin.rs | 51 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index 65ca96afab129..4e85955487902 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -122,7 +122,7 @@ pub struct Stability { #[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Clone, Debug, Eq, Hash)] pub enum StabilityLevel { // Reason for the current stability level and the relevant rust-lang issue - Unstable { reason: Option, issue: u32 }, + Unstable { reason: Option, issue: Option }, Stable { since: Symbol }, } @@ -306,7 +306,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, handle_errors(sess, attr.span, AttrError::MultipleStabilityLevels); break } - + let mut feature = None; let mut reason = None; let mut issue = None; @@ -340,37 +340,34 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, continue 'outer } } - - match (feature, reason, issue) { - (Some(feature), reason, Some(issue)) => { - stab = Some(Stability { - level: Unstable { - reason, - issue: { - if let Ok(issue) = issue.as_str().parse() { - issue + + if let Some(feature) = feature { + stab = Some(Stability { + level: Unstable { + reason, + issue: { + if let Some(issue_sym) = issue { + if let Ok(issue_num) = issue_sym.as_str().parse() { + Some(issue_num) } else { span_err!(diagnostic, attr.span, E0545, "incorrect 'issue'"); continue } + } else { + None } - }, - feature, - rustc_depr: None, - const_stability: None, - promotable: false, - allow_const_fn_ptr: false, - }) - } - (None, _, _) => { - handle_errors(sess, attr.span, AttrError::MissingFeature); - continue - } - _ => { - span_err!(diagnostic, attr.span, E0547, "missing 'issue'"); - continue - } + } + }, + feature, + rustc_depr: None, + const_stability: None, + promotable: false, + allow_const_fn_ptr: false, + }) + } else { + handle_errors(sess, attr.span, AttrError::MissingFeature); + continue } } sym::stable => { From 8a99c80c06813580f1fa285890c731f10a75b563 Mon Sep 17 00:00:00 2001 From: Julian Wollersberger Date: Mon, 29 Apr 2019 14:27:39 +0200 Subject: [PATCH 2/7] Modified ui test cases and temporarily changed the type back to i32 to test them. --- src/libsyntax/attr/builtin.rs | 7 +++-- .../auxiliary/stability_attribute_issue.rs | 3 ++ .../stability-attribute-issue.rs | 2 ++ .../stability-attribute-issue.stderr | 10 ++++++- .../stability-attribute-sanity.rs | 3 -- .../stability-attribute-sanity.stderr | 28 ++++++++----------- 6 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index 4e85955487902..dc00db9e95e7e 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -122,7 +122,7 @@ pub struct Stability { #[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Clone, Debug, Eq, Hash)] pub enum StabilityLevel { // Reason for the current stability level and the relevant rust-lang issue - Unstable { reason: Option, issue: Option }, + Unstable { reason: Option, issue: u32 }, Stable { since: Symbol }, } @@ -341,6 +341,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, } } + // `feature` is required, `reason` and `issue` are optional if let Some(feature) = feature { stab = Some(Stability { level: Unstable { @@ -348,14 +349,14 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, issue: { if let Some(issue_sym) = issue { if let Ok(issue_num) = issue_sym.as_str().parse() { - Some(issue_num) + issue_num } else { span_err!(diagnostic, attr.span, E0545, "incorrect 'issue'"); continue } } else { - None + 0 } } }, diff --git a/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs b/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs index 4e5333289c43c..611a786c229cf 100644 --- a/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs +++ b/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs @@ -7,3 +7,6 @@ pub fn unstable() {} #[unstable(feature = "unstable_test_feature", reason = "message", issue = "2")] pub fn unstable_msg() {} + +#[unstable(feature = "unstable_test_feature")] +pub fn unstable_without_issue() {} \ No newline at end of file diff --git a/src/test/ui/stability-attribute/stability-attribute-issue.rs b/src/test/ui/stability-attribute/stability-attribute-issue.rs index cda1aff133f94..abb0c95d3fedb 100644 --- a/src/test/ui/stability-attribute/stability-attribute-issue.rs +++ b/src/test/ui/stability-attribute/stability-attribute-issue.rs @@ -9,4 +9,6 @@ fn main() { //~^ ERROR use of unstable library feature 'unstable_test_feature' unstable_msg(); //~^ ERROR use of unstable library feature 'unstable_test_feature': message + unstable_without_issue(); + //~^ ERROR use of unstable library feature 'unstable_test_feature' } diff --git a/src/test/ui/stability-attribute/stability-attribute-issue.stderr b/src/test/ui/stability-attribute/stability-attribute-issue.stderr index 7e6fbe1600d1e..587ecd6b855df 100644 --- a/src/test/ui/stability-attribute/stability-attribute-issue.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-issue.stderr @@ -16,6 +16,14 @@ LL | unstable_msg(); = note: for more information, see https://github.com/rust-lang/rust/issues/2 = help: add #![feature(unstable_test_feature)] to the crate attributes to enable -error: aborting due to 2 previous errors +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/stability-attribute-issue.rs:12:5 + | +LL | unstable_without_issue(); + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.rs b/src/test/ui/stability-attribute/stability-attribute-sanity.rs index aebdb3bdbf571..46bfd01845585 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.rs +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.rs @@ -25,9 +25,6 @@ mod missing_feature_names { #[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546] fn f1() { } - #[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547] - fn f2() { } - #[stable(since = "a")] //~ ERROR missing 'feature' [E0546] fn f3() { } } diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr index d9a5448bdd8af..55b238b9f5d62 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr @@ -34,72 +34,66 @@ error[E0546]: missing 'feature' LL | #[unstable(issue = "0")] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0547]: missing 'issue' - --> $DIR/stability-attribute-sanity.rs:28:5 - | -LL | #[unstable(feature = "b")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - error[E0546]: missing 'feature' - --> $DIR/stability-attribute-sanity.rs:31:5 + --> $DIR/stability-attribute-sanity.rs:28:5 | LL | #[stable(since = "a")] | ^^^^^^^^^^^^^^^^^^^^^^ error[E0542]: missing 'since' - --> $DIR/stability-attribute-sanity.rs:36:5 + --> $DIR/stability-attribute-sanity.rs:33:5 | LL | #[stable(feature = "a")] | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0542]: missing 'since' - --> $DIR/stability-attribute-sanity.rs:40:5 + --> $DIR/stability-attribute-sanity.rs:37:5 | LL | #[rustc_deprecated(reason = "a")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:45:1 + --> $DIR/stability-attribute-sanity.rs:42:1 | LL | #[stable(feature = "a", since = "b")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:49:1 + --> $DIR/stability-attribute-sanity.rs:46:1 | LL | #[unstable(feature = "b", issue = "0")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:53:1 + --> $DIR/stability-attribute-sanity.rs:50:1 | LL | #[stable(feature = "a", since = "b")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0540]: multiple rustc_deprecated attributes - --> $DIR/stability-attribute-sanity.rs:61:1 + --> $DIR/stability-attribute-sanity.rs:58:1 | LL | pub const fn multiple4() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0553]: multiple rustc_const_unstable attributes - --> $DIR/stability-attribute-sanity.rs:61:1 + --> $DIR/stability-attribute-sanity.rs:58:1 | LL | pub const fn multiple4() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: Invalid stability or deprecation version found - --> $DIR/stability-attribute-sanity.rs:61:1 + --> $DIR/stability-attribute-sanity.rs:58:1 | LL | pub const fn multiple4() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0549]: rustc_deprecated attribute must be paired with either stable or unstable attribute - --> $DIR/stability-attribute-sanity.rs:66:1 + --> $DIR/stability-attribute-sanity.rs:63:1 | LL | fn deprecated_without_unstable_or_stable() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 17 previous errors +error: aborting due to 16 previous errors For more information about this error, try `rustc --explain E0541`. From 6d68a6c1856b0d5bf4d45a8c0e749ba5a9e65f54 Mon Sep 17 00:00:00 2001 From: Julian Wollersberger Date: Mon, 29 Apr 2019 21:16:58 +0200 Subject: [PATCH 3/7] Types changed to `issue: Option` in a few places and I added a basic ui test. It turned out that issue fields were already Option in most places. Added some temporary errors to find all the `#[unstable(... , issue = "0")]` --- src/librustc/middle/stability.rs | 8 ++++---- src/librustc/session/mod.rs | 2 +- src/librustdoc/clean/mod.rs | 2 +- src/libsyntax/attr/builtin.rs | 11 ++++++++--- src/libsyntax/error_codes.rs | 1 - src/libsyntax/ext/base.rs | 4 ++-- src/libsyntax/ext/expand.rs | 4 ++-- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index abcf164cda6d4..311d6a54bc27b 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -435,7 +435,7 @@ impl<'a, 'tcx> Index<'tcx> { let stability = tcx.intern_stability(Stability { level: attr::StabilityLevel::Unstable { reason: Some(Symbol::intern(reason)), - issue: 27812, + issue: Some(27812), }, feature: Symbol::intern("rustc_private"), rustc_depr: None, @@ -515,7 +515,7 @@ pub enum EvalResult { Deny { feature: Symbol, reason: Option, - issue: u32, + issue: Option, }, /// The item does not have the `#[stable]` or `#[unstable]` marker assigned. Unmarked, @@ -686,7 +686,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { // the `-Z force-unstable-if-unmarked` flag present (we're // compiling a compiler crate), then let this missing feature // annotation slide. - if feature == sym::rustc_private && issue == 27812 { + if feature == sym::rustc_private && issue == Some(27812) { if self.sess.opts.debugging_opts.force_unstable_if_unmarked { return EvalResult::Allow; } @@ -740,7 +740,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { let fresh = self.sess.one_time_diagnostics.borrow_mut().insert(error_id); if fresh { emit_feature_err(&self.sess.parse_sess, feature, span, - GateIssue::Library(Some(issue)), &msg); + GateIssue::Library(issue), &msg); } } EvalResult::Unmarked => { diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 4d47491661e86..bb3527fa98fa9 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -199,7 +199,7 @@ enum DiagnosticBuilderMethod { pub enum DiagnosticMessageId { ErrorId(u16), // EXXXX error code as integer LintId(lint::LintId), - StabilityId(u32), // issue number + StabilityId(Option), // issue number } impl From<&'static lint::Lint> for DiagnosticMessageId { diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index f9a43ccfbace1..a01949a9c7151 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -4314,7 +4314,7 @@ impl Clean for attr::Stability { _ => None, }, issue: match self.level { - attr::Unstable {issue, ..} => Some(issue), + attr::Unstable {issue, ..} => issue, _ => None, } } diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index dc00db9e95e7e..6f935f662e09d 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -122,7 +122,7 @@ pub struct Stability { #[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Clone, Debug, Eq, Hash)] pub enum StabilityLevel { // Reason for the current stability level and the relevant rust-lang issue - Unstable { reason: Option, issue: u32 }, + Unstable { reason: Option, issue: Option }, Stable { since: Symbol }, } @@ -349,14 +349,19 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, issue: { if let Some(issue_sym) = issue { if let Ok(issue_num) = issue_sym.as_str().parse() { - issue_num + if issue_num == 0 { + span_err!(diagnostic, attr.span, E0545, + "Issue #0 should not be used. The issue item can be omited"); + //TODO how to add a NOTE ? + } + Some(issue_num) } else { span_err!(diagnostic, attr.span, E0545, "incorrect 'issue'"); continue } } else { - 0 + None } } }, diff --git a/src/libsyntax/error_codes.rs b/src/libsyntax/error_codes.rs index e2d212eb721ff..da6fa80770ca1 100644 --- a/src/libsyntax/error_codes.rs +++ b/src/libsyntax/error_codes.rs @@ -432,7 +432,6 @@ register_diagnostics! { E0544, // multiple stability levels E0545, // incorrect 'issue' E0546, // missing 'feature' - E0547, // missing 'issue' // E0548, // replaced with a generic attribute input check E0549, // rustc_deprecated attribute must be paired with either stable or unstable attribute E0550, // multiple deprecated attributes diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 0a88d2f8824d3..b040f965b4ac4 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -649,8 +649,8 @@ pub enum SyntaxExtension { /// Enables the macro helper hack (`ident!(...)` -> `$crate::ident!(...)`) /// for a given macro. local_inner_macros: bool, - /// The macro's feature name if it is unstable, and the stability feature - unstable_feature: Option<(Symbol, u32)>, + /// The macro's feature name if it is unstable, and the tracking issue + unstable_feature: Option<(Symbol, Option)>, /// Edition of the crate in which the macro is defined edition: Edition, }, diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index a286fd83e3c20..325037e993cab 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -715,7 +715,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { allow_internal_unsafe, local_inner_macros, // can't infer this type - unstable_feature: Option<(Symbol, u32)>, + unstable_feature: Option<(Symbol, Option)>, edition| { // feature-gate the macro invocation @@ -731,7 +731,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { }) { let explain = format!("macro {}! is unstable", path); emit_feature_err(this.cx.parse_sess, feature, span, - GateIssue::Library(Some(issue)), &explain); + GateIssue::Library(issue), &explain); this.cx.trace_macros_diag(); } } From 6861c9271167ebd8fbbf0ba1a17249ef76efc46c Mon Sep 17 00:00:00 2001 From: Julian Wollersberger Date: Tue, 14 May 2019 19:35:22 +0200 Subject: [PATCH 4/7] Made a warning for issues #0 and moved some code around. --- src/libsyntax/attr/builtin.rs | 41 +++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index 6f935f662e09d..f69f5d0eefa02 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -307,6 +307,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, break } + // Expansion of `get_meta!` let mut feature = None; let mut reason = None; let mut issue = None; @@ -341,29 +342,31 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, } } - // `feature` is required, `reason` and `issue` are optional + // Parse the optional symbol to an optional integer. + let issue: Option = if let Some(issue_sym) = issue { + if let Ok(issue_num) = issue_sym.as_str().parse() { + if issue_num == 0 { + //TODO How do I choose an error number? + struct_span_warn!(diagnostic, attr.span, E0545, + "Issue #0 should not be used" + ).help("Consider omitting the `issue` attribute") + .emit(); + } + Some(issue_num) + } else { + span_err!(diagnostic, attr.span, E0545, "incorrect 'issue'"); + continue + } + } else { + None + }; + + // `feature` is required, `reason` and `issue` are optional. if let Some(feature) = feature { stab = Some(Stability { level: Unstable { reason, - issue: { - if let Some(issue_sym) = issue { - if let Ok(issue_num) = issue_sym.as_str().parse() { - if issue_num == 0 { - span_err!(diagnostic, attr.span, E0545, - "Issue #0 should not be used. The issue item can be omited"); - //TODO how to add a NOTE ? - } - Some(issue_num) - } else { - span_err!(diagnostic, attr.span, E0545, - "incorrect 'issue'"); - continue - } - } else { - None - } - } + issue, }, feature, rustc_depr: None, From 43c820746f426151291f4eb0317d3a57305c3a07 Mon Sep 17 00:00:00 2001 From: Julian Wollersberger Date: Wed, 15 May 2019 18:05:26 +0200 Subject: [PATCH 5/7] Removed most `issue = "0"` from ui tests. --- .../dont_promote_unstable_const_fn.rs | 3 +- .../min_const_fn_libstd_stability.rs | 3 +- .../min_const_unsafe_fn_libstd_stability.rs | 3 +- .../min_const_unsafe_fn_libstd_stability2.rs | 3 +- .../stability-attribute-consistency.rs | 2 +- src/test/ui/issues/issue-17337.rs | 4 +- .../ui/lint/auxiliary/inherited_stability.rs | 8 ++-- .../ui/lint/auxiliary/lint_output_format.rs | 6 +-- src/test/ui/lint/auxiliary/lint_stability.rs | 46 +++++++++---------- .../lint/auxiliary/lint_stability_fields.rs | 24 +++++----- src/test/ui/lint/auxiliary/stability-cfg2.rs | 2 +- src/test/ui/lint/auxiliary/stability_cfg2.rs | 2 +- src/test/ui/lint/lint-stability-2.rs | 46 +++++++++---------- src/test/ui/lint/lint-stability-deprecated.rs | 46 +++++++++---------- .../lint/lint-stability-fields-deprecated.rs | 22 ++++----- src/test/ui/lint/lint-stability-fields.rs | 22 ++++----- src/test/ui/lint/lint-stability.rs | 46 +++++++++---------- .../ui/macros/auxiliary/unstable-macros.rs | 2 +- src/test/ui/macros/macro-stability.rs | 2 +- src/test/ui/missing/missing-stability.rs | 2 +- .../auxiliary/stability_attribute_issue.rs | 2 +- 21 files changed, 146 insertions(+), 150 deletions(-) diff --git a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs index 900286909902c..d556f34fce5fb 100644 --- a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs +++ b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs @@ -1,7 +1,6 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, - we're apparently really bad at it", - issue = "0")] + we're apparently really bad at it")] #![feature(rustc_const_unstable, const_fn)] #![feature(staged_api)] diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs index 759d9ab6a4081..eb863cc4c81e6 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs @@ -1,7 +1,6 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, - we're apparently really bad at it", - issue = "0")] + we're apparently really bad at it")] #![feature(rustc_const_unstable, const_fn, foo, foo2)] #![feature(staged_api)] diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs index 64057b012b8df..e3c7505eb5f76 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs @@ -1,7 +1,6 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, - we're apparently really bad at it", - issue = "0")] + we're apparently really bad at it")] #![feature(rustc_const_unstable, const_fn, foo, foo2)] #![feature(staged_api)] diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs index deb2cb6b619bb..57eb91bf742f2 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs @@ -1,7 +1,6 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, - we're apparently really bad at it", - issue = "0")] + we're apparently really bad at it")] #![feature(rustc_const_unstable, const_fn, foo, foo2)] #![feature(staged_api)] diff --git a/src/test/ui/feature-gate/stability-attribute-consistency.rs b/src/test/ui/feature-gate/stability-attribute-consistency.rs index caafd8b885475..38a865a79ccf6 100644 --- a/src/test/ui/feature-gate/stability-attribute-consistency.rs +++ b/src/test/ui/feature-gate/stability-attribute-consistency.rs @@ -9,7 +9,7 @@ fn foo_stable_1_0_0() {} //~^ ERROR feature `foo` is declared stable since 1.29.0 fn foo_stable_1_29_0() {} -#[unstable(feature = "foo", issue = "0")] +#[unstable(feature = "foo")] //~^ ERROR feature `foo` is declared unstable fn foo_unstable() {} diff --git a/src/test/ui/issues/issue-17337.rs b/src/test/ui/issues/issue-17337.rs index 1126ab7a206d2..212de614e1193 100644 --- a/src/test/ui/issues/issue-17337.rs +++ b/src/test/ui/issues/issue-17337.rs @@ -1,12 +1,12 @@ #![feature(staged_api)] #![deny(deprecated)] -#![unstable(feature = "unstable_test_feature", issue = "0")] +#![unstable(feature = "unstable_test_feature")] struct Foo; impl Foo { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn foo(self) {} } diff --git a/src/test/ui/lint/auxiliary/inherited_stability.rs b/src/test/ui/lint/auxiliary/inherited_stability.rs index 57af0d3ec9ccf..e4a2798629e3a 100644 --- a/src/test/ui/lint/auxiliary/inherited_stability.rs +++ b/src/test/ui/lint/auxiliary/inherited_stability.rs @@ -1,6 +1,6 @@ #![crate_name="inherited_stability"] #![crate_type = "lib"] -#![unstable(feature = "unstable_test_feature", issue = "0")] +#![unstable(feature = "unstable_test_feature")] #![feature(staged_api)] pub fn unstable() {} @@ -10,14 +10,14 @@ pub fn stable() {} #[stable(feature = "rust1", since = "1.0.0")] pub mod stable_mod { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn unstable() {} #[stable(feature = "rust1", since = "1.0.0")] pub fn stable() {} } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub mod unstable_mod { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] @@ -28,7 +28,7 @@ pub mod unstable_mod { #[stable(feature = "rust1", since = "1.0.0")] pub trait Stable { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] fn unstable(&self); #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/lint/auxiliary/lint_output_format.rs b/src/test/ui/lint/auxiliary/lint_output_format.rs index 5facb556122ed..f14c6e7b074de 100644 --- a/src/test/ui/lint/auxiliary/lint_output_format.rs +++ b/src/test/ui/lint/auxiliary/lint_output_format.rs @@ -1,7 +1,7 @@ #![crate_name="lint_output_format"] #![crate_type = "lib"] #![feature(staged_api)] -#![unstable(feature = "unstable_test_feature", issue = "0")] +#![unstable(feature = "unstable_test_feature")] #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] @@ -9,12 +9,12 @@ pub fn foo() -> usize { 20 } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub fn bar() -> usize { 40 } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub fn baz() -> usize { 30 } diff --git a/src/test/ui/lint/auxiliary/lint_stability.rs b/src/test/ui/lint/auxiliary/lint_stability.rs index 3188d706ab057..7c4932fffa40c 100644 --- a/src/test/ui/lint/auxiliary/lint_stability.rs +++ b/src/test/ui/lint/auxiliary/lint_stability.rs @@ -15,16 +15,16 @@ pub fn deprecated_text() {} #[rustc_deprecated(since = "99.99.99", reason = "text")] pub fn deprecated_future() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_unstable() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_unstable_text() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub fn unstable() {} -#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] +#[unstable(feature = "unstable_test_feature", reason = "text")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -43,16 +43,16 @@ impl MethodTester { #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_unstable_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -70,16 +70,16 @@ pub trait Trait { #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_unstable_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -90,7 +90,7 @@ pub trait Trait { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub trait TraitWithAssociatedTypes { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] type TypeUnstable = u8; #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] @@ -100,7 +100,7 @@ pub trait TraitWithAssociatedTypes { #[stable(feature = "stable_test_feature", since = "1.0.0")] impl Trait for MethodTester {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub trait UnstableTrait { fn dummy(&self) { } } #[stable(feature = "stable_test_feature", since = "1.0.0")] @@ -114,12 +114,12 @@ pub trait DeprecatedTrait { pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } @@ -127,7 +127,7 @@ pub struct UnstableStruct { pub struct StableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub enum UnstableEnum {} #[stable(feature = "rust1", since = "1.0.0")] pub enum StableEnum {} @@ -135,10 +135,10 @@ pub enum StableEnum {} #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableUnitStruct; -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; @@ -148,10 +148,10 @@ pub enum Enum { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedUnstableVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] @@ -161,10 +161,10 @@ pub enum Enum { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); diff --git a/src/test/ui/lint/auxiliary/lint_stability_fields.rs b/src/test/ui/lint/auxiliary/lint_stability_fields.rs index 2787da7cb7109..e32813c7f0c83 100644 --- a/src/test/ui/lint/auxiliary/lint_stability_fields.rs +++ b/src/test/ui/lint/auxiliary/lint_stability_fields.rs @@ -5,47 +5,47 @@ pub struct Stable { #[stable(feature = "rust1", since = "1.0.0")] pub inherit: u8, // it's a lie (stable doesn't inherit) - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub override2: u8, } #[stable(feature = "rust1", since = "1.0.0")] pub struct Stable2(#[stable(feature = "rust1", since = "1.0.0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub u8, + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub struct Unstable { pub inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] pub override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub override2: u8, } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub struct Unstable2(pub u8, #[stable(feature = "rust1", since = "1.0.0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct Deprecated { pub inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] pub override1: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub override2: u8, } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct Deprecated2(pub u8, #[stable(feature = "rust1", since = "1.0.0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8); + #[unstable(feature = "unstable_test_feature")] pub u8); diff --git a/src/test/ui/lint/auxiliary/stability-cfg2.rs b/src/test/ui/lint/auxiliary/stability-cfg2.rs index 8a2899584b903..8de62fdcc69e8 100644 --- a/src/test/ui/lint/auxiliary/stability-cfg2.rs +++ b/src/test/ui/lint/auxiliary/stability-cfg2.rs @@ -1,5 +1,5 @@ // compile-flags:--cfg foo -#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))] +#![cfg_attr(foo, unstable(feature = "unstable_test_feature"))] #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] #![feature(staged_api)] diff --git a/src/test/ui/lint/auxiliary/stability_cfg2.rs b/src/test/ui/lint/auxiliary/stability_cfg2.rs index 8a2899584b903..8de62fdcc69e8 100644 --- a/src/test/ui/lint/auxiliary/stability_cfg2.rs +++ b/src/test/ui/lint/auxiliary/stability_cfg2.rs @@ -1,5 +1,5 @@ // compile-flags:--cfg foo -#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))] +#![cfg_attr(foo, unstable(feature = "unstable_test_feature"))] #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] #![feature(staged_api)] diff --git a/src/test/ui/lint/lint-stability-2.rs b/src/test/ui/lint/lint-stability-2.rs index 12e7b086d35d1..2fd5132ee403b 100644 --- a/src/test/ui/lint/lint-stability-2.rs +++ b/src/test/ui/lint/lint-stability-2.rs @@ -168,16 +168,16 @@ mod cross_crate { } mod this_crate { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_text() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn unstable() {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -189,16 +189,16 @@ mod this_crate { pub struct MethodTester; impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -208,16 +208,16 @@ mod this_crate { } pub trait Trait { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -228,12 +228,12 @@ mod this_crate { impl Trait for MethodTester {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } @@ -242,29 +242,29 @@ mod this_crate { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; pub enum Enum { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] StableVariant, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(isize); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableTupleStruct(isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(isize); @@ -381,7 +381,7 @@ mod this_crate { foo.trait_stable(); } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_fn_body() { fn fn_in_body() {} @@ -389,7 +389,7 @@ mod this_crate { } impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_method_body(&self) { fn fn_in_body() {} @@ -397,7 +397,7 @@ mod this_crate { } } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub trait DeprecatedTrait { fn dummy(&self) { } diff --git a/src/test/ui/lint/lint-stability-deprecated.rs b/src/test/ui/lint/lint-stability-deprecated.rs index bf574d7144d06..42f4577b41cf4 100644 --- a/src/test/ui/lint/lint-stability-deprecated.rs +++ b/src/test/ui/lint/lint-stability-deprecated.rs @@ -217,16 +217,16 @@ mod inheritance { } mod this_crate { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_text() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn unstable() {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -238,16 +238,16 @@ mod this_crate { pub struct MethodTester; impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -257,16 +257,16 @@ mod this_crate { } pub trait Trait { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -277,12 +277,12 @@ mod this_crate { impl Trait for MethodTester {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } @@ -291,29 +291,29 @@ mod this_crate { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; pub enum Enum { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] StableVariant, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(isize); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableTupleStruct(isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(isize); @@ -431,7 +431,7 @@ mod this_crate { foo.trait_stable(); } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_fn_body() { fn fn_in_body() {} @@ -439,7 +439,7 @@ mod this_crate { } impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_method_body(&self) { fn fn_in_body() {} @@ -447,7 +447,7 @@ mod this_crate { } } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub trait DeprecatedTrait { fn dummy(&self) { } diff --git a/src/test/ui/lint/lint-stability-fields-deprecated.rs b/src/test/ui/lint/lint-stability-fields-deprecated.rs index 9d5b7c51cc82b..c20612d844c93 100644 --- a/src/test/ui/lint/lint-stability-fields-deprecated.rs +++ b/src/test/ui/lint/lint-stability-fields-deprecated.rs @@ -153,50 +153,50 @@ mod this_crate { #[stable(feature = "rust1", since = "1.0.0")] struct Stable { inherit: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override2: u8, } #[stable(feature = "rust1", since = "1.0.0")] struct Stable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] struct Unstable { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] struct Unstable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] u8); + #[unstable(feature = "unstable_test_feature")] u8); pub fn foo() { let x = Stable { diff --git a/src/test/ui/lint/lint-stability-fields.rs b/src/test/ui/lint/lint-stability-fields.rs index 9be8710bd4cef..cffa4d7459258 100644 --- a/src/test/ui/lint/lint-stability-fields.rs +++ b/src/test/ui/lint/lint-stability-fields.rs @@ -128,50 +128,50 @@ mod this_crate { #[stable(feature = "rust1", since = "1.0.0")] struct Stable { inherit: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override2: u8, } #[stable(feature = "rust1", since = "1.0.0")] struct Stable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] struct Unstable { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] struct Unstable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] u8); + #[unstable(feature = "unstable_test_feature")] u8); pub fn foo() { let x = Stable { diff --git a/src/test/ui/lint/lint-stability.rs b/src/test/ui/lint/lint-stability.rs index 3e4a3874d2c4a..f86707215b5e8 100644 --- a/src/test/ui/lint/lint-stability.rs +++ b/src/test/ui/lint/lint-stability.rs @@ -203,10 +203,10 @@ mod inheritance { } mod this_crate { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_text() {} @@ -214,9 +214,9 @@ mod this_crate { #[rustc_deprecated(since = "99.99.99", reason = "text")] pub fn deprecated_future() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn unstable() {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -228,16 +228,16 @@ mod this_crate { pub struct MethodTester; impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -247,16 +247,16 @@ mod this_crate { } pub trait Trait { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -267,12 +267,12 @@ mod this_crate { impl Trait for MethodTester {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } @@ -281,29 +281,29 @@ mod this_crate { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; pub enum Enum { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] StableVariant, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(isize); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] pub struct UnstableTupleStruct(isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(isize); @@ -422,7 +422,7 @@ mod this_crate { foo.trait_stable(); } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_fn_body() { fn fn_in_body() {} @@ -430,7 +430,7 @@ mod this_crate { } impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_method_body(&self) { fn fn_in_body() {} @@ -438,7 +438,7 @@ mod this_crate { } } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub trait DeprecatedTrait { fn dummy(&self) { } diff --git a/src/test/ui/macros/auxiliary/unstable-macros.rs b/src/test/ui/macros/auxiliary/unstable-macros.rs index b8d580702c9bc..20bcfed0129c2 100644 --- a/src/test/ui/macros/auxiliary/unstable-macros.rs +++ b/src/test/ui/macros/auxiliary/unstable-macros.rs @@ -1,6 +1,6 @@ #![feature(staged_api)] #![stable(feature = "unit_test", since = "1.0.0")] -#[unstable(feature = "unstable_macros", issue = "0")] +#[unstable(feature = "unstable_macros")] #[macro_export] macro_rules! unstable_macro{ () => () } diff --git a/src/test/ui/macros/macro-stability.rs b/src/test/ui/macros/macro-stability.rs index 7d1ee6a43b6ad..2fad818971636 100644 --- a/src/test/ui/macros/macro-stability.rs +++ b/src/test/ui/macros/macro-stability.rs @@ -3,7 +3,7 @@ #![feature(staged_api)] #[macro_use] extern crate unstable_macros; -#[unstable(feature = "local_unstable", issue = "0")] +#[unstable(feature = "local_unstable")] macro_rules! local_unstable { () => () } fn main() { diff --git a/src/test/ui/missing/missing-stability.rs b/src/test/ui/missing/missing-stability.rs index 469c22fdb17d7..ec410a6dafe72 100644 --- a/src/test/ui/missing/missing-stability.rs +++ b/src/test/ui/missing/missing-stability.rs @@ -10,7 +10,7 @@ pub fn unmarked() { () } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature")] pub mod foo { // #[unstable] is inherited pub fn unmarked() {} diff --git a/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs b/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs index 611a786c229cf..8bb1a275ca355 100644 --- a/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs +++ b/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs @@ -9,4 +9,4 @@ pub fn unstable() {} pub fn unstable_msg() {} #[unstable(feature = "unstable_test_feature")] -pub fn unstable_without_issue() {} \ No newline at end of file +pub fn unstable_without_issue() {} From 68f1bf04ec8cebb3e07dab64eac89a7267b948a2 Mon Sep 17 00:00:00 2001 From: Julian Wollersberger Date: Wed, 15 May 2019 19:30:48 +0200 Subject: [PATCH 6/7] Commented out the warning. --- src/libsyntax/attr/builtin.rs | 23 +++++++++++++++++------ src/libsyntax/error_codes.rs | 1 + 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index f69f5d0eefa02..07b617f8ef097 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -306,7 +306,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, handle_errors(sess, attr.span, AttrError::MultipleStabilityLevels); break } - + // Expansion of `get_meta!` let mut feature = None; let mut reason = None; @@ -341,17 +341,28 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, continue 'outer } } - + // Parse the optional symbol to an optional integer. let issue: Option = if let Some(issue_sym) = issue { if let Ok(issue_num) = issue_sym.as_str().parse() { - if issue_num == 0 { + //TODO Some ui tests fail because they directly use `thread_local!` + // internals ($SRC_DIR/libstd/thread/local.rs). That emits this warning. + // Removing the `issue = "0"` there isn't possible in libstd because the + // stage 0 compiler gives a syntax error for the missing issue. + // + // How can I fix this? + // + Don't include the warning is this PR and wait for the next + // master to beta promotion, because then I could remove the + // `issue = "0"`s in libstd and libcore + // + With a #[cfg(not(stage0))] somehow? + // + Just --bless the warnings? + /*if issue_num == 0 { //TODO How do I choose an error number? - struct_span_warn!(diagnostic, attr.span, E0545, + struct_span_warn!(diagnostic, attr.span, E0547, "Issue #0 should not be used" ).help("Consider omitting the `issue` attribute") .emit(); - } + }*/ Some(issue_num) } else { span_err!(diagnostic, attr.span, E0545, "incorrect 'issue'"); @@ -360,7 +371,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, } else { None }; - + // `feature` is required, `reason` and `issue` are optional. if let Some(feature) = feature { stab = Some(Stability { diff --git a/src/libsyntax/error_codes.rs b/src/libsyntax/error_codes.rs index da6fa80770ca1..585d81b632bf0 100644 --- a/src/libsyntax/error_codes.rs +++ b/src/libsyntax/error_codes.rs @@ -432,6 +432,7 @@ register_diagnostics! { E0544, // multiple stability levels E0545, // incorrect 'issue' E0546, // missing 'feature' + E0547, // missing 'issue' //TODO I reused this one for the warning. // E0548, // replaced with a generic attribute input check E0549, // rustc_deprecated attribute must be paired with either stable or unstable attribute E0550, // multiple deprecated attributes From eb2ebee144eee2de5e80aec944fcd83e1ba6a89d Mon Sep 17 00:00:00 2001 From: Julian Wollersberger Date: Wed, 15 May 2019 20:02:11 +0200 Subject: [PATCH 7/7] Blessed line number changes in ui tests. --- .../const-eval/dont_promote_unstable_const_fn.stderr | 8 ++++---- .../min_const_fn/min_const_fn_libstd_stability.stderr | 8 ++++---- .../min_const_unsafe_fn_libstd_stability.stderr | 8 ++++---- .../min_const_unsafe_fn_libstd_stability2.stderr | 6 +++--- .../feature-gate/stability-attribute-consistency.stderr | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr index ca80a9ab39117..69e3ca716a909 100644 --- a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr +++ b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr @@ -1,5 +1,5 @@ error: `foo` is not yet stable as a const fn - --> $DIR/dont_promote_unstable_const_fn.rs:15:25 + --> $DIR/dont_promote_unstable_const_fn.rs:14:25 | LL | const fn bar() -> u32 { foo() } | ^^^^^ @@ -7,7 +7,7 @@ LL | const fn bar() -> u32 { foo() } = help: add `#![feature(foo)]` to the crate attributes to enable error[E0716]: temporary value dropped while borrowed - --> $DIR/dont_promote_unstable_const_fn.rs:18:28 + --> $DIR/dont_promote_unstable_const_fn.rs:17:28 | LL | let _: &'static u32 = &foo(); | ------------ ^^^^^ creates a temporary which is freed while still in use @@ -17,7 +17,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0716]: temporary value dropped while borrowed - --> $DIR/dont_promote_unstable_const_fn.rs:22:28 + --> $DIR/dont_promote_unstable_const_fn.rs:21:28 | LL | let _: &'static u32 = &meh(); | ------------ ^^^^^ creates a temporary which is freed while still in use @@ -28,7 +28,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0716]: temporary value dropped while borrowed - --> $DIR/dont_promote_unstable_const_fn.rs:23:26 + --> $DIR/dont_promote_unstable_const_fn.rs:22:26 | LL | let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis(); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr index c52d7c8511561..27ddf8efa9340 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr @@ -1,5 +1,5 @@ error[E0723]: can only call other `const fn` within a `const fn`, but `const foo` is not stable as `const fn` - --> $DIR/min_const_fn_libstd_stability.rs:15:25 + --> $DIR/min_const_fn_libstd_stability.rs:14:25 | LL | const fn bar() -> u32 { foo() } | ^^^^^ @@ -8,7 +8,7 @@ LL | const fn bar() -> u32 { foo() } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: can only call other `const fn` within a `const fn`, but `const foo2` is not stable as `const fn` - --> $DIR/min_const_fn_libstd_stability.rs:22:26 + --> $DIR/min_const_fn_libstd_stability.rs:21:26 | LL | const fn bar2() -> u32 { foo2() } | ^^^^^^ @@ -17,7 +17,7 @@ LL | const fn bar2() -> u32 { foo2() } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_fn_libstd_stability.rs:26:26 + --> $DIR/min_const_fn_libstd_stability.rs:25:26 | LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 } | ^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: can only call other `const fn` within a `const fn`, but `const foo2_gated` is not stable as `const fn` - --> $DIR/min_const_fn_libstd_stability.rs:34:32 + --> $DIR/min_const_fn_libstd_stability.rs:33:32 | LL | const fn bar2_gated() -> u32 { foo2_gated() } | ^^^^^^^^^^^^ diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr index af39b99e90cc9..646b97de904c8 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr @@ -1,5 +1,5 @@ error[E0723]: can only call other `const fn` within a `const fn`, but `const foo` is not stable as `const fn` - --> $DIR/min_const_unsafe_fn_libstd_stability.rs:15:41 + --> $DIR/min_const_unsafe_fn_libstd_stability.rs:14:41 | LL | const unsafe fn bar() -> u32 { unsafe { foo() } } | ^^^^^ @@ -8,7 +8,7 @@ LL | const unsafe fn bar() -> u32 { unsafe { foo() } } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: can only call other `const fn` within a `const fn`, but `const foo2` is not stable as `const fn` - --> $DIR/min_const_unsafe_fn_libstd_stability.rs:22:42 + --> $DIR/min_const_unsafe_fn_libstd_stability.rs:21:42 | LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } } | ^^^^^^ @@ -17,7 +17,7 @@ LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_unsafe_fn_libstd_stability.rs:26:33 + --> $DIR/min_const_unsafe_fn_libstd_stability.rs:25:33 | LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } | ^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: can only call other `const fn` within a `const fn`, but `const foo2_gated` is not stable as `const fn` - --> $DIR/min_const_unsafe_fn_libstd_stability.rs:34:48 + --> $DIR/min_const_unsafe_fn_libstd_stability.rs:33:48 | LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } } | ^^^^^^^^^^^^ diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr index e4534d9ab98f6..22ab2f8878c0d 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr @@ -1,5 +1,5 @@ error[E0723]: can only call other `const fn` within a `const fn`, but `const foo` is not stable as `const fn` - --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:15:32 + --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:14:32 | LL | const unsafe fn bar() -> u32 { foo() } | ^^^^^ @@ -8,7 +8,7 @@ LL | const unsafe fn bar() -> u32 { foo() } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: can only call other `const fn` within a `const fn`, but `const foo2` is not stable as `const fn` - --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:22:33 + --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:21:33 | LL | const unsafe fn bar2() -> u32 { foo2() } | ^^^^^^ @@ -17,7 +17,7 @@ LL | const unsafe fn bar2() -> u32 { foo2() } = help: add #![feature(const_fn)] to the crate attributes to enable error[E0723]: can only call other `const fn` within a `const fn`, but `const foo2_gated` is not stable as `const fn` - --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:30:39 + --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:29:39 | LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() } | ^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gate/stability-attribute-consistency.stderr b/src/test/ui/feature-gate/stability-attribute-consistency.stderr index 9b4b28a3922cb..c6c46fdf8e254 100644 --- a/src/test/ui/feature-gate/stability-attribute-consistency.stderr +++ b/src/test/ui/feature-gate/stability-attribute-consistency.stderr @@ -7,8 +7,8 @@ LL | #[stable(feature = "foo", since = "1.29.0")] error[E0711]: feature `foo` is declared unstable, but was previously declared stable --> $DIR/stability-attribute-consistency.rs:12:1 | -LL | #[unstable(feature = "foo", issue = "0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable(feature = "foo")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors