1
Fork 0

update region debug formatting

This commit is contained in:
Boxy 2024-03-12 15:53:35 +00:00
parent 13abc0ac9b
commit 8124b26122
32 changed files with 201 additions and 164 deletions

View file

@ -336,7 +336,9 @@ pub struct EarlyParamRegion {
impl std::fmt::Debug for EarlyParamRegion { impl std::fmt::Debug for EarlyParamRegion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}, {}, {}", self.def_id, self.index, self.name) // FIXME(BoxyUwU): self.def_id goes first because of `erased-regions-in-hidden-ty.rs` being impossible to write
// error annotations for otherwise. :). Ideally this would be `self.name, self.index, self.def_id`.
write!(f, "{:?}_{}/#{}", self.def_id, self.name, self.index)
} }
} }
@ -381,13 +383,25 @@ pub enum BoundRegionKind {
BrEnv, BrEnv,
} }
#[derive(Copy, Clone, PartialEq, Eq, Hash, TyEncodable, TyDecodable, Debug, PartialOrd, Ord)] #[derive(Copy, Clone, PartialEq, Eq, Hash, TyEncodable, TyDecodable, PartialOrd, Ord)]
#[derive(HashStable)] #[derive(HashStable)]
pub struct BoundRegion { pub struct BoundRegion {
pub var: BoundVar, pub var: BoundVar,
pub kind: BoundRegionKind, pub kind: BoundRegionKind,
} }
impl core::fmt::Debug for BoundRegion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self.kind {
BoundRegionKind::BrAnon => write!(f, "{:?}", self.var),
BoundRegionKind::BrEnv => write!(f, "{:?}.Env", self.var),
BoundRegionKind::BrNamed(def, symbol) => {
write!(f, "{:?}.Named({:?}, {:?})", self.var, def, symbol)
}
}
}
}
impl BoundRegionKind { impl BoundRegionKind {
pub fn is_named(&self) -> bool { pub fn is_named(&self) -> bool {
match *self { match *self {

View file

@ -223,23 +223,27 @@ impl<I: Interner> DebugWithInfcx<I> for RegionKind<I> {
f: &mut core::fmt::Formatter<'_>, f: &mut core::fmt::Formatter<'_>,
) -> core::fmt::Result { ) -> core::fmt::Result {
match this.data { match this.data {
ReEarlyParam(data) => write!(f, "ReEarlyParam({data:?})"), ReEarlyParam(data) => write!(f, "{data:?}"),
ReBound(binder_id, bound_region) => { ReBound(binder_id, bound_region) => {
write!(f, "ReBound({binder_id:?}, {bound_region:?})") write!(f, "'")?;
crate::debug_bound_var(f, *binder_id, bound_region)
} }
ReLateParam(fr) => write!(f, "{fr:?}"), ReLateParam(fr) => write!(f, "{fr:?}"),
ReStatic => f.write_str("ReStatic"), ReStatic => f.write_str("'static"),
ReVar(vid) => write!(f, "{:?}", &this.wrap(vid)), ReVar(vid) => write!(f, "{:?}", &this.wrap(vid)),
RePlaceholder(placeholder) => write!(f, "RePlaceholder({placeholder:?})"), RePlaceholder(placeholder) => write!(f, "{placeholder:?}"),
ReErased => f.write_str("ReErased"), // Use `'{erased}` as the output instead of `'erased` so that its more obviously distinct from
// a `ReEarlyParam` named `'erased`. Technically that would print as `'erased/#IDX` so this is
// not strictly necessary but *shrug*
ReErased => f.write_str("'{erased}"),
ReError(_) => f.write_str("ReError"), ReError(_) => f.write_str("'{region error}"),
} }
} }
} }

View file

@ -2,7 +2,7 @@
| User Type Annotations | User Type Annotations
| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &ReStatic [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &'static [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| |
fn main() -> () { fn main() -> () {
let mut _0: (); let mut _0: ();

View file

@ -2,7 +2,7 @@
| User Type Annotations | User Type Annotations
| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &ReStatic [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &'static [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| |
fn main() -> () { fn main() -> () {
let mut _0: (); let mut _0: ();

View file

@ -1,47 +1,51 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:16:17 --> $DIR/substs-ppaux.rs:23:17
| |
LL | fn bar<'a, T>() where T: 'a {} LL | / fn bar<'a, T>()
| --------------------------- associated function `bar` defined here LL | | where
LL | | T: 'a,
| |______________- associated function `bar` defined here
... ...
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item
| | | |
| expected due to this | expected due to this
| |
= note: expected unit type `()` = note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}` found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
help: use parentheses to call this associated function help: use parentheses to call this associated function
| |
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>(); LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
| ++ | ++
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:25:17 --> $DIR/substs-ppaux.rs:31:17
| |
LL | fn bar<'a, T>() where T: 'a {} LL | / fn bar<'a, T>()
| --------------------------- associated function `bar` defined here LL | | where
LL | | T: 'a,
| |______________- associated function `bar` defined here
... ...
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item
| | | |
| expected due to this | expected due to this
| |
= note: expected unit type `()` = note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}` found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
help: use parentheses to call this associated function help: use parentheses to call this associated function
| |
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>(); LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
| ++ | ++
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:33:17 --> $DIR/substs-ppaux.rs:39:17
| |
LL | fn baz() {} LL | fn baz() {}
| -------- associated function `baz` defined here | -------- associated function `baz` defined here
... ...
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item
| | | |
| expected due to this | expected due to this
| |
@ -49,19 +53,21 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}` found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
help: use parentheses to call this associated function help: use parentheses to call this associated function
| |
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz(); LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
| ++ | ++
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:41:17 --> $DIR/substs-ppaux.rs:47:17
| |
LL | fn foo<'z>() where &'z (): Sized { LL | / fn foo<'z>()
| -------------------------------- function `foo` defined here LL | | where
LL | | &'z (): Sized,
| |__________________- function `foo` defined here
... ...
LL | let x: () = foo::<'static>; LL | let x: () = foo::<'static>;
| -- ^^^^^^^^^^^^^^ expected `()`, found fn item | -- ^^^^^^^^^^^^^^ expected `()`, found fn item
| | | |
| expected due to this | expected due to this
| |
= note: expected unit type `()` = note: expected unit type `()`
found fn item `fn() {foo::<'static>}` found fn item `fn() {foo::<'static>}`
@ -71,18 +77,18 @@ LL | let x: () = foo::<'static>();
| ++ | ++
error[E0277]: the trait bound `str: Foo<'_, '_, u8>` is not satisfied error[E0277]: the trait bound `str: Foo<'_, '_, u8>` is not satisfied
--> $DIR/substs-ppaux.rs:49:6 --> $DIR/substs-ppaux.rs:55:6
| |
LL | <str as Foo<u8>>::bar; LL | <str as Foo<u8>>::bar;
| ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'_, '_, u8>` | ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'_, '_, u8>`
| |
note: required for `str` to implement `Foo<'_, '_, u8>` note: required for `str` to implement `Foo<'_, '_, u8>`
--> $DIR/substs-ppaux.rs:11:17 --> $DIR/substs-ppaux.rs:15:20
| |
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {}
| - ^^^^^^^^^^^^^^ ^ | - ^^^^^^^^^^^^^^ ^
| | | |
| unsatisfied trait bound introduced here | unsatisfied trait bound introduced here
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -3,37 +3,43 @@
// //
//@[verbose] compile-flags: -Z verbose-internals //@[verbose] compile-flags: -Z verbose-internals
trait Foo<'b, 'c, S=u32> { trait Foo<'b, 'c, S = u32> {
fn bar<'a, T>() where T: 'a {} fn bar<'a, T>()
where
T: 'a,
{
}
fn baz() {} fn baz() {}
} }
impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {}
fn main() {} fn main() {}
fn foo<'z>() where &'z (): Sized { fn foo<'z>()
let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; where
&'z (): Sized,
{
let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
//[verbose]~^ ERROR mismatched types //[verbose]~^ ERROR mismatched types
//[verbose]~| expected unit type `()` //[verbose]~| expected unit type `()`
//[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}` //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
//[normal]~^^^^ ERROR mismatched types //[normal]~^^^^ ERROR mismatched types
//[normal]~| expected unit type `()` //[normal]~| expected unit type `()`
//[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}` //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
//[verbose]~^ ERROR mismatched types //[verbose]~^ ERROR mismatched types
//[verbose]~| expected unit type `()` //[verbose]~| expected unit type `()`
//[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}` //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
//[normal]~^^^^ ERROR mismatched types //[normal]~^^^^ ERROR mismatched types
//[normal]~| expected unit type `()` //[normal]~| expected unit type `()`
//[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}` //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
let x: () = <i8 as Foo<'static, 'static, u8>>::baz; let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
//[verbose]~^ ERROR mismatched types //[verbose]~^ ERROR mismatched types
//[verbose]~| expected unit type `()` //[verbose]~| expected unit type `()`
//[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}` //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
//[normal]~^^^^ ERROR mismatched types //[normal]~^^^^ ERROR mismatched types
//[normal]~| expected unit type `()` //[normal]~| expected unit type `()`
//[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}` //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
@ -41,7 +47,7 @@ fn foo<'z>() where &'z (): Sized {
let x: () = foo::<'static>; let x: () = foo::<'static>;
//[verbose]~^ ERROR mismatched types //[verbose]~^ ERROR mismatched types
//[verbose]~| expected unit type `()` //[verbose]~| expected unit type `()`
//[verbose]~| found fn item `fn() {foo::<ReStatic>}` //[verbose]~| found fn item `fn() {foo::<'static>}`
//[normal]~^^^^ ERROR mismatched types //[normal]~^^^^ ERROR mismatched types
//[normal]~| expected unit type `()` //[normal]~| expected unit type `()`
//[normal]~| found fn item `fn() {foo::<'static>}` //[normal]~| found fn item `fn() {foo::<'static>}`

View file

@ -1,88 +1,94 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:16:17 --> $DIR/substs-ppaux.rs:23:17
| |
LL | fn bar<'a, T>() where T: 'a {} LL | / fn bar<'a, T>()
| --------------------------- associated function `bar` defined here LL | | where
LL | | T: 'a,
| |______________- associated function `bar` defined here
... ...
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item
| | | |
| expected due to this | expected due to this
| |
= note: expected unit type `()` = note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}` found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
help: use parentheses to call this associated function help: use parentheses to call this associated function
| |
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>(); LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
| ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:31:17
|
LL | / fn bar<'a, T>()
LL | | where
LL | | T: 'a,
| |______________- associated function `bar` defined here
...
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item
| |
| expected due to this
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
| ++ | ++
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:25:17 --> $DIR/substs-ppaux.rs:39:17
|
LL | fn bar<'a, T>() where T: 'a {}
| --------------------------- associated function `bar` defined here
...
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item
| |
| expected due to this
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
| ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:33:17
| |
LL | fn baz() {} LL | fn baz() {}
| -------- associated function `baz` defined here | -------- associated function `baz` defined here
... ...
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item
| | | |
| expected due to this | expected due to this
| |
= note: expected unit type `()` = note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}` found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
help: use parentheses to call this associated function help: use parentheses to call this associated function
| |
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz(); LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
| ++ | ++
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:41:17 --> $DIR/substs-ppaux.rs:47:17
| |
LL | fn foo<'z>() where &'z (): Sized { LL | / fn foo<'z>()
| -------------------------------- function `foo` defined here LL | | where
LL | | &'z (): Sized,
| |__________________- function `foo` defined here
... ...
LL | let x: () = foo::<'static>; LL | let x: () = foo::<'static>;
| -- ^^^^^^^^^^^^^^ expected `()`, found fn item | -- ^^^^^^^^^^^^^^ expected `()`, found fn item
| | | |
| expected due to this | expected due to this
| |
= note: expected unit type `()` = note: expected unit type `()`
found fn item `fn() {foo::<ReStatic>}` found fn item `fn() {foo::<'static>}`
help: use parentheses to call this function help: use parentheses to call this function
| |
LL | let x: () = foo::<'static>(); LL | let x: () = foo::<'static>();
| ++ | ++
error[E0277]: the trait bound `str: Foo<'?0, '?1, u8>` is not satisfied error[E0277]: the trait bound `str: Foo<'?0, '?1, u8>` is not satisfied
--> $DIR/substs-ppaux.rs:49:6 --> $DIR/substs-ppaux.rs:55:6
| |
LL | <str as Foo<u8>>::bar; LL | <str as Foo<u8>>::bar;
| ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'?0, '?1, u8>` | ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'?0, '?1, u8>`
| |
note: required for `str` to implement `Foo<'?0, '?1, u8>` note: required for `str` to implement `Foo<'?0, '?1, u8>`
--> $DIR/substs-ppaux.rs:11:17 --> $DIR/substs-ppaux.rs:15:20
| |
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {}
| - ^^^^^^^^^^^^^^ ^ | - ^^^^^^^^^^^^^^ ^
| | | |
| unsatisfied trait bound introduced here | unsatisfied trait bound introduced here
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -1,7 +1,7 @@
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())` error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())`
--> $DIR/associated-type.rs:31:1 --> $DIR/associated-type.rs:31:1
| |

View file

@ -1,11 +1,11 @@
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }
error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>` for type `for<'a> fn(&'a (), _)` error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>` for type `for<'a> fn(&'a (), _)`
--> $DIR/associated-type.rs:31:1 --> $DIR/associated-type.rs:31:1
| |

View file

@ -1,10 +1,10 @@
error: {foo<ReEarlyParam(DefId(..), 0, 'a)>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} error: {foo<DefId(..)_'a/#0>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()}
--> $DIR/erased-regions-in-hidden-ty.rs:12:36 --> $DIR/erased-regions-in-hidden-ty.rs:12:36
| |
LL | fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static { LL | fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static {
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: Opaque(DefId(..), [ReErased]) error: Opaque(DefId(..), ['{erased}])
--> $DIR/erased-regions-in-hidden-ty.rs:18:13 --> $DIR/erased-regions-in-hidden-ty.rs:18:13
| |
LL | fn bar() -> impl Fn() + 'static { LL | fn bar() -> impl Fn() + 'static {

View file

@ -1,10 +1,10 @@
error: {foo<ReEarlyParam(DefId(..), 0, 'a)>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} error: {foo<DefId(..)_'a/#0>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()}
--> $DIR/erased-regions-in-hidden-ty.rs:12:36 --> $DIR/erased-regions-in-hidden-ty.rs:12:36
| |
LL | fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static { LL | fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static {
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: Opaque(DefId(..), [ReErased]) error: Opaque(DefId(..), ['{erased}])
--> $DIR/erased-regions-in-hidden-ty.rs:18:13 --> $DIR/erased-regions-in-hidden-ty.rs:18:13
| |
LL | fn bar() -> impl Fn() + 'static { LL | fn bar() -> impl Fn() + 'static {

View file

@ -10,14 +10,14 @@
// Make sure that the compiler can handle `ReErased` in the hidden type of an opaque. // Make sure that the compiler can handle `ReErased` in the hidden type of an opaque.
fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static { fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static {
//~^ ERROR 0, 'a)>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} //~^ ERROR 'a/#0>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()}
// Can't write whole type because of lack of path sanitization // Can't write whole type because of lack of path sanitization
|| () || ()
} }
fn bar() -> impl Fn() + 'static { fn bar() -> impl Fn() + 'static {
//~^ ERROR , [ReErased]) //~^ ERROR , ['{erased}])
// Can't write whole type because of lack of path sanitization // Can't write whole type because of lack of path sanitization
foo(&vec![]) foo(&vec![])
} }

View file

@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
| |
= note: defining type: test::{closure#0} with closure args [ = note: defining type: test::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) mut &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) i32)), for<Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 mut &'^1 i32, &'^2 i32)),
(), (),
] ]

View file

@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
| |
= note: defining type: test::{closure#0} with closure args [ = note: defining type: test::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) mut &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32)), for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 mut &'^1 i32, &'^1 i32)),
(), (),
] ]

View file

@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| {
| |
= note: defining type: supply::{closure#0} with closure args [ = note: defining type: supply::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&'?2 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?3 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'?2 &'^0 u32>, std::cell::Cell<&'^1 &'?3 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)),
(), (),
] ]
= note: late-bound region is '?4 = note: late-bound region is '?4

View file

@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
| |
= note: defining type: supply::{closure#0} with closure args [ = note: defining type: supply::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) &'?2 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'^3 &'?2 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)),
(), (),
] ]
= note: late-bound region is '?3 = note: late-bound region is '?3

View file

@ -6,7 +6,7 @@ LL | foo(cell, |cell_a, cell_x| {
| |
= note: defining type: case1::{closure#0} with closure args [ = note: defining type: case1::{closure#0} with closure args [
i32, i32,
for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>)), for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&'^0 u32>)),
(), (),
] ]
@ -36,7 +36,7 @@ LL | foo(cell, |cell_a, cell_x| {
| |
= note: defining type: case2::{closure#0} with closure args [ = note: defining type: case2::{closure#0} with closure args [
i32, i32,
for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>)), for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&'^0 u32>)),
(), (),
] ]
= note: number of external vids: 2 = note: number of external vids: 2

View file

@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| |
= note: defining type: supply::{closure#0} with closure args [ = note: defining type: supply::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'^1 u32>, &'^3 std::cell::Cell<&'^4 u32>)),
(), (),
] ]
= note: late-bound region is '?2 = note: late-bound region is '?2

View file

@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
| |
= note: defining type: supply::{closure#0} with closure args [ = note: defining type: supply::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&'?2 &ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'?2 &'^3 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)),
(), (),
] ]
= note: late-bound region is '?3 = note: late-bound region is '?3

View file

@ -6,7 +6,7 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
| |
= note: defining type: test::{closure#0} with closure args [ = note: defining type: test::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?2 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'^1 &'?2 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)),
(), (),
] ]
= note: late-bound region is '?3 = note: late-bound region is '?3

View file

@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, x, y| {
| |
= note: defining type: supply::{closure#0} with closure args [ = note: defining type: supply::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?2 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'^1 &'?2 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)),
(), (),
] ]
= note: late-bound region is '?3 = note: late-bound region is '?3

View file

@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| |
= note: defining type: supply::{closure#0} with closure args [ = note: defining type: supply::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?1 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'^1 &'?1 u32>, &'^2 std::cell::Cell<&'^3 u32>, &'^4 std::cell::Cell<&'^1 u32>)),
(), (),
] ]
= note: late-bound region is '?2 = note: late-bound region is '?2

View file

@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
| |
= note: defining type: supply::{closure#0} with closure args [ = note: defining type: supply::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?1 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) &'?2 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>)), for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'^1 &'?1 u32>, &'^2 std::cell::Cell<&'^3 &'?2 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)),
(), (),
] ]
= note: late-bound region is '?3 = note: late-bound region is '?3

View file

@ -6,7 +6,7 @@ LL | expect_sig(|a, b| b); // ought to return `a`
| |
= note: defining type: test::{closure#0} with closure args [ = note: defining type: test::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) i32, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32)) -> &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) i32, for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 i32, &'^1 i32)) -> &'^0 i32,
(), (),
] ]

View file

@ -1,4 +1,4 @@
error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyParam(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyParam(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a)])` captures lifetime that does not appear in bounds error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0, T, DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0])` captures lifetime that does not appear in bounds
--> $DIR/impl-trait-captures.rs:11:5 --> $DIR/impl-trait-captures.rs:11:5
| |
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> { LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
@ -8,7 +8,7 @@ LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
LL | x LL | x
| ^ | ^
| |
help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyParam(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyParam(DefId(0:14 ~ impl_trait_captures[aeb9]::foo::{opaque#0}::'a), 2, 'a)])` captures `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0, T, DefId(0:14 ~ impl_trait_captures[aeb9]::foo::{opaque#0}::'a)_'a/#2])` captures `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound
| |
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) { LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) {
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View file

@ -6,7 +6,7 @@ LL | twice(cell, value, |a, b| invoke(a, b));
| |
= note: defining type: generic::<T>::{closure#0} with closure args [ = note: defining type: generic::<T>::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) ()>>, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) T)), for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &'^0 ()>>, &'^1 T)),
(), (),
] ]
= note: number of external vids: 2 = note: number of external vids: 2
@ -28,7 +28,7 @@ LL | twice(cell, value, |a, b| invoke(a, b));
| |
= note: defining type: generic_fail::<T>::{closure#0} with closure args [ = note: defining type: generic_fail::<T>::{closure#0} with closure args [
i16, i16,
for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) ()>>, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) T)), for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &'^0 ()>>, &'^1 T)),
(), (),
] ]
= note: late-bound region is '?2 = note: late-bound region is '?2

View file

@ -6,7 +6,9 @@
#![allow(warnings)] #![allow(warnings)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
struct SomeStruct<T> { t: T } struct SomeStruct<T> {
t: T,
}
#[rustc_dump_user_args] #[rustc_dump_user_args]
fn main() { fn main() {
@ -16,5 +18,5 @@ fn main() {
SomeStruct::<u32> { t: 22 }; // No lifetime bounds given. SomeStruct::<u32> { t: 22 }; // No lifetime bounds given.
SomeStruct::<&'static u32> { t: &22 }; //~ ERROR [&ReStatic u32] SomeStruct::<&'static u32> { t: &22 }; //~ ERROR [&'static u32]
} }

View file

@ -1,5 +1,5 @@
error: user args: UserArgs { args: [&ReStatic u32], user_self_ty: None } error: user args: UserArgs { args: [&'static u32], user_self_ty: None }
--> $DIR/dump-adt-brace-struct.rs:19:5 --> $DIR/dump-adt-brace-struct.rs:21:5
| |
LL | SomeStruct::<&'static u32> { t: &22 }; LL | SomeStruct::<&'static u32> { t: &22 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -7,13 +7,12 @@
// Note: we reference the names T and U in the comments below. // Note: we reference the names T and U in the comments below.
trait Bazoom<T> { trait Bazoom<T> {
fn method<U>(&self, arg: T, arg2: U) { } fn method<U>(&self, arg: T, arg2: U) {}
} }
impl<S, T> Bazoom<T> for S { impl<S, T> Bazoom<T> for S {}
}
fn foo<'a, T>(_: T) { } fn foo<'a, T>(_: T) {}
#[rustc_dump_user_args] #[rustc_dump_user_args]
fn main() { fn main() {
@ -26,7 +25,7 @@ fn main() {
let x = foo::<u32>; let x = foo::<u32>;
x(22); x(22);
let x = foo::<&'static u32>; //~ ERROR [&ReStatic u32] let x = foo::<&'static u32>; //~ ERROR [&'static u32]
x(&22); x(&22);
// Here: we only want the `T` to be given, the rest should be variables. // Here: we only want the `T` to be given, the rest should be variables.
@ -41,7 +40,7 @@ fn main() {
x(&22, 44, 66); x(&22, 44, 66);
// Here: all are given and we have a lifetime. // Here: all are given and we have a lifetime.
let x = <u8 as Bazoom<&'static u16>>::method::<u32>; //~ ERROR [u8, &ReStatic u16, u32] let x = <u8 as Bazoom<&'static u16>>::method::<u32>; //~ ERROR [u8, &'static u16, u32]
x(&22, &44, 66); x(&22, &44, 66);
// Here: we want in particular that *only* the method `U` // Here: we want in particular that *only* the method `U`

View file

@ -1,23 +1,23 @@
error: user args: UserArgs { args: [&ReStatic u32], user_self_ty: None } error: user args: UserArgs { args: [&'static u32], user_self_ty: None }
--> $DIR/dump-fn-method.rs:29:13 --> $DIR/dump-fn-method.rs:28:13
| |
LL | let x = foo::<&'static u32>; LL | let x = foo::<&'static u32>;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: user args: UserArgs { args: [^0, u32, ^1], user_self_ty: None } error: user args: UserArgs { args: [^0, u32, ^1], user_self_ty: None }
--> $DIR/dump-fn-method.rs:35:13 --> $DIR/dump-fn-method.rs:34:13
| |
LL | let x = <_ as Bazoom<u32>>::method::<_>; LL | let x = <_ as Bazoom<u32>>::method::<_>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: user args: UserArgs { args: [u8, &ReStatic u16, u32], user_self_ty: None } error: user args: UserArgs { args: [u8, &'static u16, u32], user_self_ty: None }
--> $DIR/dump-fn-method.rs:44:13 --> $DIR/dump-fn-method.rs:43:13
| |
LL | let x = <u8 as Bazoom<&'static u16>>::method::<u32>; LL | let x = <u8 as Bazoom<&'static u16>>::method::<u32>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: user args: UserArgs { args: [^0, ^1, u32], user_self_ty: None } error: user args: UserArgs { args: [^0, ^1, u32], user_self_ty: None }
--> $DIR/dump-fn-method.rs:52:5 --> $DIR/dump-fn-method.rs:51:5
| |
LL | y.method::<u32>(44, 66); LL | y.method::<u32>(44, 66);
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -19,10 +19,10 @@ error: the type `<*const T as ToUnit<'a>>::Unit` is not well-formed
LL | type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit; LL | type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }
error[E0119]: conflicting implementations of trait `Overlap<fn(_)>` for type `fn(_)` error[E0119]: conflicting implementations of trait `Overlap<fn(_)>` for type `fn(_)`
--> $DIR/issue-118950-root-region.rs:19:1 --> $DIR/issue-118950-root-region.rs:19:1
| |

View file

@ -1,8 +1,8 @@
error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> fn(&ReBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ()): Foo` is not satisfied error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> fn(&'^1_0.Named(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), "'b") ()): Foo` is not satisfied
--> $DIR/higher-ranked-fn-type.rs:20:5 --> $DIR/higher-ranked-fn-type.rs:20:5
| |
LL | called() LL | called()
| ^^^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> Foo` is not implemented for `fn(&ReBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ())` | ^^^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> Foo` is not implemented for `fn(&'^1_0.Named(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), "'b") ())`
| |
help: this trait has no implementations, consider adding one help: this trait has no implementations, consider adding one
--> $DIR/higher-ranked-fn-type.rs:6:1 --> $DIR/higher-ranked-fn-type.rs:6:1