Skip to content

Commit 8e28978

Browse files
authored
Rollup merge of rust-lang#147226 - jdonszelmann:pattern-types-next-solver, r=lcnr
include `outer_inclusive_binder` of pattern types Fixes rust-lang/trait-system-refactor-initiative#237 r? ```@lcnr```
2 parents ae60ebd + 96fb1b3 commit 8e28978

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

compiler/rustc_type_ir/src/flags.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ impl<I: Interner> FlagComputation<I> {
347347

348348
fn add_ty_pat(&mut self, pat: <I as Interner>::Pat) {
349349
self.add_flags(pat.flags());
350+
self.add_exclusive_binder(pat.outer_exclusive_binder());
350351
}
351352

352353
fn add_predicate(&mut self, binder: ty::Binder<I, ty::PredicateKind<I>>) {

tests/ui/type/pattern_types/const_generics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
//@ check-pass
2+
//@ revisions: current next
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
4+
//@[next] compile-flags: -Znext-solver
25

36
#![feature(pattern_types, generic_pattern_types, pattern_type_macro)]
47
#![expect(incomplete_features)]

tests/ui/type/pattern_types/transmute.stderr renamed to tests/ui/type/pattern_types/transmute.current.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2-
--> $DIR/transmute.rs:20:14
2+
--> $DIR/transmute.rs:23:14
33
|
44
LL | unsafe { std::mem::transmute(x) }
55
| ^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | unsafe { std::mem::transmute(x) }
88
= note: target type: `u32` (32 bits)
99

1010
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
11-
--> $DIR/transmute.rs:28:14
11+
--> $DIR/transmute.rs:31:14
1212
|
1313
LL | unsafe { std::mem::transmute(x) }
1414
| ^^^^^^^^^^^^^^^^^^^
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2+
--> $DIR/transmute.rs:23:14
3+
|
4+
LL | unsafe { std::mem::transmute(x) }
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: source type: `Option<(u32) is S..=E>` (size can vary because of u32)
8+
= note: target type: `u32` (32 bits)
9+
10+
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
11+
--> $DIR/transmute.rs:31:14
12+
|
13+
LL | unsafe { std::mem::transmute(x) }
14+
| ^^^^^^^^^^^^^^^^^^^
15+
|
16+
= note: source type: `Option<(u32) is S..=E>` (size can vary because of u32)
17+
= note: target type: `Option<u32>` (64 bits)
18+
19+
error: aborting due to 2 previous errors
20+
21+
For more information about this error, try `rustc --explain E0512`.

tests/ui/type/pattern_types/transmute.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//@ revisions: current next
2+
//@ ignore-compare-mode-next-solver (explicit revisions)
3+
//@[next] compile-flags: -Znext-solver
14
#![feature(pattern_types, pattern_type_macro, generic_pattern_types)]
25
#![expect(incomplete_features)]
36

0 commit comments

Comments
 (0)