rust/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.stderr
2024-06-30 17:08:45 +00:00

51 lines
2.1 KiB
Plaintext

error: inherent impls cannot be `const`
--> $DIR/span-bug-issue-121418.rs:7:12
|
LL | impl const dyn T {
| ----- ^^^^^ inherent impl for this type
| |
| `const` because of this
|
= note: only trait implementations may be annotated with `const`
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/span-bug-issue-121418.rs:2:12
|
LL | #![feature(effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default
error: using `#![feature(effects)]` without enabling next trait solver globally
|
= note: the next trait solver must be enabled globally for the effects feature to work correctly
= help: use `-Znext-solver` to enable
error[E0308]: mismatched types
--> $DIR/span-bug-issue-121418.rs:9:27
|
LL | pub const fn new() -> std::sync::Mutex<dyn T> {}
| --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `Mutex<dyn T>`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected struct `Mutex<(dyn T + 'static)>`
found unit type `()`
error[E0277]: the size for values of type `(dyn T + 'static)` cannot be known at compilation time
--> $DIR/span-bug-issue-121418.rs:9:27
|
LL | pub const fn new() -> std::sync::Mutex<dyn T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `Mutex<(dyn T + 'static)>`, the trait `Sized` is not implemented for `(dyn T + 'static)`, which is required by `Mutex<(dyn T + 'static)>: Sized`
note: required because it appears within the type `Mutex<(dyn T + 'static)>`
--> $SRC_DIR/std/src/sync/mutex.rs:LL:COL
= note: the return type of a function must have a statically known size
error: aborting due to 4 previous errors; 1 warning emitted
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.