diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-08-23 17:37:41 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-08-24 13:27:38 -0400 |
| commit | ed73a3267a648cffb92f60e50aa75a6547d9955d (patch) | |
| tree | dc2399e896e9f2dd734f16955c822d03e7b1c60d /src/test | |
| parent | 5778fec665ae2660426293bcfd3b30530d22e3b5 (diff) | |
| download | rust-ed73a3267a648cffb92f60e50aa75a6547d9955d.tar.gz rust-ed73a3267a648cffb92f60e50aa75a6547d9955d.zip | |
address pnkfelix nits
Diffstat (limited to 'src/test')
4 files changed, 48 insertions, 25 deletions
diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr index 1999df909ed..bb4e922fdc0 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr @@ -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: 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 previous error +error: aborting due to 2 previous errors diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr index f76b26b5191..c33e6fbfde7 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr @@ -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 diff --git a/src/test/ui/nll/user-annotations/dump-fn-method.rs b/src/test/ui/nll/user-annotations/dump-fn-method.rs index fa14009da5a..7f726d13a33 100644 --- a/src/test/ui/nll/user-annotations/dump-fn-method.rs +++ b/src/test/ui/nll/user-annotations/dump-fn-method.rs @@ -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] diff --git a/src/test/ui/nll/user-annotations/dump-fn-method.stderr b/src/test/ui/nll/user-annotations/dump-fn-method.stderr index 8f3a0498e24..6531f87dd98 100644 --- a/src/test/ui/nll/user-annotations/dump-fn-method.stderr +++ b/src/test/ui/nll/user-annotations/dump-fn-method.stderr @@ -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] | ^^^^^^^^^^^^^^^^^^^^^^^ |
