File: const-super-trait-stable-disabled.stderr

package info (click to toggle)
rustc 1.89.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 906,624 kB
  • sloc: xml: 158,148; python: 34,888; javascript: 19,595; sh: 19,221; ansic: 13,046; cpp: 7,144; asm: 4,376; makefile: 692; lisp: 174; sql: 15
file content (64 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (12)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
error: `~const` is not allowed here
 --> const-super-trait.rs:7:12
  |
7 | trait Bar: ~const Foo {}
  |            ^^^^^^
  |
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
 --> const-super-trait.rs:7:1
  |
7 | trait Bar: ~const Foo {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: const trait impls are experimental
 --> const-super-trait.rs:7:12
  |
7 | trait Bar: ~const Foo {}
  |            ^^^^^^
  |
  = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information

error[E0658]: const trait impls are experimental
 --> const-super-trait.rs:9:17
  |
9 | const fn foo<T: ~const Bar>(x: &T) {
  |                 ^^^^^^
  |
  = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information

error: `~const` can only be applied to `#[const_trait]` traits
 --> const-super-trait.rs:7:12
  |
7 | trait Bar: ~const Foo {}
  |            ^^^^^^ can't be applied to `Foo`
  |
note: `Foo` can't be used with `~const` because it isn't annotated with `#[const_trait]`
 --> const-super-trait.rs:3:1
  |
3 | trait Foo {
  | ^^^^^^^^^

error: `~const` can only be applied to `#[const_trait]` traits
 --> const-super-trait.rs:9:17
  |
9 | const fn foo<T: ~const Bar>(x: &T) {
  |                 ^^^^^^ can't be applied to `Bar`
  |
note: `Bar` can't be used with `~const` because it isn't annotated with `#[const_trait]`
 --> const-super-trait.rs:7:1
  |
7 | trait Bar: ~const Foo {}
  | ^^^^^^^^^^^^^^^^^^^^^

error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
  --> const-super-trait.rs:10:7
   |
10 |     x.a();
   |       ^^^
   |
   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0015, E0658.
For more information about an error, try `rustc --explain E0015`.