Skip to content
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

E0711 emitted even when staged_api is not enabled #106589

Closed
Ezrashaw opened this issue Jan 8, 2023 · 0 comments · Fixed by #106627
Closed

E0711 emitted even when staged_api is not enabled #106589

Ezrashaw opened this issue Jan 8, 2023 · 0 comments · Fixed by #106627
Assignees
Labels
C-bug Category: This is a bug.

Comments

@Ezrashaw
Copy link
Contributor

Ezrashaw commented Jan 8, 2023

I tried this code:

// #![feature(staged_api)] // note: `staged_api` not enabled

#![stable(feature = "foo", since = "1.0.0")]

// error: feature `foo` is declared unstable
#[unstable(feature = "foo", issue = "none")]
fn foo_unstable() {}

I expected to see this happen:

error[E0734]: stability attributes may not be used outside of the standard library
 --> src/lib.rs:6:1
  |
6 | #[unstable(feature = "foo", issue = "none")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0734]: stability attributes may not be used outside of the standard library
 --> src/lib.rs:3:1
  |
3 | #![stable(feature = "foo", since = "1.0.0")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Two errors emitted about the use of stability attributes outside the standard library (without staged_api).

Instead, this happened:

error[E0734]: stability attributes may not be used outside of the standard library
 --> src/lib.rs:6:1
  |
6 | #[unstable(feature = "foo", issue = "none")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0734]: stability attributes may not be used outside of the standard library
 --> src/lib.rs:3:1
  |
3 | #![stable(feature = "foo", since = "1.0.0")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

+error[E0711]: feature `foo` is declared unstable, but was previously declared stable
+ --> src/lib.rs:6:1
+  |
+6 | #[unstable(feature = "foo", issue = "none")]
+  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

An extra error relating to stability semantics which should not be emitted because stability attributes are not allowed here. Some permutations of this error exist: is staged_api enabled? are we on stable? etc.

Meta

Occurs on latest stable and nightly.

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant