Skip to content

Commit

Permalink
Auto merge of rust-lang#110811 - compiler-errors:vars-are-question-ma…
Browse files Browse the repository at this point in the history
…rk, r=WaffleLapkin

Use `?0` notation for ty/ct/int/float/region vars

Aligns the notation for infer vars that T-types and friends most often uses for inference variables with the notation in the compiler (which is kinda a sigil nightmare IMO: `_#`) by adopting `?0` style infer vars.

This mostly affects debug output since verbose infer vars shouldn't show up in user-facing places.

Does this need an MCP? It's debug output, so I'm thinking no, but happy to open one. 🤔

r? types
  • Loading branch information
bors committed Apr 25, 2023
2 parents 458d4da + bb99cdc commit f33379b
Show file tree
Hide file tree
Showing 46 changed files with 307 additions and 307 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<'tcx> fmt::Debug for ty::FnSig<'tcx> {

impl<'tcx> fmt::Debug for ty::ConstVid<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "_#{}c", self.index)
write!(f, "?{}c", self.index)
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ pub struct ConstVid<'tcx> {
rustc_index::newtype_index! {
/// A **region** (lifetime) **v**ariable **ID**.
#[derive(HashStable)]
#[debug_format = "'_#{}r"]
#[debug_format = "'?{}"]
pub struct RegionVid {}
}

Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_type_ir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ pub struct FloatVarValue(pub FloatTy);

rustc_index::newtype_index! {
/// A **ty**pe **v**ariable **ID**.
#[debug_format = "_#{}t"]
#[debug_format = "?{}t"]
pub struct TyVid {}
}

Expand Down Expand Up @@ -739,13 +739,13 @@ impl fmt::Debug for FloatVarValue {

impl fmt::Debug for IntVid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "_#{}i", self.index)
write!(f, "?{}i", self.index)
}
}

impl fmt::Debug for FloatVid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "_#{}f", self.index)
write!(f, "?{}f", self.index)
}
}

Expand Down
56 changes: 28 additions & 28 deletions tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
// MIR for `use_x` 0 nll

| Free Region Mapping
| '_#0r | Global | ['_#2r, '_#1r, '_#0r, '_#4r, '_#3r]
| '_#1r | Local | ['_#1r, '_#4r]
| '_#2r | Local | ['_#2r, '_#1r, '_#4r]
| '_#3r | Local | ['_#4r, '_#3r]
| '_#4r | Local | ['_#4r]
| '?0 | Global | ['?2, '?1, '?0, '?4, '?3]
| '?1 | Local | ['?1, '?4]
| '?2 | Local | ['?2, '?1, '?4]
| '?3 | Local | ['?4, '?3]
| '?4 | Local | ['?4]
|
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=1], '_#0r, '_#1r, '_#2r, '_#3r, '_#4r}
| '_#1r | U0 | {bb0[0..=1], '_#1r}
| '_#2r | U0 | {bb0[0..=1], '_#2r}
| '_#3r | U0 | {bb0[0..=1], '_#3r}
| '_#4r | U0 | {bb0[0..=1], '_#4r}
| '_#5r | U0 | {bb0[0..=1], '_#1r}
| '_#6r | U0 | {bb0[0..=1], '_#2r}
| '_#7r | U0 | {bb0[0..=1], '_#1r}
| '_#8r | U0 | {bb0[0..=1], '_#3r}
| '?0 | U0 | {bb0[0..=1], '?0, '?1, '?2, '?3, '?4}
| '?1 | U0 | {bb0[0..=1], '?1}
| '?2 | U0 | {bb0[0..=1], '?2}
| '?3 | U0 | {bb0[0..=1], '?3}
| '?4 | U0 | {bb0[0..=1], '?4}
| '?5 | U0 | {bb0[0..=1], '?1}
| '?6 | U0 | {bb0[0..=1], '?2}
| '?7 | U0 | {bb0[0..=1], '?1}
| '?8 | U0 | {bb0[0..=1], '?3}
|
| Inference Constraints
| '_#0r live at {bb0[0..=1]}
| '_#1r live at {bb0[0..=1]}
| '_#2r live at {bb0[0..=1]}
| '_#3r live at {bb0[0..=1]}
| '_#4r live at {bb0[0..=1]}
| '_#1r: '_#5r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:26: 12:27) ($DIR/named_lifetimes_basic.rs:12:26: 12:27 (#0)
| '_#1r: '_#7r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:54: 12:55) ($DIR/named_lifetimes_basic.rs:12:54: 12:55 (#0)
| '_#2r: '_#6r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:42: 12:43) ($DIR/named_lifetimes_basic.rs:12:42: 12:43 (#0)
| '_#3r: '_#8r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:66: 12:67) ($DIR/named_lifetimes_basic.rs:12:66: 12:67 (#0)
| '_#5r: '_#1r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:26: 12:27) ($DIR/named_lifetimes_basic.rs:12:26: 12:27 (#0)
| '_#6r: '_#2r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:42: 12:43) ($DIR/named_lifetimes_basic.rs:12:42: 12:43 (#0)
| '_#7r: '_#1r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:54: 12:55) ($DIR/named_lifetimes_basic.rs:12:54: 12:55 (#0)
| '_#8r: '_#3r due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:66: 12:67) ($DIR/named_lifetimes_basic.rs:12:66: 12:67 (#0)
| '?0 live at {bb0[0..=1]}
| '?1 live at {bb0[0..=1]}
| '?2 live at {bb0[0..=1]}
| '?3 live at {bb0[0..=1]}
| '?4 live at {bb0[0..=1]}
| '?1: '?5 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:26: 12:27) ($DIR/named_lifetimes_basic.rs:12:26: 12:27 (#0)
| '?1: '?7 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:54: 12:55) ($DIR/named_lifetimes_basic.rs:12:54: 12:55 (#0)
| '?2: '?6 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:42: 12:43) ($DIR/named_lifetimes_basic.rs:12:42: 12:43 (#0)
| '?3: '?8 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:66: 12:67) ($DIR/named_lifetimes_basic.rs:12:66: 12:67 (#0)
| '?5: '?1 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:26: 12:27) ($DIR/named_lifetimes_basic.rs:12:26: 12:27 (#0)
| '?6: '?2 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:42: 12:43) ($DIR/named_lifetimes_basic.rs:12:42: 12:43 (#0)
| '?7: '?1 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:54: 12:55) ($DIR/named_lifetimes_basic.rs:12:54: 12:55 (#0)
| '?8: '?3 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:66: 12:67) ($DIR/named_lifetimes_basic.rs:12:66: 12:67 (#0)
|
fn use_x(_1: &'_#5r mut i32, _2: &'_#6r u32, _3: &'_#7r u32, _4: &'_#8r u32) -> bool {
fn use_x(_1: &'?5 mut i32, _2: &'?6 u32, _3: &'?7 u32, _4: &'?8 u32) -> bool {
debug w => _1; // in scope 0 at $DIR/named_lifetimes_basic.rs:+0:26: +0:27
debug x => _2; // in scope 0 at $DIR/named_lifetimes_basic.rs:+0:42: +0:43
debug y => _3; // in scope 0 at $DIR/named_lifetimes_basic.rs:+0:54: +0:55
Expand Down
34 changes: 17 additions & 17 deletions tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// MIR for `main` 0 nll

| Free Region Mapping
| '_#0r | Global | ['_#0r, '_#1r]
| '_#1r | Local | ['_#1r]
| '?0 | Global | ['?0, '?1]
| '?1 | Local | ['?1]
|
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r}
| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r}
| '_#2r | U0 | {bb1[0..=7], bb2[0..=2]}
| '_#3r | U0 | {bb1[1..=7], bb2[0..=2]}
| '_#4r | U0 | {bb1[4..=7], bb2[0..=2]}
| '?0 | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '?0, '?1}
| '?1 | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '?1}
| '?2 | U0 | {bb1[0..=7], bb2[0..=2]}
| '?3 | U0 | {bb1[1..=7], bb2[0..=2]}
| '?4 | U0 | {bb1[4..=7], bb2[0..=2]}
|
| Inference Constraints
| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '_#2r live at {bb1[0]}
| '_#3r live at {bb1[1..=3]}
| '_#4r live at {bb1[4..=7], bb2[0..=2]}
| '_#2r: '_#3r due to Assignment at Single(bb1[0]) ($DIR/region_subtyping_basic.rs:18:13: 18:18 (#0)
| '_#3r: '_#4r due to Assignment at Single(bb1[3]) ($DIR/region_subtyping_basic.rs:19:13: 19:14 (#0)
| '?0 live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '?1 live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '?2 live at {bb1[0]}
| '?3 live at {bb1[1..=3]}
| '?4 live at {bb1[4..=7], bb2[0..=2]}
| '?2: '?3 due to Assignment at Single(bb1[0]) ($DIR/region_subtyping_basic.rs:18:13: 18:18 (#0)
| '?3: '?4 due to Assignment at Single(bb1[3]) ($DIR/region_subtyping_basic.rs:19:13: 19:14 (#0)
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11
Expand All @@ -32,10 +32,10 @@ fn main() -> () {
let _10: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
scope 1 {
debug v => _1; // in scope 1 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
let _2: &'_#3r usize; // in scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
let _2: &'?3 usize; // in scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
scope 2 {
debug p => _2; // in scope 2 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
let _6: &'_#4r usize; // in scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
let _6: &'?4 usize; // in scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
scope 3 {
debug q => _6; // in scope 3 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
}
Expand All @@ -55,7 +55,7 @@ fn main() -> () {
}

bb1: {
_2 = &'_#2r _1[_3]; // bb1[0]: scope 1 at $DIR/region_subtyping_basic.rs:+2:13: +2:18
_2 = &'?2 _1[_3]; // bb1[0]: scope 1 at $DIR/region_subtyping_basic.rs:+2:13: +2:18
FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
StorageLive(_6); // bb1[2]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
_6 = _2; // bb1[3]: scope 2 at $DIR/region_subtyping_basic.rs:+3:13: +3:14
Expand Down
34 changes: 17 additions & 17 deletions tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// MIR for `main` 0 nll

| Free Region Mapping
| '_#0r | Global | ['_#0r, '_#1r]
| '_#1r | Local | ['_#1r]
| '?0 | Global | ['?0, '?1]
| '?1 | Local | ['?1]
|
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r}
| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r}
| '_#2r | U0 | {bb1[0..=7], bb2[0..=2]}
| '_#3r | U0 | {bb1[1..=7], bb2[0..=2]}
| '_#4r | U0 | {bb1[4..=7], bb2[0..=2]}
| '?0 | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '?0, '?1}
| '?1 | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '?1}
| '?2 | U0 | {bb1[0..=7], bb2[0..=2]}
| '?3 | U0 | {bb1[1..=7], bb2[0..=2]}
| '?4 | U0 | {bb1[4..=7], bb2[0..=2]}
|
| Inference Constraints
| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '_#2r live at {bb1[0]}
| '_#3r live at {bb1[1..=3]}
| '_#4r live at {bb1[4..=7], bb2[0..=2]}
| '_#2r: '_#3r due to Assignment at Single(bb1[0]) ($DIR/region_subtyping_basic.rs:18:13: 18:18 (#0)
| '_#3r: '_#4r due to Assignment at Single(bb1[3]) ($DIR/region_subtyping_basic.rs:19:13: 19:14 (#0)
| '?0 live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '?1 live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '?2 live at {bb1[0]}
| '?3 live at {bb1[1..=3]}
| '?4 live at {bb1[4..=7], bb2[0..=2]}
| '?2: '?3 due to Assignment at Single(bb1[0]) ($DIR/region_subtyping_basic.rs:18:13: 18:18 (#0)
| '?3: '?4 due to Assignment at Single(bb1[3]) ($DIR/region_subtyping_basic.rs:19:13: 19:14 (#0)
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11
Expand All @@ -32,10 +32,10 @@ fn main() -> () {
let _10: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
scope 1 {
debug v => _1; // in scope 1 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
let _2: &'_#3r usize; // in scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
let _2: &'?3 usize; // in scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
scope 2 {
debug p => _2; // in scope 2 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
let _6: &'_#4r usize; // in scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
let _6: &'?4 usize; // in scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
scope 3 {
debug q => _6; // in scope 3 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
}
Expand All @@ -55,7 +55,7 @@ fn main() -> () {
}

bb1: {
_2 = &'_#2r _1[_3]; // bb1[0]: scope 1 at $DIR/region_subtyping_basic.rs:+2:13: +2:18
_2 = &'?2 _1[_3]; // bb1[0]: scope 1 at $DIR/region_subtyping_basic.rs:+2:13: +2:18
FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
StorageLive(_6); // bb1[2]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
_6 = _2; // bb1[3]: scope 2 at $DIR/region_subtyping_basic.rs:+3:13: +3:14
Expand Down
22 changes: 11 additions & 11 deletions tests/mir-opt/storage_ranges.main.nll.0.mir
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// MIR for `main` 0 nll

| Free Region Mapping
| '_#0r | Global | ['_#0r, '_#1r]
| '_#1r | Local | ['_#1r]
| '?0 | Global | ['?0, '?1]
| '?1 | Local | ['?1]
|
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=22], '_#0r, '_#1r}
| '_#1r | U0 | {bb0[0..=22], '_#1r}
| '_#2r | U0 | {bb0[10..=11]}
| '_#3r | U0 | {bb0[11]}
| '?0 | U0 | {bb0[0..=22], '?0, '?1}
| '?1 | U0 | {bb0[0..=22], '?1}
| '?2 | U0 | {bb0[10..=11]}
| '?3 | U0 | {bb0[11]}
|
| Inference Constraints
| '_#0r live at {bb0[0..=22]}
| '_#1r live at {bb0[0..=22]}
| '_#2r live at {bb0[10]}
| '_#3r live at {bb0[11]}
| '_#2r: '_#3r due to Assignment at Single(bb0[10]) ($DIR/storage_ranges.rs:6:17: 6:25 (#0)
| '?0 live at {bb0[0..=22]}
| '?1 live at {bb0[0..=22]}
| '?2 live at {bb0[10]}
| '?3 live at {bb0[11]}
| '?2: '?3 due to Assignment at Single(bb0[10]) ($DIR/storage_ranges.rs:6:17: 6:25 (#0)
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/storage_ranges.rs:+0:11: +0:11
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/associated-types/substs-ppaux.verbose.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ LL | <str as Foo<u8>>::bar;
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
note: required for `str` to implement `Foo<'_#0r, '_#1r, u8>`
note: required for `str` to implement `Foo<'?0, '?1, u8>`
--> $DIR/substs-ppaux.rs:11:17
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/closures/binder/nested-closures-regions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
extern "rust-call" fn((&(),)),
(),
]
= note: late-bound region is '_#4r
= note: late-bound region is '_#2r
= note: late-bound region is '?4
= note: late-bound region is '?2
= note: number of external vids: 3
= note: where '_#1r: '_#2r
= note: where '_#2r: '_#1r
= note: where '?1: '?2
= note: where '?2: '?1

note: no external requirements
--> $DIR/nested-closures-regions.rs:8:5
Expand All @@ -26,7 +26,7 @@ LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
extern "rust-call" fn(()),
(),
]
= note: late-bound region is '_#2r
= note: late-bound region is '?2

note: no external requirements
--> $DIR/nested-closures-regions.rs:7:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LL | let c1 : () = c;
| expected due to this
|
= note: expected unit type `()`
found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable) substs=[T, ?16t, extern "rust-call" fn(()), ?15t]]`
help: use parentheses to call this closure
|
LL | let c1 : () = c();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0382]: use of moved value: `c`
--> $DIR/closure-print-generic-verbose-1.rs:17:5
|
LL | let c = to_fn_once(move|| {
| - move occurs because `c` has type `[f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'_#9r str>, T)]`, which does not implement the `Copy` trait
| - move occurs because `c` has type `[f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'?9 str>, T)]`, which does not implement the `Copy` trait
...
LL | c();
| --- `c` moved due to this call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LL | let c1 : () = c;
| expected due to this
|
= note: expected unit type `()`
found closure `[f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
found closure `[f<T>::{closure#0} closure_substs=(unavailable) substs=[T, ?16t, extern "rust-call" fn(()), ?15t]]`
help: use parentheses to call this closure
|
LL | let c1 : () = c();
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/closures/print/closure-print-verbose.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
| expected due to this
|
= note: expected fn pointer `fn(u8) -> u8`
found closure `[main::{closure#0} closure_substs=(unavailable) substs=[i8, extern "rust-call" fn((u8,)) -> u8, _#6t]]`
found closure `[main::{closure#0} closure_substs=(unavailable) substs=[i8, extern "rust-call" fn((u8,)) -> u8, ?6t]]`
note: closures can only be coerced to `fn` types if they do not capture any variables
--> $DIR/closure-print-verbose.rs:10:39
|
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/const-generics/occurs-check/unused-substs-2.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(?1t)` subst.
//
// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an
// If we are then able to infer `ty::Infer(TyVar(?1t) := Ty<ct>` we introduced an
// artificial inference cycle.
struct Foo<const N: usize>;

Expand All @@ -20,8 +20,8 @@ impl<T> Bind<T> for Foo<{ 6 + 1 }> {

fn main() {
let (mut t, foo) = Foo::bind();
// `t` is `ty::Infer(TyVar(_#1t))`
// `foo` contains `ty::Infer(TyVar(_#1t))` in its substs
// `t` is `ty::Infer(TyVar(?1t))`
// `foo` contains `ty::Infer(TyVar(?1t))` in its substs
t = foo;
//~^ ERROR mismatched types
//~| NOTE cyclic type
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/const-generics/occurs-check/unused-substs-3.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(?1t)` subst.
//
// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an
// If we are then able to infer `ty::Infer(TyVar(?1t) := Ty<ct>` we introduced an
// artificial inference cycle.
fn bind<T>() -> (T, [u8; 6 + 1]) {
todo!()
}

fn main() {
let (mut t, foo) = bind();
// `t` is `ty::Infer(TyVar(_#1t))`
// `foo` contains `ty::Infer(TyVar(_#1t))` in its substs
// `t` is `ty::Infer(TyVar(?1t))`
// `foo` contains `ty::Infer(TyVar(?1t))` in its substs
t = foo;
//~^ ERROR mismatched types
//~| NOTE cyclic type
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/generator/issue-57084.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This issue reproduces an ICE on compile (E.g. fails on 2018-12-19 nightly).
// "cannot relate bound region: ReLateBound(DebruijnIndex(1), BrAnon(1)) <= '_#1r"
// "cannot relate bound region: ReLateBound(DebruijnIndex(1), BrAnon(1)) <= '?1"
// run-pass
// edition:2018
#![feature(generators,generator_trait)]
Expand Down
Loading

0 comments on commit f33379b

Please sign in to comment.