diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-27 07:39:10 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-27 09:29:38 +0100 |
| commit | 2ddc35997cd7147f007943e50ef5f942d20ad7c7 (patch) | |
| tree | 9ae7bd7a22951bb71cbd789415784df3d4a76f19 /src/test/ui/parser | |
| parent | 2972bb37b8dc6e64ec31cf9b79245974e30f417b (diff) | |
| download | rust-2ddc35997cd7147f007943e50ef5f942d20ad7c7.tar.gz rust-2ddc35997cd7147f007943e50ef5f942d20ad7c7.zip | |
address some review comments
Diffstat (limited to 'src/test/ui/parser')
| -rw-r--r-- | src/test/ui/parser/issue-32214.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-32214.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/parser/recover-assoc-const-constraint.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/parser/recover-assoc-eq-missing-term.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/parser/recover-assoc-eq-missing-term.stderr | 12 |
5 files changed, 16 insertions, 17 deletions
diff --git a/src/test/ui/parser/issue-32214.rs b/src/test/ui/parser/issue-32214.rs index ca30f5f1329..1379eeb58e6 100644 --- a/src/test/ui/parser/issue-32214.rs +++ b/src/test/ui/parser/issue-32214.rs @@ -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() { } diff --git a/src/test/ui/parser/issue-32214.stderr b/src/test/ui/parser/issue-32214.stderr index ee99fe70811..d25d3a09633 100644 --- a/src/test/ui/parser/issue-32214.stderr +++ b/src/test/ui/parser/issue-32214.stderr @@ -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 diff --git a/src/test/ui/parser/recover-assoc-const-constraint.stderr b/src/test/ui/parser/recover-assoc-const-constraint.stderr index bf617207936..c6733b33faa 100644 --- a/src/test/ui/parser/recover-assoc-const-constraint.stderr +++ b/src/test/ui/parser/recover-assoc-const-constraint.stderr @@ -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 diff --git a/src/test/ui/parser/recover-assoc-eq-missing-term.rs b/src/test/ui/parser/recover-assoc-eq-missing-term.rs index d800df8236b..4b42c44dc64 100644 --- a/src/test/ui/parser/recover-assoc-eq-missing-term.rs +++ b/src/test/ui/parser/recover-assoc-eq-missing-term.rs @@ -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() {} diff --git a/src/test/ui/parser/recover-assoc-eq-missing-term.stderr b/src/test/ui/parser/recover-assoc-eq-missing-term.stderr index 5eb5d6879e9..6e41e139220 100644 --- a/src/test/ui/parser/recover-assoc-eq-missing-term.stderr +++ b/src/test/ui/parser/recover-assoc-eq-missing-term.stderr @@ -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 |
