diff options
| author | bors <bors@rust-lang.org> | 2024-07-20 05:26:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-20 05:26:55 +0000 |
| commit | 0c1448d75fbcec5c5c62948be8a2ff86955a974f (patch) | |
| tree | 8ddb7dcccff6cc7050fc7b926e4ff5144ddc7be6 /compiler/rustc_pattern_analysis/src | |
| parent | b3736d687a75a029620d86a23a51bdfeb3383701 (diff) | |
| parent | 424d79cde0634ef9ba0320c894146d8b788a38f4 (diff) | |
| download | rust-0c1448d75fbcec5c5c62948be8a2ff86955a974f.tar.gz rust-0c1448d75fbcec5c5c62948be8a2ff86955a974f.zip | |
Auto merge of #3755 - rust-lang:rustup-2024-07-20, r=RalfJung
Automatic Rustup
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/lib.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 18 |
2 files changed, 15 insertions, 7 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index c9590ad06b0..1b4bcb789d2 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -21,9 +21,7 @@ rustc_fluent_macro::fluent_messages! { "../messages.ftl" } use std::fmt; -// Re-exports to avoid rustc_index version issues. -pub use rustc_index::Idx; -pub use rustc_index::IndexVec; +pub use rustc_index::{Idx, IndexVec}; // re-exported to avoid rustc_index version issues #[cfg(feature = "rustc")] use rustc_middle::ty::Ty; diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index d4dd4dd858c..d17ee8bff50 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -462,7 +462,12 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { // This is a box pattern. ty::Adt(adt, ..) if adt.is_box() => Struct, ty::Ref(..) => Ref, - _ => bug!("pattern has unexpected type: pat: {:?}, ty: {:?}", pat, ty), + _ => span_bug!( + pat.span, + "pattern has unexpected type: pat: {:?}, ty: {:?}", + pat.kind, + ty.inner() + ), }; } PatKind::DerefPattern { .. } => { @@ -518,7 +523,12 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { .map(|ipat| self.lower_pat(&ipat.pattern).at_index(ipat.field.index())) .collect(); } - _ => bug!("pattern has unexpected type: pat: {:?}, ty: {:?}", pat, ty), + _ => span_bug!( + pat.span, + "pattern has unexpected type: pat: {:?}, ty: {}", + pat.kind, + ty.inner() + ), } } PatKind::Constant { value } => { @@ -663,7 +673,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { } } } - _ => bug!("invalid type for range pattern: {}", ty.inner()), + _ => span_bug!(pat.span, "invalid type for range pattern: {}", ty.inner()), }; fields = vec![]; arity = 0; @@ -674,7 +684,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { Some(length.eval_target_usize(cx.tcx, cx.param_env) as usize) } ty::Slice(_) => None, - _ => span_bug!(pat.span, "bad ty {:?} for slice pattern", ty), + _ => span_bug!(pat.span, "bad ty {} for slice pattern", ty.inner()), }; let kind = if slice.is_some() { SliceKind::VarLen(prefix.len(), suffix.len()) |
