diff options
| author | bors <bors@rust-lang.org> | 2017-12-21 13:34:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-12-21 13:34:09 +0000 |
| commit | eff3de0927c36e6483ccb8a35c3d2da6e063de0b (patch) | |
| tree | cee7a79c7aa3c865552efc2838844519e14d5101 /src/test | |
| parent | de38f49528b537414385d42a66dda711c8c8a309 (diff) | |
| parent | bdd3f5b240bac62e6e49c12313ebf9ebbc1dfea4 (diff) | |
| download | rust-eff3de0927c36e6483ccb8a35c3d2da6e063de0b.tar.gz rust-eff3de0927c36e6483ccb8a35c3d2da6e063de0b.zip | |
Auto merge of #46904 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests - Successful merges: #46827, #46853, #46860, #46861, #46887 - Failed merges:
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/did_you_mean/bad-assoc-expr.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/did_you_mean/bad-assoc-expr.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/did_you_mean/bad-assoc-pat.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/did_you_mean/bad-assoc-pat.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/did_you_mean/bad-assoc-ty.rs | 15 | ||||
| -rw-r--r-- | src/test/ui/did_you_mean/bad-assoc-ty.stderr | 38 | ||||
| -rw-r--r-- | src/test/ui/span/issue-37767.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/span/issue-7575.stderr | 12 |
8 files changed, 99 insertions, 17 deletions
diff --git a/src/test/ui/did_you_mean/bad-assoc-expr.rs b/src/test/ui/did_you_mean/bad-assoc-expr.rs index 72b616ddd69..779aa952c81 100644 --- a/src/test/ui/did_you_mean/bad-assoc-expr.rs +++ b/src/test/ui/did_you_mean/bad-assoc-expr.rs @@ -21,4 +21,10 @@ fn main() { (u8, u8)::clone(&(0, 0)); //~^ ERROR missing angle brackets in associated item path + + &(u8)::clone(&0); + //~^ ERROR missing angle brackets in associated item path + + 10 + (u8)::clone(&0); + //~^ ERROR missing angle brackets in associated item path } diff --git a/src/test/ui/did_you_mean/bad-assoc-expr.stderr b/src/test/ui/did_you_mean/bad-assoc-expr.stderr index 1f8fc118f78..1affdc5fda2 100644 --- a/src/test/ui/did_you_mean/bad-assoc-expr.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-expr.stderr @@ -22,5 +22,17 @@ error: missing angle brackets in associated item path 22 | (u8, u8)::clone(&(0, 0)); | ^^^^^^^^^^^^^^^ help: try: `<(u8, u8)>::clone` -error: aborting due to 4 previous errors +error: missing angle brackets in associated item path + --> $DIR/bad-assoc-expr.rs:25:6 + | +25 | &(u8)::clone(&0); + | ^^^^^^^^^^^ help: try: `<(u8)>::clone` + +error: missing angle brackets in associated item path + --> $DIR/bad-assoc-expr.rs:28:10 + | +28 | 10 + (u8)::clone(&0); + | ^^^^^^^^^^^ help: try: `<(u8)>::clone` + +error: aborting due to 6 previous errors diff --git a/src/test/ui/did_you_mean/bad-assoc-pat.rs b/src/test/ui/did_you_mean/bad-assoc-pat.rs index e6b7127f100..bf6be0ee985 100644 --- a/src/test/ui/did_you_mean/bad-assoc-pat.rs +++ b/src/test/ui/did_you_mean/bad-assoc-pat.rs @@ -20,4 +20,9 @@ fn main() { //~^ ERROR missing angle brackets in associated item path //~| ERROR no associated item named `AssocItem` found for type `_` in the current scope } + match &0u8 { + &(u8,)::AssocItem => {} + //~^ ERROR missing angle brackets in associated item path + //~| ERROR no associated item named `AssocItem` found for type `(u8,)` in the current scope + } } diff --git a/src/test/ui/did_you_mean/bad-assoc-pat.stderr b/src/test/ui/did_you_mean/bad-assoc-pat.stderr index 20f9b96dbaa..1ca4576d88f 100644 --- a/src/test/ui/did_you_mean/bad-assoc-pat.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-pat.stderr @@ -16,6 +16,12 @@ error: missing angle brackets in associated item path 19 | _::AssocItem => {} | ^^^^^^^^^^^^ help: try: `<_>::AssocItem` +error: missing angle brackets in associated item path + --> $DIR/bad-assoc-pat.rs:24:10 + | +24 | &(u8,)::AssocItem => {} + | ^^^^^^^^^^^^^^^^ help: try: `<(u8,)>::AssocItem` + error[E0599]: no associated item named `AssocItem` found for type `[u8]` in the current scope --> $DIR/bad-assoc-pat.rs:13:9 | @@ -34,5 +40,11 @@ error[E0599]: no associated item named `AssocItem` found for type `_` in the cur 19 | _::AssocItem => {} | ^^^^^^^^^^^^ associated item not found in `_` -error: aborting due to 6 previous errors +error[E0599]: no associated item named `AssocItem` found for type `(u8,)` in the current scope + --> $DIR/bad-assoc-pat.rs:24:10 + | +24 | &(u8,)::AssocItem => {} + | ^^^^^^^^^^^^^^^^ associated item not found in `(u8,)` + +error: aborting due to 8 previous errors diff --git a/src/test/ui/did_you_mean/bad-assoc-ty.rs b/src/test/ui/did_you_mean/bad-assoc-ty.rs index 45a52936738..b4a59904ee4 100644 --- a/src/test/ui/did_you_mean/bad-assoc-ty.rs +++ b/src/test/ui/did_you_mean/bad-assoc-ty.rs @@ -28,4 +28,19 @@ type E = _::AssocTy; //~^ ERROR missing angle brackets in associated item path //~| ERROR the type placeholder `_` is not allowed within types on item signatures +type F = &'static (u8)::AssocTy; +//~^ ERROR missing angle brackets in associated item path +//~| ERROR ambiguous associated type + +// Qualified paths cannot appear in bounds, so the recovery +// should apply to the whole sum and not `(Send)`. +type G = 'static + (Send)::AssocTy; +//~^ ERROR missing angle brackets in associated item path +//~| ERROR ambiguous associated type + +// This is actually a legal path with fn-like generic arguments in the middle! +// Recovery should not apply in this context. +type H = Fn(u8) -> (u8)::Output; +//~^ ERROR ambiguous associated type + fn main() {} diff --git a/src/test/ui/did_you_mean/bad-assoc-ty.stderr b/src/test/ui/did_you_mean/bad-assoc-ty.stderr index 617339a7d92..c44dc5a0468 100644 --- a/src/test/ui/did_you_mean/bad-assoc-ty.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-ty.stderr @@ -28,6 +28,18 @@ error: missing angle brackets in associated item path 27 | type E = _::AssocTy; | ^^^^^^^^^^ help: try: `<_>::AssocTy` +error: missing angle brackets in associated item path + --> $DIR/bad-assoc-ty.rs:31:19 + | +31 | type F = &'static (u8)::AssocTy; + | ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy` + +error: missing angle brackets in associated item path + --> $DIR/bad-assoc-ty.rs:37:10 + | +37 | type G = 'static + (Send)::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `<'static + Send>::AssocTy` + error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:11:10 | @@ -66,5 +78,29 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa 27 | type E = _::AssocTy; | ^ not allowed in type signatures -error: aborting due to 10 previous errors +error[E0223]: ambiguous associated type + --> $DIR/bad-assoc-ty.rs:31:19 + | +31 | type F = &'static (u8)::AssocTy; + | ^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<u8 as Trait>::AssocTy` + +error[E0223]: ambiguous associated type + --> $DIR/bad-assoc-ty.rs:37:10 + | +37 | type G = 'static + (Send)::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<std::marker::Send + 'static as Trait>::AssocTy` + +error[E0223]: ambiguous associated type + --> $DIR/bad-assoc-ty.rs:43:10 + | +43 | type H = Fn(u8) -> (u8)::Output; + | ^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<std::ops::Fn(u8) -> u8 + 'static as Trait>::Output` + +error: aborting due to 15 previous errors diff --git a/src/test/ui/span/issue-37767.stderr b/src/test/ui/span/issue-37767.stderr index 8babcc74ed5..e9a1fe82f14 100644 --- a/src/test/ui/span/issue-37767.stderr +++ b/src/test/ui/span/issue-37767.stderr @@ -8,13 +8,13 @@ note: candidate #1 is defined in the trait `A` --> $DIR/issue-37767.rs:12:5 | 12 | fn foo(&mut self) {} - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `A::foo(&a)` instead note: candidate #2 is defined in the trait `B` --> $DIR/issue-37767.rs:16:5 | 16 | fn foo(&mut self) {} - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `B::foo(&a)` instead error[E0034]: multiple applicable items in scope @@ -27,13 +27,13 @@ note: candidate #1 is defined in the trait `C` --> $DIR/issue-37767.rs:24:5 | 24 | fn foo(&self) {} - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ = help: to disambiguate the method call, write `C::foo(&a)` instead note: candidate #2 is defined in the trait `D` --> $DIR/issue-37767.rs:28:5 | 28 | fn foo(&self) {} - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ = help: to disambiguate the method call, write `D::foo(&a)` instead error[E0034]: multiple applicable items in scope @@ -46,13 +46,13 @@ note: candidate #1 is defined in the trait `E` --> $DIR/issue-37767.rs:36:5 | 36 | fn foo(self) {} - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ = help: to disambiguate the method call, write `E::foo(a)` instead note: candidate #2 is defined in the trait `F` --> $DIR/issue-37767.rs:40:5 | 40 | fn foo(self) {} - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ = help: to disambiguate the method call, write `F::foo(a)` instead error: aborting due to 3 previous errors diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr index 57c4d25b7d0..aeb98e4cabc 100644 --- a/src/test/ui/span/issue-7575.stderr +++ b/src/test/ui/span/issue-7575.stderr @@ -44,10 +44,8 @@ error[E0599]: no method named `fff` found for type `Myisize` in the current scop note: candidate #1 is defined in an impl for the type `Myisize` --> $DIR/issue-7575.rs:51:5 | -51 | / fn fff(i: isize) -> isize { -52 | | i -53 | | } - | |_____^ +51 | fn fff(i: isize) -> isize { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0599]: no method named `is_str` found for type `T` in the current scope --> $DIR/issue-7575.rs:82:7 @@ -60,10 +58,8 @@ error[E0599]: no method named `is_str` found for type `T` in the current scope note: candidate #1 is defined in the trait `ManyImplTrait` --> $DIR/issue-7575.rs:57:5 | -57 | / fn is_str() -> bool { -58 | | false -59 | | } - | |_____^ +57 | fn is_str() -> bool { + | ^^^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `ManyImplTrait::is_str(t)` instead = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `is_str`, perhaps you need to implement it: |
