]> git.proxmox.com Git - rustc.git/blame - src/test/ui/parser/trait-object-delimiters.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / parser / trait-object-delimiters.stderr
CommitLineData
17df50a5
XL
1error: ambiguous `+` in a type
2 --> $DIR/trait-object-delimiters.rs:3:13
3 |
4LL | fn foo1(_: &dyn Drop + AsRef<str>) {}
5 | ^^^^^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(dyn Drop + AsRef<str>)`
6
7error: incorrect braces around trait bounds
8 --> $DIR/trait-object-delimiters.rs:6:17
9 |
10LL | fn foo2(_: &dyn (Drop + AsRef<str>)) {}
11 | ^ ^
12 |
13help: remove the parentheses
14 |
94222f64
XL
15LL - fn foo2(_: &dyn (Drop + AsRef<str>)) {}
16LL + fn foo2(_: &dyn Drop + AsRef<str>) {}
923072b8 17 |
17df50a5
XL
18
19error: expected parameter name, found `{`
20 --> $DIR/trait-object-delimiters.rs:8:17
21 |
22LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
23 | ^ expected parameter name
24
94222f64 25error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
17df50a5
XL
26 --> $DIR/trait-object-delimiters.rs:8:17
27 |
28LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
94222f64 29 | -^ expected one of 9 possible tokens
17df50a5
XL
30 | |
31 | help: missing `,`
32
33error: expected identifier, found `<`
34 --> $DIR/trait-object-delimiters.rs:12:17
35 |
36LL | fn foo4(_: &dyn <Drop + AsRef<str>>) {}
37 | ^ expected identifier
38
39error: invalid `dyn` keyword
40 --> $DIR/trait-object-delimiters.rs:14:25
41 |
42LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
43 | ^^^ help: remove this keyword
44 |
45 = help: `dyn` is only needed at the start of a trait `+`-separated list
46
47error[E0225]: only auto traits can be used as additional traits in a trait object
48 --> $DIR/trait-object-delimiters.rs:3:24
49 |
50LL | fn foo1(_: &dyn Drop + AsRef<str>) {}
51 | ---- ^^^^^^^^^^ additional non-auto trait
52 | |
53 | first non-auto trait
54 |
c295e0f8 55 = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
17df50a5
XL
56 = 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>
57
58error[E0224]: at least one trait is required for an object type
59 --> $DIR/trait-object-delimiters.rs:8:13
60 |
61LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
62 | ^^^
63
64error[E0225]: only auto traits can be used as additional traits in a trait object
65 --> $DIR/trait-object-delimiters.rs:14:29
66 |
67LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
68 | ---- ^^^^^^^^^^ additional non-auto trait
69 | |
70 | first non-auto trait
71 |
c295e0f8 72 = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
17df50a5
XL
73 = 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>
74
75error: aborting due to 9 previous errors
76
77Some errors have detailed explanations: E0224, E0225.
78For more information about an error, try `rustc --explain E0224`.