address pnkfelix nits
This commit is contained in:
parent
5778fec665
commit
ed73a3267a
7 changed files with 59 additions and 28 deletions
|
|
@ -18,17 +18,33 @@ LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
|
|||
LL | | fn(Inv<'y>)) }
|
||||
| |__________________________________________________- in this macro invocation
|
||||
|
||||
error: compilation successful
|
||||
--> $DIR/hr-subtype.rs:110:1
|
||||
error: unsatisfied lifetime constraints
|
||||
--> $DIR/hr-subtype.rs:43:13
|
||||
|
|
||||
LL | / fn main() {
|
||||
LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
|
||||
LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
|
||||
LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
|
||||
LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
|
||||
LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
|
||||
LL | | }
|
||||
| |_^
|
||||
LL | fn subtype<'x,'y:'x,'z:'y>() {
|
||||
| -- -- lifetime `'y` defined here
|
||||
| |
|
||||
| lifetime `'x` defined here
|
||||
LL | gimme::<$t2>(None::<$t1>);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
|
||||
...
|
||||
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
|
||||
LL | | fn(Inv<'y>)) }
|
||||
| |__________________________________________________- in this macro invocation
|
||||
|
||||
error: aborting due to previous error
|
||||
error: unsatisfied lifetime constraints
|
||||
--> $DIR/hr-subtype.rs:49:13
|
||||
|
|
||||
LL | fn supertype<'x,'y:'x,'z:'y>() {
|
||||
| -- -- lifetime `'y` defined here
|
||||
| |
|
||||
| lifetime `'x` defined here
|
||||
LL | gimme::<$t1>(None::<$t2>);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
|
||||
...
|
||||
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
|
||||
LL | | fn(Inv<'y>)) }
|
||||
| |__________________________________________________- in this macro invocation
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -8,17 +8,19 @@ LL | / check! { free_x_vs_free_y: (fn(&'x u32),
|
|||
LL | | fn(&'y u32)) }
|
||||
| |__________________________________________- in this macro invocation
|
||||
|
||||
error: compilation successful
|
||||
--> $DIR/hr-subtype.rs:110:1
|
||||
error: unsatisfied lifetime constraints
|
||||
--> $DIR/hr-subtype.rs:49:13
|
||||
|
|
||||
LL | / fn main() {
|
||||
LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful
|
||||
LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful
|
||||
LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
|
||||
LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
|
||||
LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful
|
||||
LL | | }
|
||||
| |_^
|
||||
LL | fn supertype<'x,'y:'x,'z:'y>() {
|
||||
| -- -- lifetime `'y` defined here
|
||||
| |
|
||||
| lifetime `'x` defined here
|
||||
LL | gimme::<$t1>(None::<$t2>);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
|
||||
...
|
||||
LL | / check! { free_x_vs_free_y: (fn(&'x u32),
|
||||
LL | | fn(&'y u32)) }
|
||||
| |__________________________________________- in this macro invocation
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#![feature(nll)]
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
// Note: we reference the names T and U in the comments below.
|
||||
trait Bazoom<T> {
|
||||
fn method<U>(&self, arg: T, arg2: U) { }
|
||||
}
|
||||
|
|
@ -36,6 +37,8 @@ fn main() {
|
|||
x(22);
|
||||
|
||||
// Here: we only want the `T` to be given, the rest should be variables.
|
||||
//
|
||||
// (`T` refers to the declaration of `Bazoom`)
|
||||
let x = <_ as Bazoom<u32>>::method::<_>; //~ ERROR [?0, u32, ?1]
|
||||
x(&22, 44, 66);
|
||||
|
||||
|
|
@ -45,6 +48,8 @@ fn main() {
|
|||
|
||||
// Here: we want in particular that *only* the method `U`
|
||||
// annotation is given, the rest are variables.
|
||||
//
|
||||
// (`U` refers to the declaration of `Bazoom`)
|
||||
let y = 22_u32;
|
||||
y.method::<u32>(44, 66); //~ ERROR [?0, ?1, u32]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
error: user substs: Canonical { variables: [], value: [u32] }
|
||||
--> $DIR/dump-fn-method.rs:35:13
|
||||
--> $DIR/dump-fn-method.rs:36:13
|
||||
|
|
||||
LL | let x = foo::<u32>; //~ ERROR [u32]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: user substs: Canonical { variables: [CanonicalVarInfo { kind: Ty(General) }, CanonicalVarInfo { kind: Ty(General) }], value: [?0, u32, ?1] }
|
||||
--> $DIR/dump-fn-method.rs:39:13
|
||||
--> $DIR/dump-fn-method.rs:42:13
|
||||
|
|
||||
LL | let x = <_ as Bazoom<u32>>::method::<_>; //~ ERROR [?0, u32, ?1]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: user substs: Canonical { variables: [], value: [u8, u16, u32] }
|
||||
--> $DIR/dump-fn-method.rs:43:13
|
||||
--> $DIR/dump-fn-method.rs:46:13
|
||||
|
|
||||
LL | let x = <u8 as Bazoom<u16>>::method::<u32>; //~ ERROR [u8, u16, u32]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: user substs: Canonical { variables: [CanonicalVarInfo { kind: Ty(General) }, CanonicalVarInfo { kind: Ty(General) }], value: [?0, ?1, u32] }
|
||||
--> $DIR/dump-fn-method.rs:49:5
|
||||
--> $DIR/dump-fn-method.rs:54:5
|
||||
|
|
||||
LL | y.method::<u32>(44, 66); //~ ERROR [?0, ?1, u32]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue