File: pointee-tail-is-generic-errors.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (40 lines) | stat: -rw-r--r-- 1,781 bytes parent folder | download | duplicates (8)
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
error[E0271]: type mismatch resolving `<T as Pointee>::Metadata == ()`
  --> $DIR/pointee-tail-is-generic-errors.rs:13:15
   |
LL |     is_thin::<T>();
   |               ^ expected `()`, found associated type
   |
   = note:    expected unit type `()`
           found associated type `<T as Pointee>::Metadata`
   = help: consider constraining the associated type `<T as Pointee>::Metadata` to `()`
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
note: required by a bound in `is_thin`
  --> $DIR/pointee-tail-is-generic-errors.rs:20:33
   |
LL | fn is_thin<T: std::ptr::Pointee<Metadata = ()> + ?Sized>() {}
   |                                 ^^^^^^^^^^^^^ required by this bound in `is_thin`

error[E0271]: type mismatch resolving `<Opaque as Pointee>::Metadata == ()`
  --> $DIR/pointee-tail-is-generic-errors.rs:16:15
   |
LL | type Opaque = impl std::fmt::Debug + ?Sized;
   |               ----------------------------- the found opaque type
...
LL |     is_thin::<Opaque>();
   |               ^^^^^^ expected `()`, found associated type
   |
   = note:    expected unit type `()`
           found associated type `<Opaque as Pointee>::Metadata`
note: required by a bound in `is_thin`
  --> $DIR/pointee-tail-is-generic-errors.rs:20:33
   |
LL | fn is_thin<T: std::ptr::Pointee<Metadata = ()> + ?Sized>() {}
   |                                 ^^^^^^^^^^^^^ required by this bound in `is_thin`
help: consider constraining the associated type `<Opaque as Pointee>::Metadata` to `()`
   |
LL | type Opaque = impl std::fmt::Debug<Metadata = ()> + ?Sized;
   |                                   +++++++++++++++

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.