error[E0606]: casting `*const dyn A` as `*const dyn B` is invalid --> $DIR/ptr-to-trait-obj-different-args.rs:18:27 | LL | let b: *const dyn B = a as _; | ^^^^^^ | = note: the trait objects may have different vtables error[E0606]: casting `*const dyn Trait` as `*const dyn Trait` is invalid --> $DIR/ptr-to-trait-obj-different-args.rs:21:34 | LL | let y: *const dyn Trait = x as _; | ^^^^^^ | = note: the trait objects may have different vtables error[E0606]: casting `*const (dyn Trait + 'static)` as `*const dyn Trait` is invalid --> $DIR/ptr-to-trait-obj-different-args.rs:27:34 | LL | let _: *const dyn Trait = x as _; | ^^^^^^ | = note: the trait objects may have different vtables error[E0606]: casting `*const (dyn Trait + 'static)` as `*const dyn Trait` is invalid --> $DIR/ptr-to-trait-obj-different-args.rs:28:34 | LL | let _: *const dyn Trait = t as _; | ^^^^^^ | = note: the trait objects may have different vtables error[E0606]: casting `*mut (dyn Assocked + 'static)` as `*mut (dyn Assocked + 'static)` is invalid --> $DIR/ptr-to-trait-obj-different-args.rs:36:5 | LL | x as _ | ^^^^^^ | = note: the trait objects may have different vtables error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0606`.