address some review comments
This commit is contained in:
parent
2972bb37b8
commit
2ddc35997c
10 changed files with 68 additions and 95 deletions
|
|
@ -1,6 +1,6 @@
|
|||
trait Trait<T> { type Item; }
|
||||
|
||||
pub fn test<W, I: Trait<Item=(), W> >() {}
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/issue-32214.rs:3:24
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/issue-32214.rs:3:34
|
||||
|
|
||||
LL | pub fn test<W, I: Trait<Item=(), W> >() {}
|
||||
| ^-------^^-^
|
||||
| | |
|
||||
| | this generic argument must come before the first constraint
|
||||
| ------- ^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ error: cannot constrain an associated constant to a value
|
|||
LL | bar::<Item = 42>();
|
||||
| ----^^^--
|
||||
| | |
|
||||
| | the value is given in this expression
|
||||
| the value constrains this associated constant
|
||||
| | ...cannot be constrained to this value
|
||||
| this associated constant...
|
||||
|
||||
error: cannot constrain an associated constant to a value
|
||||
--> $DIR/recover-assoc-const-constraint.rs:4:11
|
||||
|
|
@ -13,8 +13,8 @@ error: cannot constrain an associated constant to a value
|
|||
LL | bar::<Item = { 42 }>();
|
||||
| ----^^^------
|
||||
| | |
|
||||
| | the value is given in this expression
|
||||
| the value constrains this associated constant
|
||||
| | ...cannot be constrained to this value
|
||||
| this associated constant...
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#[cfg(FALSE)]
|
||||
fn syntax() {
|
||||
bar::<Item = >(); //~ ERROR missing type to the right of `=`
|
||||
bar::<Item = >(); //~ ERROR missing type to the right of `=`
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
error: missing type to the right of `=`
|
||||
--> $DIR/recover-assoc-eq-missing-term.rs:3:11
|
||||
--> $DIR/recover-assoc-eq-missing-term.rs:3:17
|
||||
|
|
||||
LL | bar::<Item = >();
|
||||
| ^^^^^^
|
||||
LL | bar::<Item = >();
|
||||
| ^^^
|
||||
|
|
||||
help: to constrain the associated type, add a type after `=`
|
||||
|
|
||||
LL | bar::<Item = TheType >();
|
||||
| ^^^^^^^^^^^^^^
|
||||
LL | bar::<Item = TheType>();
|
||||
| ^^^^^^^
|
||||
help: remove the `=` if `Item` is a type
|
||||
|
|
||||
LL | bar::<Item >();
|
||||
LL | bar::<Item >();
|
||||
| --
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -24,21 +24,21 @@ trait ThreeWithLifetime<'a, 'b, 'c, T, U, V> {
|
|||
}
|
||||
|
||||
struct A<T, M: One<A=(), T>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
m: M,
|
||||
t: T,
|
||||
}
|
||||
|
||||
|
||||
struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
//~^^ ERROR type provided when a lifetime was expected
|
||||
m: M,
|
||||
t: &'a T,
|
||||
}
|
||||
|
||||
struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
m: M,
|
||||
t: T,
|
||||
u: U,
|
||||
|
|
@ -46,7 +46,7 @@ struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
|
|||
}
|
||||
|
||||
struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
//~^^ ERROR type provided when a lifetime was expected
|
||||
m: M,
|
||||
t: &'a T,
|
||||
|
|
@ -55,7 +55,7 @@ struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, '
|
|||
}
|
||||
|
||||
struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
m: M,
|
||||
t: T,
|
||||
u: U,
|
||||
|
|
@ -63,7 +63,7 @@ struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
|
|||
}
|
||||
|
||||
struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
//~^^ ERROR lifetime provided when a type was expected
|
||||
m: M,
|
||||
t: &'a T,
|
||||
|
|
@ -72,7 +72,7 @@ struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U,
|
|||
}
|
||||
|
||||
struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
m: M,
|
||||
t: T,
|
||||
u: U,
|
||||
|
|
@ -80,7 +80,7 @@ struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
|
|||
}
|
||||
|
||||
struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
|
||||
//~^ ERROR constraints in a path segment must come after generic arguments
|
||||
//~^ ERROR generic arguments must come before the first constraint
|
||||
//~^^ ERROR lifetime provided when a type was expected
|
||||
m: M,
|
||||
t: &'a T,
|
||||
|
|
|
|||
|
|
@ -1,89 +1,65 @@
|
|||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:26:19
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:26:26
|
||||
|
|
||||
LL | struct A<T, M: One<A=(), T>> {
|
||||
| ^----^^-^
|
||||
| | |
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:33:36
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:33:43
|
||||
|
|
||||
LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
|
||||
| ^----^^-^^--^
|
||||
| | | |
|
||||
| | | this generic argument must come before the first constraint
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^ ^^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:40:27
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:40:46
|
||||
|
|
||||
LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
|
||||
| ^----^^^^^^^^^^^^^^-^^-^^-^
|
||||
| | | | |
|
||||
| | | | this generic argument must come before the first constraint
|
||||
| | | this generic argument must come before the first constraint
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^ ^ ^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:48:52
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:48:71
|
||||
|
|
||||
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
|
||||
| ^----^^^^^^^^^^^^^^-^^-^^-^^--^^--^^--^
|
||||
| | | | | | | |
|
||||
| | | | | | | this generic argument must come before the first constraint
|
||||
| | | | | | this generic argument must come before the first constraint
|
||||
| | | | | this generic argument must come before the first constraint
|
||||
| | | | this generic argument must come before the first constraint
|
||||
| | | this generic argument must come before the first constraint
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^ ^ ^ ^^ ^^ ^^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:57:27
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:57:49
|
||||
|
|
||||
LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
|
||||
| ^^^^----^^^^^^^^^^^^^^-^^-^
|
||||
| | | |
|
||||
| | | this generic argument must come before the first constraint
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^ ^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:65:52
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:65:78
|
||||
|
|
||||
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
|
||||
| ^^^^^^^^----^^^^^^^^^^^^^^-^^--^^-^^--^
|
||||
| | | | | |
|
||||
| | | | | this generic argument must come before the first constraint
|
||||
| | | | this generic argument must come before the first constraint
|
||||
| | | this generic argument must come before the first constraint
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^ ^^ ^ ^^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:74:27
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:74:43
|
||||
|
|
||||
LL | struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
|
||||
| ^^^^----^^^^^^^^-^^^^^^^^-^
|
||||
| | | |
|
||||
| | | this generic argument must come before the first constraint
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^ ^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error: constraints in a path segment must come after generic arguments
|
||||
--> $DIR/suggest-move-types.rs:82:52
|
||||
error: generic arguments must come before the first constraint
|
||||
--> $DIR/suggest-move-types.rs:82:72
|
||||
|
|
||||
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
|
||||
| ^^^^^^^^----^^^^^^^^-^^--^^^^^^^^-^^--^
|
||||
| | | | | |
|
||||
| | | | | this generic argument must come before the first constraint
|
||||
| | | | this generic argument must come before the first constraint
|
||||
| | | this generic argument must come before the first constraint
|
||||
| | this generic argument must come before the first constraint
|
||||
| ---- ^ ^^ ^ ^^
|
||||
| |
|
||||
| the first constraint is provided here
|
||||
|
||||
error[E0747]: type provided when a lifetime was expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue