]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / generic-associated-types / gat-trait-path-parenthesised-args.stderr
1 error: lifetime in trait object type must be followed by `+`
2   --> $DIR/gat-trait-path-parenthesised-args.rs:7:29
3    |
4 LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
5    |                             ^^
6
7 error: parenthesized generic arguments cannot be used in associated type constraints
8   --> $DIR/gat-trait-path-parenthesised-args.rs:7:27
9    |
10 LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
11    |                           ^^^^^
12
13 warning: trait objects without an explicit `dyn` are deprecated
14   --> $DIR/gat-trait-path-parenthesised-args.rs:7:29
15    |
16 LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
17    |                             ^^ help: use `dyn`: `dyn 'a`
18    |
19    = note: `#[warn(bare_trait_objects)]` on by default
20    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
21    = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
22
23 error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
24   --> $DIR/gat-trait-path-parenthesised-args.rs:7:27
25    |
26 LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
27    |                           ^ expected 1 lifetime argument
28    |
29 note: associated type defined here, with 1 lifetime parameter: `'a`
30   --> $DIR/gat-trait-path-parenthesised-args.rs:4:8
31    |
32 LL |   type Y<'a>;
33    |        ^ --
34 help: add missing lifetime argument
35    |
36 LL | fn foo<'a>(arg: Box<dyn X<Y('a, 'a) = &'a ()>>) {}
37    |                             ^^^
38
39 error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
40   --> $DIR/gat-trait-path-parenthesised-args.rs:7:27
41    |
42 LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
43    |                           ^---- help: remove these generics
44    |                           |
45    |                           expected 0 generic arguments
46    |
47 note: associated type defined here, with 0 generic parameters
48   --> $DIR/gat-trait-path-parenthesised-args.rs:4:8
49    |
50 LL |   type Y<'a>;
51    |        ^
52
53 error: aborting due to 4 previous errors; 1 warning emitted
54
55 For more information about this error, try `rustc --explain E0107`.