|
| 1 | +error[E0670]: `async fn` is not permitted in Rust 2015 |
| 2 | + --> $DIR/issue-138710.rs:16:1 |
| 3 | + | |
| 4 | +LL | async fn fun() -> Box<dyn A> { |
| 5 | + | ^^^^^ to use `async fn`, switch to Rust 2018 or later |
| 6 | + | |
| 7 | + = help: pass `--edition 2024` to `rustc` |
| 8 | + = note: for more on editions, read https://doc.rust-lang.org/edition-guide |
| 9 | + |
| 10 | +warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes |
| 11 | + --> $DIR/issue-138710.rs:6:12 |
| 12 | + | |
| 13 | +LL | #![feature(min_generic_const_args)] |
| 14 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 15 | + | |
| 16 | + = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information |
| 17 | + = note: `#[warn(incomplete_features)]` on by default |
| 18 | + |
| 19 | +error[E0277]: the trait bound `Vec<u32>: B` is not satisfied |
| 20 | + --> $DIR/issue-138710.rs:17:18 |
| 21 | + | |
| 22 | +LL | *(&mut [0; <<Vec<u32> as B>::N as A>::N]) |
| 23 | + | ^^^^^^^^ the trait `B` is not implemented for `Vec<u32>` |
| 24 | + | |
| 25 | +help: this trait has no implementations, consider adding one |
| 26 | + --> $DIR/issue-138710.rs:8:1 |
| 27 | + | |
| 28 | +LL | trait B { |
| 29 | + | ^^^^^^^ |
| 30 | + |
| 31 | +error[E0308]: mismatched types |
| 32 | + --> $DIR/issue-138710.rs:17:5 |
| 33 | + | |
| 34 | +LL | *(&mut [0; <<Vec<u32> as B>::N as A>::N]) |
| 35 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn A>`, found `[{integer}; _]` |
| 36 | + | |
| 37 | + = note: expected struct `Box<(dyn A + 'static)>` |
| 38 | + found array `[{integer}; _]` |
| 39 | + = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html |
| 40 | +help: store this in the heap by calling `Box::new` |
| 41 | + | |
| 42 | +LL | Box::new(*(&mut [0; <<Vec<u32> as B>::N as A>::N])) |
| 43 | + | +++++++++ + |
| 44 | + |
| 45 | +error[E0038]: the trait `A` is not dyn compatible |
| 46 | + --> $DIR/issue-138710.rs:16:1 |
| 47 | + | |
| 48 | +LL | async fn fun() -> Box<dyn A> { |
| 49 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `A` is not dyn compatible |
| 50 | + | |
| 51 | +note: for a trait to be dyn compatible it needs to allow building a vtable |
| 52 | + for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility> |
| 53 | + --> $DIR/issue-138710.rs:13:11 |
| 54 | + | |
| 55 | +LL | trait A { |
| 56 | + | - this trait is not dyn compatible... |
| 57 | +LL | const N: usize; |
| 58 | + | ^ ...because it contains this associated `const` |
| 59 | + = help: consider moving `N` to another trait |
| 60 | + |
| 61 | +error: aborting due to 4 previous errors; 1 warning emitted |
| 62 | + |
| 63 | +Some errors have detailed explanations: E0038, E0277, E0308, E0670. |
| 64 | +For more information about an error, try `rustc --explain E0038`. |
0 commit comments