`-Znext-solver=globally` breaks `TransmuteFrom<&T>`
Open
Nobody has claimed this yet.
C-bug
F-transmutability
needs-triage
T-compiler
WG-trait-system-refactor
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
#![feature(transmutability)]
use std::mem::TransmuteFrom;
fn main() {
let bytes: &[u8; 4] = unsafe { TransmuteFrom::<&i32>::transmute(&1i32) };
}
I expected to see this happen: code compiles (it does with -Znext-solver=coherence)
Instead, this happened: code doesn't compile
Meta
rustc --version --verbose:
rustc 1.100.0-nightly (67854e511 2026-08-15)
binary: rustc
commit-hash: 67854e511de21d881bb16426996cd4259d44aa2e
commit-date: 2026-08-15
host: x86_64-unknown-linux-gnu
release: 1.100.0-nightly
LLVM version: 23.1.0
Backtrace
error[E0277]: `&i32` cannot be safely transmuted into `&[u8; 4]`
|
6 | let bytes: &[u8; 4] = unsafe { TransmuteFrom::<&i32>::transmute(&1i32) };
| -------------------------------- ^^^^^ the nightly-only, unstable trait `TransmuteFrom<&i32, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `&[u8; 4]`
| |
| required by a bound introduced by this call
For more information about this error, try `rustc --explain E0277`.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied minimal Rust program and run it on the stated nightly compiler with -Znext-solver=globally, comparing the result with -Znext-solver=coherence. Investigate the TransmuteFrom<&i32> trait-solving path; done means the example compiles with the global solver as it does with the coherence solver.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100