Skip to content

stability attribute checking assumes that ! is unstable #162116

Closed

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

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Sep 1, 2026
  2. GrigorenkoPV commented on Sep 1, 2026

    @GrigorenkoPV
    Contributor

    @rustbot claim

  3. added a commit that references this issue on Sep 2, 2026
    65b6e38
  4. added a commit that references this issue on Sep 2, 2026
    02f1be7
  5. added 2 commits that reference this issue on Sep 2, 2026
    dd7c463
    e151bd5
  6. added 3 commits that reference this issue on Sep 2, 2026
    a735d84
    c0e3b86
    a9788b1
  7. added a commit that references this issue on Sep 2, 2026
    4ca6f9d
  8. added a commit that references this issue on Sep 3, 2026
    aaea34b
  9. added a commit that references this issue on Sep 3, 2026
    04abbba
  10. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Sep 3, 2026
  11. added a commit that references this issue on Sep 3, 2026
    89bb80f
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