Skip to content

Assume::NOTHING doesn't check lifetimes #164246

Closed

Description

@funsafemath

I tried this code:

#![feature(transmutability)]

fn func(n: &i32) -> &'static i32 { 
    unsafe{ core::mem::TransmuteFrom::<_, { core::mem::Assume::NOTHING }>::transmute(n) }    
}

I expected to see this happen: code doesn't compile

Instead, this happened: code compiles

The code didn't compile before #161251, so it may be caused by #163946

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=b210e3e8210e93103d5780374ce126f9

Meta

rustc 1.101.0-nightly 2026-10-12

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 13, 2026
  2. added a commit that references this issue on Oct 16, 2026
    e23a3da
  3. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 16, 2026
  4. added a commit that references this issue on Oct 16, 2026
    6f523b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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