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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions