Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e7772f2
use posix_memalign on most Unix targets
RalfJung May 19, 2024
3c2d9c2
fix typo
RalfJung May 19, 2024
dc8d1bc
Add more tests
oli-obk May 23, 2024
29a630e
When checking whether an impl applies, constrain hidden types of opaq…
oli-obk Apr 17, 2024
7f292f4
Allow defining opaque types during trait object upcasting.
oli-obk Apr 17, 2024
4387eea
Support constraining opaque types while trait upcasting with binders
oli-obk Apr 17, 2024
09c8e39
A small diagnostic improvement for dropping_copy_types
surechen May 22, 2024
3fe3157
Stop using the avx512er and avx512pf x86 target features
zmodem May 24, 2024
ebd9f35
remove proof tree formatter, make em shallow
lcnr May 24, 2024
1af490d
Better ICE message for unresolved upvars
compiler-errors May 24, 2024
9185ddb
bootstrap: support target specific config overrides
weihanglo May 24, 2024
d1f0bc7
bootstrap: test target specific config overrides
weihanglo May 24, 2024
61aac55
Structurally resolve before builtin_index in EUV
compiler-errors May 24, 2024
f4b9ac6
Add manual Sync impl for ReentrantLockGuard
programmerjake May 24, 2024
045f448
Don't eagerly monomorphize drop for types that are impossible to inst…
compiler-errors May 24, 2024
8f00197
Rollup merge of #124080 - oli-obk:define_opaque_types10, r=compiler-e…
workingjubilee May 25, 2024
508d5e4
Rollup merge of #125271 - RalfJung:posix_memalign, r=workingjubilee
workingjubilee May 25, 2024
05fefb5
Rollup merge of #125433 - surechen:fix_125189, r=Urgau
workingjubilee May 25, 2024
5edded5
Rollup merge of #125498 - zmodem:avx512er, r=workingjubilee
workingjubilee May 25, 2024
f528aab
Rollup merge of #125510 - lcnr:change-proof-trees-to-be-shallow, r=co…
workingjubilee May 25, 2024
a570549
Rollup merge of #125513 - compiler-errors:impossible-drop, r=jackh726
workingjubilee May 25, 2024
12e92c4
Rollup merge of #125514 - compiler-errors:builtin-index, r=lcnr
workingjubilee May 25, 2024
836487b
Rollup merge of #125515 - weihanglo:target-toml-override, r=onur-ozkan
workingjubilee May 25, 2024
f8346f0
Rollup merge of #125527 - programmerjake:patch-2, r=workingjubilee
workingjubilee May 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Better ICE message for unresolved upvars
  • Loading branch information
compiler-errors committed May 24, 2024
commit 1af490de424ac07fbeb3b1a0a1268cad43fdf49d
15 changes: 13 additions & 2 deletions compiler/rustc_mir_build/src/build/expr/as_place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::build::expr::category::Category;
use crate::build::ForGuard::{OutsideGuard, RefWithinGuard};
use crate::build::{BlockAnd, BlockAndExtension, Builder, Capture, CaptureMap};
use rustc_hir::def_id::LocalDefId;
use rustc_middle::bug;
use rustc_middle::hir::place::Projection as HirProjection;
use rustc_middle::hir::place::ProjectionKind as HirProjectionKind;
use rustc_middle::middle::region;
Expand All @@ -13,6 +12,7 @@ use rustc_middle::mir::*;
use rustc_middle::thir::*;
use rustc_middle::ty::AdtDef;
use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty, Variance};
use rustc_middle::{bug, span_bug};
use rustc_span::Span;
use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT};
use tracing::{debug, instrument, trace};
Expand Down Expand Up @@ -252,7 +252,18 @@ fn strip_prefix<'a, 'tcx>(

impl<'tcx> PlaceBuilder<'tcx> {
pub(in crate::build) fn to_place(&self, cx: &Builder<'_, 'tcx>) -> Place<'tcx> {
self.try_to_place(cx).unwrap()
self.try_to_place(cx).unwrap_or_else(|| match self.base {
PlaceBase::Local(local) => span_bug!(
cx.local_decls[local].source_info.span,
"could not resolve local: {local:#?} + {:?}",
self.projection
),
PlaceBase::Upvar { var_hir_id, closure_def_id: _ } => span_bug!(
cx.tcx.hir().span(var_hir_id.0),
"could not resolve upvar: {var_hir_id:?} + {:?}",
self.projection
),
})
}

/// Creates a `Place` or returns `None` if an upvar cannot be resolved
Expand Down