]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/trait-object-delimiters.stderr
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / tests / ui / parser / trait-object-delimiters.stderr
1 error: ambiguous `+` in a type
2   --> $DIR/trait-object-delimiters.rs:3:13
3    |
4 LL | fn foo1(_: &dyn Drop + AsRef<str>) {}
5    |             ^^^^^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(dyn Drop + AsRef<str>)`
6
7 error: incorrect braces around trait bounds
8   --> $DIR/trait-object-delimiters.rs:6:17
9    |
10 LL | fn foo2(_: &dyn (Drop + AsRef<str>)) {}
11    |                 ^                 ^
12    |
13 help: remove the parentheses
14    |
15 LL - fn foo2(_: &dyn (Drop + AsRef<str>)) {}
16 LL + fn foo2(_: &dyn  Drop + AsRef<str>) {}
17    |
18
19 error: incorrect braces around trait bounds
20   --> $DIR/trait-object-delimiters.rs:8:25
21    |
22 LL | fn foo2_no_space(_: &dyn(Drop + AsRef<str>)) {}
23    |                         ^                 ^
24    |
25 help: remove the parentheses
26    |
27 LL - fn foo2_no_space(_: &dyn(Drop + AsRef<str>)) {}
28 LL + fn foo2_no_space(_: &dyn Drop + AsRef<str>) {}
29    |
30
31 error: expected parameter name, found `{`
32   --> $DIR/trait-object-delimiters.rs:10:17
33    |
34 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
35    |                 ^ expected parameter name
36
37 error: expected one of `!`, `(`, `)`, `*`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
38   --> $DIR/trait-object-delimiters.rs:10:17
39    |
40 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
41    |                -^ expected one of 10 possible tokens
42    |                |
43    |                help: missing `,`
44
45 error: expected identifier, found `<`
46   --> $DIR/trait-object-delimiters.rs:14:17
47    |
48 LL | fn foo4(_: &dyn <Drop + AsRef<str>>) {}
49    |                 ^ expected identifier
50
51 error: invalid `dyn` keyword
52   --> $DIR/trait-object-delimiters.rs:16:25
53    |
54 LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
55    |                         ^^^ help: remove this keyword
56    |
57    = help: `dyn` is only needed at the start of a trait `+`-separated list
58
59 error[E0225]: only auto traits can be used as additional traits in a trait object
60   --> $DIR/trait-object-delimiters.rs:3:24
61    |
62 LL | fn foo1(_: &dyn Drop + AsRef<str>) {}
63    |                 ----   ^^^^^^^^^^ additional non-auto trait
64    |                 |
65    |                 first non-auto trait
66    |
67    = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
68    = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
69
70 error[E0224]: at least one trait is required for an object type
71   --> $DIR/trait-object-delimiters.rs:10:13
72    |
73 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
74    |             ^^^
75
76 error[E0225]: only auto traits can be used as additional traits in a trait object
77   --> $DIR/trait-object-delimiters.rs:16:29
78    |
79 LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
80    |                  ----       ^^^^^^^^^^ additional non-auto trait
81    |                  |
82    |                  first non-auto trait
83    |
84    = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
85    = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
86
87 error: aborting due to 10 previous errors
88
89 Some errors have detailed explanations: E0224, E0225.
90 For more information about an error, try `rustc --explain E0224`.