diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index d6110a050f2..20c0852fe33 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -553,7 +553,7 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) { } Rvalue::Cast(CastKind::DynStar, _, _) => { - unimplemented!() + // `dyn*` coercion is implemented for CTFE. } Rvalue::Cast(_, _, _) => {} diff --git a/tests/ui/dyn-star/const-and-static.rs b/tests/ui/dyn-star/const-and-static.rs new file mode 100644 index 00000000000..551b072abfa --- /dev/null +++ b/tests/ui/dyn-star/const-and-static.rs @@ -0,0 +1,10 @@ +// check-pass + +#![feature(dyn_star)] +//~^ WARN the feature `dyn_star` is incomplete + +const C: dyn* Send + Sync = &(); + +static S: dyn* Send + Sync = &(); + +fn main() {} diff --git a/tests/ui/dyn-star/const-and-static.stderr b/tests/ui/dyn-star/const-and-static.stderr new file mode 100644 index 00000000000..df8f42fb0f5 --- /dev/null +++ b/tests/ui/dyn-star/const-and-static.stderr @@ -0,0 +1,11 @@ +warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-and-static.rs:3:12 + | +LL | #![feature(dyn_star)] + | ^^^^^^^^ + | + = note: see issue #102425 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted +