Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9c8bf51
Remove invalid case for mutable borrow suggestion
RedDocMD Dec 13, 2022
afefbb6
Clean up mut keyword check
RedDocMD Dec 14, 2022
73e7207
Fix ui constant tests for big-endian platforms
uweigand Dec 22, 2022
cc1dee1
Fix incorrect suggestion for extra `&` in pattern
obeis Dec 30, 2022
a74a488
Add ui test for #106182
obeis Dec 30, 2022
50ab306
Simplify some canonical type alias names
compiler-errors Jan 3, 2023
c104ee9
Move check_region_obligations_and_report_errors to TypeErrCtxt
compiler-errors Dec 26, 2022
21b078a
Use FxIndexSet when updating obligation causes in adjust_fulfillment_…
compiler-errors Jan 4, 2023
c5bde06
Enable Shadow Call Stack for Fuchsia on AArch64
ilovepi Dec 22, 2022
d0cf7e3
Use fmt named parameters in rustc_borrowck
wcampbell0x2a Jan 7, 2023
04f3e16
Render missing generics suggestion verbosely
compiler-errors Jan 8, 2023
21ff605
Don't suggest dyn as parameter to add
compiler-errors Jan 8, 2023
ecc0507
docs/test: add empty error-docs for `E0208`, `E0640` and `E0717`
Ezrashaw Jan 8, 2023
24ce65c
docs/test: add error-docs and UI test for `E0711`
Ezrashaw Jan 8, 2023
2c92c72
fix: fix CI errors
Ezrashaw Jan 9, 2023
abe040d
Change commit_if_ok to probe
JulianKnodt Dec 4, 2022
77b6137
Change based on comments
JulianKnodt Dec 13, 2022
b79a9a0
Set !const_evaluatable if ambig. and not inferred
JulianKnodt Dec 20, 2022
7c5cb73
Check for duplicates
JulianKnodt Dec 20, 2022
21c5ffe
Clean up
JulianKnodt Dec 21, 2022
e1965d0
Rollup merge of #105292 - JulianKnodt:no_eager_commit, r=BoxyUwU
Jan 9, 2023
a50c757
Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obk
Jan 9, 2023
3cc24ec
Rollup merge of #106047 - uweigand:s390x-test-bigendian-ui, r=oli-obk
Jan 9, 2023
78cff46
Rollup merge of #106061 - ilovepi:fuchsia-scs, r=oli-obk
Jan 9, 2023
10529bc
Rollup merge of #106164 - compiler-errors:check-region-tweak, r=oli-obk
Jan 9, 2023
b91bb01
Rollup merge of #106291 - obeis:issue-106182, r=oli-obk
Jan 9, 2023
26e6a48
Rollup merge of #106389 - compiler-errors:no-canonicalized, r=lcnr
Jan 9, 2023
d3cae2b
Rollup merge of #106468 - compiler-errors:err-instability, r=lcnr
Jan 9, 2023
e49d0c3
Rollup merge of #106549 - wcampbell0x2a:use-fmt-named-parameters-borr…
Jan 9, 2023
e9b0aed
Rollup merge of #106608 - compiler-errors:missing-generics-verbose, r…
Jan 9, 2023
3bb993c
Rollup merge of #106614 - Ezrashaw:ui-test-fixups-2, r=GuillaumeGomez
Jan 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs/test: add error-docs and UI test for E0711
  • Loading branch information
Ezrashaw committed Jan 9, 2023
commit 24ce65c8d6b0ab91426e9f702b49be18a47f48f6
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ E0713: include_str!("./error_codes/E0713.md"),
E0714: include_str!("./error_codes/E0714.md"),
E0715: include_str!("./error_codes/E0715.md"),
E0716: include_str!("./error_codes/E0716.md"),
E0711: include_str!("./error_codes/E0711.md"),
E0717: include_str!("./error_codes/E0717.md"),
E0718: include_str!("./error_codes/E0718.md"),
E0719: include_str!("./error_codes/E0719.md"),
Expand Down Expand Up @@ -640,7 +641,6 @@ E0791: include_str!("./error_codes/E0791.md"),
// E0702, // replaced with a generic attribute input check
// E0707, // multiple elided lifetimes used in arguments of `async fn`
// E0709, // multiple different lifetimes used in arguments of `async fn`
E0711, // a feature has been declared with conflicting stability attributes, internal error code
// E0721, // `await` keyword
// E0723, // unstable feature in `const` context
// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
Expand Down
30 changes: 30 additions & 0 deletions compiler/rustc_error_codes/src/error_codes/E0711.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,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.
18 changes: 18 additions & 0 deletions src/test/ui/error-codes/E0711.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// copied from: src/test/ui/feature-gates/stability-attribute-consistency.rs

#![feature(staged_api)]

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

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

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

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

fn main() {}
15 changes: 15 additions & 0 deletions src/test/ui/error-codes/E0711.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0711]: feature `foo` is declared stable since 1.29.0, but was previously declared stable since 1.0.0
--> $DIR/E0711.rs:10:1
|
LL | #[stable(feature = "foo", since = "1.29.0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0711]: feature `foo` is declared unstable, but was previously declared stable
--> $DIR/E0711.rs:14:1
|
LL | #[unstable(feature = "foo", issue = "none")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

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