diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-11-20 04:06:39 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-12-04 20:29:36 +0000 |
| commit | a6040bc230bc7b26f413d7fbf60402e6e7940192 (patch) | |
| tree | e2a4dbce4cce22218605551440673daad935c98d /compiler/rustc_mir_build/src/errors.rs | |
| parent | 253eb95d4582e1abffc4a74dd8eaccd5b94b5d6f (diff) | |
| download | rust-a6040bc230bc7b26f413d7fbf60402e6e7940192.tar.gz rust-a6040bc230bc7b26f413d7fbf60402e6e7940192.zip | |
Specify type kind of constant that can't be used in patterns
``` error: trait object `dyn Send` cannot be used in patterns --> $DIR/issue-70972-dyn-trait.rs:6:9 | LL | const F: &'static dyn Send = &7u32; | -------------------------- constant defined here ... LL | F => panic!(), | ^ trait object can't be used in patterns ```
Diffstat (limited to 'compiler/rustc_mir_build/src/errors.rs')
| -rw-r--r-- | compiler/rustc_mir_build/src/errors.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_mir_build/src/errors.rs b/compiler/rustc_mir_build/src/errors.rs index 1c4de5c07a1..2741830c62d 100644 --- a/compiler/rustc_mir_build/src/errors.rs +++ b/compiler/rustc_mir_build/src/errors.rs @@ -903,8 +903,10 @@ pub(crate) struct TypeNotPartialEq<'tcx> { #[diag(mir_build_invalid_pattern)] pub(crate) struct InvalidPattern<'tcx> { #[primary_span] + #[label] pub(crate) span: Span, pub(crate) non_sm_ty: Ty<'tcx>, + pub(crate) prefix: String, } #[derive(Diagnostic)] |
