]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-item/issue-48027.stderr
Auto merge of #81507 - weiznich:add_diesel_to_cargo_test, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-item / issue-48027.stderr
1 error[E0038]: the trait `Bar` cannot be made into an object
2   --> $DIR/issue-48027.rs:6:6
3    |
4 LL | impl dyn Bar {}
5    |      ^^^^^^^ `Bar` cannot be made into an object
6    |
7    = help: consider moving `X` to another trait
8 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>
9   --> $DIR/issue-48027.rs:2:11
10    |
11 LL | trait Bar {
12    |       --- this trait cannot be made into an object...
13 LL |     const X: usize;
14    |           ^ ...because it contains this associated `const`
15
16 error[E0283]: type annotations needed
17   --> $DIR/issue-48027.rs:3:32
18    |
19 LL |     const X: usize;
20    |     --------------- required by `Bar::X`
21 LL |     fn return_n(&self) -> [u8; Bar::X];
22    |                                ^^^^^^
23    |                                |
24    |                                cannot infer type
25    |                                help: use the fully qualified path to an implementation: `<Type as Bar>::X`
26    |
27    = note: cannot satisfy `_: Bar`
28    = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
29
30 error: aborting due to 2 previous errors
31
32 Some errors have detailed explanations: E0038, E0283.
33 For more information about an error, try `rustc --explain E0038`.