rust/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
311 B
Rust
Raw Normal View History

use std::fmt::Debug;
fn make_dyn_star() {
let i = 42usize;
let dyn_i: dyn* Debug = i as dyn* Debug;
//~^ ERROR casting `usize` as `dyn* Debug` is invalid
//~| ERROR `dyn*` trait objects are experimental
//~| ERROR `dyn*` trait objects are experimental
}
fn main() {
make_dyn_star();
}