rust/tests/ui/dyn-star/error.rs
Kevin Reid 5c04151c6c Implement PointerLike for isize, NonNull, Cell, UnsafeCell, and SyncUnsafeCell.
Implementing `PointerLike` for `UnsafeCell` enables the possibility of
interior mutable `dyn*` values. Since this means potentially exercising
new codegen behavior, I added a test for it in `tests/ui/dyn-star/cell.rs`.

Also updated UI tests to account for the `isize` implementation changing
error messages.
2024-12-22 11:18:56 -08:00

13 lines
229 B
Rust

#![feature(dyn_star)]
#![allow(incomplete_features)]
use std::fmt::Debug;
trait Foo {}
fn make_dyn_star() {
let i = 42usize;
let dyn_i: dyn* Foo = i; //~ ERROR trait bound `usize: Foo` is not satisfied
}
fn main() {}