]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-item/issue-48027.stderr
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
[rust.git] / src / test / ui / associated-item / issue-48027.stderr
1 error[E0283]: type annotations needed
2   --> $DIR/issue-48027.rs:3:32
3    |
4 LL |     fn return_n(&self) -> [u8; Bar::X];
5    |                                ^^^^^^
6    |                                |
7    |                                cannot infer type
8    |                                help: use the fully qualified path to an implementation: `<Type as Bar>::X`
9    |
10    = note: cannot satisfy `_: Bar`
11    = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
12 note: required by `Bar::X`
13   --> $DIR/issue-48027.rs:2:5
14    |
15 LL |     const X: usize;
16    |     ^^^^^^^^^^^^^^^
17
18 error[E0038]: the trait `Bar` cannot be made into an object
19   --> $DIR/issue-48027.rs:6:6
20    |
21 LL | impl dyn Bar {}
22    |      ^^^^^^^ `Bar` cannot be made into an object
23    |
24 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
25   --> $DIR/issue-48027.rs:2:11
26    |
27 LL | trait Bar {
28    |       --- this trait cannot be made into an object...
29 LL |     const X: usize;
30    |           ^ ...because it contains this associated `const`
31    = help: consider moving `X` to another trait
32
33 error: aborting due to 2 previous errors
34
35 Some errors have detailed explanations: E0038, E0283.
36 For more information about an error, try `rustc --explain E0038`.