Skip to content

Commit f8911e3

Browse files
committed
:: selective on any case with dyn (#91997)
1 parent efd809e commit f8911e3

13 files changed

+44
-13
lines changed

tests/ui/associated-types/associated-types-incomplete-object.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ LL | type B;
2525
| ------ `B` defined here
2626
...
2727
LL | let d = &42isize as &dyn Foo;
28-
| ^^^ help: specify the associated types: `Foo::<A = Type, B = Type>`
28+
| ^^^ help: specify the associated types: `Foo<A = Type, B = Type>`
2929

3030
error: aborting due to 3 previous errors
3131

tests/ui/associated-types/issue-22560.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ LL | type Test = dyn Add + Sub;
2525
|
2626
help: specify the associated types
2727
|
28-
LL | type Test = dyn Add::<Output = Type> + Sub::<Output = Type>;
29-
| ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
28+
LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
29+
| ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
3030

3131
error[E0393]: the type parameter `Rhs` must be explicitly specified
3232
--> $DIR/issue-22560.rs:9:17

tests/ui/associated-types/issue-23595-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | type Value;
66
LL | type ChildKey;
77
| ------------- `ChildKey` defined here
88
LL | type Children = dyn Index<Self::ChildKey, Output = dyn Hierarchy>;
9-
| ------------- `Children` defined here ^^^^^^^^^ help: specify the associated types: `Hierarchy::<Value = Type, ChildKey = Type, Children = Type>`
9+
| ------------- `Children` defined here ^^^^^^^^^ help: specify the associated types: `Hierarchy<Value = Type, ChildKey = Type, Children = Type>`
1010

1111
error: aborting due to 1 previous error
1212

tests/ui/error-codes/E0191.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type Bar;
55
| -------- `Bar` defined here
66
...
77
LL | type Foo = dyn Trait;
8-
| ^^^^^ help: specify the associated type: `Trait::<Bar = Type>`
8+
| ^^^^^ help: specify the associated type: `Trait<Bar = Type>`
99

1010
error: aborting due to 1 previous error
1111

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
trait MyIterator : Iterator {}
2+
3+
fn main() {
4+
let _ = MyIterator::next;
5+
}
6+
//~^^ ERROR the value of the associated type `Item` in `Iterator` must be specified [E0191]
7+
//~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
8+
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
warning: trait objects without an explicit `dyn` are deprecated
2+
--> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
3+
|
4+
LL | let _ = MyIterator::next;
5+
| ^^^^^^^^^^
6+
|
7+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
8+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
9+
= note: `#[warn(bare_trait_objects)]` on by default
10+
help: if this is an object-safe trait, use `dyn`
11+
|
12+
LL | let _ = <dyn MyIterator>::next;
13+
| ++++ +
14+
15+
error[E0191]: the value of the associated type `Item` in `Iterator` must be specified
16+
--> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
17+
|
18+
LL | let _ = MyIterator::next;
19+
| ^^^^^^^^^^ help: specify the associated type: `MyIterator::<Item = Type>`
20+
21+
error: aborting due to 1 previous error; 1 warning emitted
22+
23+
For more information about this error, try `rustc --explain E0191`.

tests/ui/issues/issue-19482.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type A;
55
| ------ `A` defined here
66
...
77
LL | fn bar(x: &dyn Foo) {}
8-
| ^^^ help: specify the associated type: `Foo::<A = Type>`
8+
| ^^^ help: specify the associated type: `Foo<A = Type>`
99

1010
error: aborting due to 1 previous error
1111

tests/ui/issues/issue-21950.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type Output;
55
| ----------- `Output` defined here
66
...
77
LL | let x = &10 as &dyn Add;
8-
| ^^^ help: specify the associated type: `Add::<Output = Type>`
8+
| ^^^ help: specify the associated type: `Add<Output = Type>`
99

1010
error[E0393]: the type parameter `Rhs` must be explicitly specified
1111
--> $DIR/issue-21950.rs:10:25

tests/ui/issues/issue-22434.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type A;
55
| ------ `A` defined here
66
...
77
LL | type I<'a> = &'a (dyn Foo + 'a);
8-
| ^^^ help: specify the associated type: `Foo::<A = Type>`
8+
| ^^^ help: specify the associated type: `Foo<A = Type>`
99

1010
error: aborting due to 1 previous error
1111

tests/ui/issues/issue-23024.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ error[E0191]: the value of the associated type `Output` in `FnOnce` must be spec
2323
--> $DIR/issue-23024.rs:8:39
2424
|
2525
LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3));
26-
| ^^ help: specify the associated type: `Fn::<Output = Type>`
26+
| ^^ help: specify the associated type: `Fn<Output = Type>`
2727

2828
error: aborting due to 3 previous errors
2929

0 commit comments

Comments
 (0)