File: E0711.md

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, 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 (30 lines) | stat: -rw-r--r-- 1,070 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
#### This error code is internal to the compiler and will not be emitted with normal Rust code.

Feature declared with conflicting stability requirements.

```compile_fail,E0711
// NOTE: this attribute is perma-unstable and should *never* be used outside of
//       stdlib and the compiler.
#![feature(staged_api)]

#![stable(feature = "...", since = "1.0.0")]

#[stable(feature = "foo", since = "1.0.0")]
fn foo_stable_1_0_0() {}

// error: feature `foo` is declared stable since 1.29.0
#[stable(feature = "foo", since = "1.29.0")]
fn foo_stable_1_29_0() {}

// error: feature `foo` is declared unstable
#[unstable(feature = "foo", issue = "none")]
fn foo_unstable() {}
```

In the above example, the `foo` feature is first defined to be stable since
1.0.0, but is then re-declared stable since 1.29.0. This discrepancy in
versions causes an error. Furthermore, `foo` is then re-declared as unstable,
again the conflict causes an error.

This error can be fixed by splitting the feature, this allows any
stability requirements and removes any possibility of conflict.