File: span-bug-issue-121418.stderr

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,245,360 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (45 lines) | stat: -rw-r--r-- 1,967 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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`

error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates
  --> $DIR/span-bug-issue-121418.rs:7:6
   |
LL | impl const dyn T {
   |      ^^^^^ unconstrained const parameter
   |
   = note: expressions using a const parameter must map each value to a distinct output value
   = note: proving the result of expressions other than the parameter are unique is not supported

error[E0308]: mismatched types
  --> $DIR/span-bug-issue-121418.rs:10: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:10: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

Some errors have detailed explanations: E0207, E0277, E0308.
For more information about an error, try `rustc --explain E0207`.