Open
Description
Code
#![crate_type = "lib"]
#![feature(transmutability)]
mod assert {
use std::mem::BikeshedIntrinsicFrom;
struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
Dst: BikeshedIntrinsicFrom<Src, Context>,
{
}
}
fn main() {
pub union Uninit {
a: [u8; usize::MAX],
}
#[repr(C)]
struct ExplicitlyPadded(Uninit);
assert::is_maybe_transmutable::<ExplicitlyPadded, ()>();
}
Current output
error[E0277]: `ExplicitlyPadded` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> src/lib.rs:22:55
|
22 | assert::is_maybe_transmutable::<ExplicitlyPadded, ()>();
| ^^ values of the type `ExplicitlyPadded` are too big for the current architecture
|
note: required by a bound in `is_maybe_transmutable`
--> src/lib.rs:9:14
|
7 | pub fn is_maybe_transmutable<Src, Dst>()
| --------------------- required by a bound in this function
8 | where
9 | Dst: BikeshedIntrinsicFrom<Src, Context>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` (lib) due to previous error
Desired output
22 | assert::is_maybe_transmutable::<ExplicitlyPadded, ()>();
| ^^^^^^^^^^^^^^^^ values of the type `ExplicitlyPadded` are too big for the current architecture
Rationale and extra context
seems adjust_fulfillment_error_for_expr_obligation
fix wrong span for the arguments.
Other cases
No response
Anything else?
No response