mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Rollup merge of #109921 - compiler-errors:dyn-star-const-static, r=eholk
Don't ICE when encountering `dyn*` in statics or consts Since we have properly implemented `dyn*` support in CTFE (#107728), let's not ICE here anymore. Fixes #105777 r? `@eholk`
This commit is contained in:
commit
4b8725b854
@ -553,7 +553,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
||||
}
|
||||
|
||||
Rvalue::Cast(CastKind::DynStar, _, _) => {
|
||||
unimplemented!()
|
||||
// `dyn*` coercion is implemented for CTFE.
|
||||
}
|
||||
|
||||
Rvalue::Cast(_, _, _) => {}
|
||||
|
10
tests/ui/dyn-star/const-and-static.rs
Normal file
10
tests/ui/dyn-star/const-and-static.rs
Normal file
@ -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() {}
|
11
tests/ui/dyn-star/const-and-static.stderr
Normal file
11
tests/ui/dyn-star/const-and-static.stderr
Normal file
@ -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 <https://github.com/rust-lang/rust/issues/102425> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
Loading…
Reference in New Issue
Block a user