diff options
| author | bors <bors@rust-lang.org> | 2021-02-17 19:39:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-17 19:39:58 +0000 |
| commit | 152f6609246558be5e2582e67376194815e6ba0d (patch) | |
| tree | 2ff1f32fc6c1440a034dc09c11ca80613489e1e9 /compiler/rustc_mir | |
| parent | 5ef21063f0c0fd5b973bfa8cb88c0b70982da977 (diff) | |
| parent | 03477e9a26fb1d600e21dc33116063f71ba295ef (diff) | |
| download | rust-152f6609246558be5e2582e67376194815e6ba0d.tar.gz rust-152f6609246558be5e2582e67376194815e6ba0d.zip | |
Auto merge of #82235 - GuillaumeGomez:rollup-oflxc08, r=GuillaumeGomez
Rollup of 11 pull requests Successful merges: - #79981 (Add 'consider using' message to overflowing_literals) - #82094 (To digit simplification) - #82105 (Don't fail to remove files if they are missing) - #82136 (Fix ICE: Use delay_span_bug for mismatched subst/hir arg) - #82169 (Document that `assert!` format arguments are evaluated lazily) - #82174 (Replace File::create and write_all with fs::write) - #82196 (Add caveat to Path::display() about lossiness) - #82198 (Use internal iteration in Iterator::is_sorted_by) - #82204 (Update books) - #82207 (rustdoc: treat edition 2021 as unstable) - #82231 (Add long explanation for E0543) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir')
| -rw-r--r-- | compiler/rustc_mir/src/borrow_check/diagnostics/region_name.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/region_name.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/region_name.rs index 63a3e269d61..03738f1b40a 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/region_name.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/region_name.rs @@ -634,14 +634,11 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> { | GenericArgKind::Const(_), _, ) => { - // I *think* that HIR lowering should ensure this - // doesn't happen, even in erroneous - // programs. Else we should use delay-span-bug. - span_bug!( + // HIR lowering sometimes doesn't catch this in erroneous + // programs, so we need to use delay_span_bug here. See #82126. + self.infcx.tcx.sess.delay_span_bug( hir_arg.span(), - "unmatched subst and hir arg: found {:?} vs {:?}", - kind, - hir_arg, + &format!("unmatched subst and hir arg: found {:?} vs {:?}", kind, hir_arg), ); } } |
