Skip to content

stability attribute checking assumes that ! is unstable #162116

Description

@mejrs

I tried this code:

#![allow(internal_features)]
#![feature(staged_api)]
#![stable(feature = "a", since = "1.0.0")]

#[stable(feature = "a", since = "1.0.0")]
pub trait Trait {}

#[unstable(feature = "b", issue = "none")]
impl Trait for ! {}

I expected to see this happen:

error: an `#[unstable]` annotation here has no effect
 --> src/lib.rs:8:1
  |
8 | #[unstable(feature = "b", issue = "none")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information
  = note: `#[deny(ineffective_unstable_trait_impl)]` on by default

Instead, this happened: no diagnostic issued

Meta

rustc --version --verbose:

any since never type stabilization

Probably related piece of code:

if let TyKind::Never = t.kind {
self.fully_stable = false;
}

cc @WaffleLapkin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions