mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
18 lines
515 B
Rust
18 lines
515 B
Rust
// Variant of #117151 when the overflow comes entirely from subtype predicates.
|
|
|
|
#![allow(unreachable_code)]
|
|
|
|
use std::ptr;
|
|
|
|
fn main() {
|
|
// Give x and y completely unconstrained types. Using a function call
|
|
// or `as` cast would create a well-formed predicate.
|
|
let x = return;
|
|
let y = return;
|
|
let mut w = (x, y);
|
|
//~^ ERROR overflow assigning `_` to `*const _`
|
|
// Avoid creating lifetimes, `Sized` bounds or function calls.
|
|
let a = (ptr::addr_of!(y), ptr::addr_of!(x));
|
|
w = a;
|
|
}
|