rust/tests/ui/traits/dyn-star-drop-principal.rs

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

13 lines
369 B
Rust
Raw Permalink Normal View History

2024-07-10 12:00:36 -05:00
#![feature(dyn_star)]
#![allow(incomplete_features)]
trait Trait {}
impl Trait for usize {}
fn main() {
// We allow &dyn Trait + Send -> &dyn Send (i.e. dropping principal),
// but we don't (currently?) allow the same for dyn*
let x: dyn* Trait + Send = 1usize;
x as dyn* Send; //~ error: `dyn* Trait + Send` needs to have the same ABI as a pointer
}