Skip to content

Commit e6ce562

Browse files
committed
Auto merge of rust-lang#102948 - Dylan-DPC:rollup-j8h74rb, r=Dylan-DPC
Rollup of 8 pull requests Successful merges: - rust-lang#102110 (Migrate rustc_passes diagnostics) - rust-lang#102187 (Use correct location for type tests in promoted constants) - rust-lang#102239 (Move style guide to rust-lang/rust) - rust-lang#102578 (Panic for invalid arguments of `{integer primitive}::ilog{,2,10}` in all modes) - rust-lang#102811 (Use memset to initialize readbuf) - rust-lang#102890 (Check representability in adt_sized_constraint) - rust-lang#102913 (unify `IsPattern` and `IsImport` enum in `show_candidates`) - rust-lang#102924 (rustdoc: remove unused classes from sidebar links) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2b91cbe + 96bcced commit e6ce562

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4106
-1067
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
584584
// modify their locations.
585585
let all_facts = &mut None;
586586
let mut constraints = Default::default();
587+
let mut type_tests = Default::default();
587588
let mut closure_bounds = Default::default();
588589
let mut liveness_constraints =
589590
LivenessValues::new(Rc::new(RegionValueElements::new(&promoted_body)));
@@ -595,6 +596,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
595596
&mut this.cx.borrowck_context.constraints.outlives_constraints,
596597
&mut constraints,
597598
);
599+
mem::swap(&mut this.cx.borrowck_context.constraints.type_tests, &mut type_tests);
598600
mem::swap(
599601
&mut this.cx.borrowck_context.constraints.closure_bounds_mapping,
600602
&mut closure_bounds,
@@ -619,6 +621,13 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
619621
swap_constraints(self);
620622

621623
let locations = location.to_locations();
624+
625+
// Use location of promoted const in collected constraints
626+
for type_test in type_tests.iter() {
627+
let mut type_test = type_test.clone();
628+
type_test.locations = locations;
629+
self.cx.borrowck_context.constraints.type_tests.push(type_test)
630+
}
622631
for constraint in constraints.outlives().iter() {
623632
let mut constraint = constraint.clone();
624633
constraint.locations = locations;

compiler/rustc_error_messages/locales/en-US/middle.ftl

+9
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,12 @@ middle_limit_invalid =
1818
1919
middle_const_eval_non_int =
2020
constant evaluation of enum discriminant resulted in non-integer
21+
22+
middle_unknown_layout =
23+
the type `{$ty}` has an unknown layout
24+
25+
middle_values_too_big =
26+
values of the type `{$ty}` are too big for the current architecture
27+
28+
middle_cannot_be_normalized =
29+
unable to determine layout for `{$ty}` because `{$failure_ty}` cannot be normalized

0 commit comments

Comments
 (0)