Skip to content

Commit

Permalink
Rollup merge of rust-lang#69561 - JohnTitor:clean-up-unstable-book, r…
Browse files Browse the repository at this point in the history
…=Mark-Simulacrum

Clean up unstable book

- rust-lang#58402's feature was renamed to `tidy_test_never_used_anywhere_else` and it is now used for tidy only
- `read_initializer` link is wrong and the doc should be auto-generated so removed
- Add dummy doc for `link_cfg`
- Stop generating `compiler_builtins_lib` doc in favor of b8ccc0f
- Make `rustc_attrs` tracking issue "None"
  • Loading branch information
Centril committed Mar 8, 2020
2 parents 24757a8 + c55df37 commit d4860fc
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The tracking issue for this feature is: [#49147]

[#44109]: https://github.com/rust-lang/rust/issues/49147
[#49147]: https://github.com/rust-lang/rust/issues/49147

------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# `impl_trait_in_bindings`

The tracking issue for this feature is: [#34511]
The tracking issue for this feature is: [#63065]

[#34511]: https://github.com/rust-lang/rust/issues/34511
[#63065]: https://github.com/rust-lang/rust/issues/63065

------------------------

Expand Down
5 changes: 5 additions & 0 deletions src/doc/unstable-book/src/language-features/link-cfg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# `link_cfg`

This feature is internal to the Rust compiler and is not intended for general use.

------------------------
2 changes: 1 addition & 1 deletion src/doc/unstable-book/src/language-features/trait-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The tracking issue for this feature is: [#41517]

[#41417]: https://github.com/rust-lang/rust/issues/41517
[#41517]: https://github.com/rust-lang/rust/issues/41517

------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The tracking issue for this feature is [#60405]

[60405]: https://github.com/rust-lang/rust/issues/60405
[#60405]: https://github.com/rust-lang/rust/issues/60405

----

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# `tidy_test_never_used_anywhere_else`

This feature is internal to the Rust compiler and is not intended for general use.

------------------------
6 changes: 3 additions & 3 deletions src/librustc_feature/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ declare_features! (

// no-tracking-issue-start

/// Allows using `rustc_*` attributes (RFC 572).
(active, rustc_attrs, "1.0.0", None, None),

/// Allows using compiler's own crates.
(active, rustc_private, "1.0.0", Some(27812), None),

Expand Down Expand Up @@ -128,9 +131,6 @@ declare_features! (
/// Allows using `#[link_name="llvm.*"]`.
(active, link_llvm_intrinsics, "1.0.0", Some(29602), None),

/// Allows using `rustc_*` attributes (RFC 572).
(active, rustc_attrs, "1.0.0", Some(29642), None),

/// Allows using the `box $expr` syntax.
(active, box_syntax, "1.0.0", Some(49733), None),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: internal implementation detail
LL | #[rustc_allow_const_fn_ptr]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: aborting due to previous error
Expand Down
3 changes: 0 additions & 3 deletions src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: the `#[rustc_variance]` attribute is just used for rustc unit test
LL | #[rustc_variance]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable
Expand All @@ -13,7 +12,6 @@ error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests a
LL | #[rustc_error]
| ^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and will never be stable
Expand All @@ -22,7 +20,6 @@ error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just u
LL | #[rustc_nonnull_optimization_guaranteed]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: aborting due to 3 previous errors
Expand Down
4 changes: 0 additions & 4 deletions src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
LL | #[rustc::unknown]
| ^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: expected attribute, found macro `rustc::unknown`
Expand All @@ -19,7 +18,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
LL | #[unknown::rustc]
| ^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: expected attribute, found macro `unknown::rustc`
Expand All @@ -34,7 +32,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
LL | #[rustc_unknown]
| ^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: cannot find attribute `rustc_unknown` in this scope
Expand All @@ -49,7 +46,6 @@ error[E0658]: the `#[rustc_dummy]` attribute is just used for rustc unit tests a
LL | #[rustc_dummy]
| ^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: aborting due to 7 previous errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: this is an internal attribute that will never be stable
LL | #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}`"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: aborting due to previous error
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/proc-macro/expand-to-unstable-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
LL | #[derive(Unstable)]
| ^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/reserved/reserved-attr-on-macro.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
LL | #[rustc_attribute_should_be_reserved]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: cannot determine resolution for the macro `foo`
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/suggestions/attribute-typos.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
LL | #[rustc_err]
| ^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: cannot find attribute `rustc_err` in this scope
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/tool-attributes/diagnostic_item.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error[E0658]: diagnostic items compiler internal support for linting
LL | #[rustc_diagnostic_item = "foomp"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error: aborting due to previous error
Expand Down
14 changes: 0 additions & 14 deletions src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,6 @@ pub struct CollectedFeatures {
pub fn collect_lib_features(base_src_path: &Path) -> Features {
let mut lib_features = Features::new();

// This library feature is defined in the `compiler_builtins` crate, which
// has been moved out-of-tree. Now it can no longer be auto-discovered by
// `tidy`, because we need to filter out its (submodule) directory. Manually
// add it to the set of known library features so we can still generate docs.
lib_features.insert(
"compiler_builtins_lib".to_owned(),
Feature {
level: Status::Unstable,
since: None,
has_gate_test: false,
tracking_issue: None,
},
);

map_lib_features(base_src_path, &mut |res, _, _| {
if let Ok((name, feature)) = res {
lib_features.insert(name.to_owned(), feature);
Expand Down
18 changes: 2 additions & 16 deletions src/tools/tidy/src/unstable_book.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::features::{CollectedFeatures, Feature, Features, Status};
use crate::features::{CollectedFeatures, Features, Status};
use std::collections::BTreeSet;
use std::fs;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -73,26 +73,12 @@ fn collect_unstable_book_lib_features_section_file_names(base_src_path: &Path) -

pub fn check(path: &Path, features: CollectedFeatures, bad: &mut bool) {
let lang_features = features.lang;
let mut lib_features = features
let lib_features = features
.lib
.into_iter()
.filter(|&(ref name, _)| !lang_features.contains_key(name))
.collect::<Features>();

// This library feature is defined in the `compiler_builtins` crate, which
// has been moved out-of-tree. Now it can no longer be auto-discovered by
// `tidy`, because we need to filter out its (submodule) directory. Manually
// add it to the set of known library features so we can still generate docs.
lib_features.insert(
"compiler_builtins_lib".to_owned(),
Feature {
level: Status::Unstable,
since: None,
has_gate_test: false,
tracking_issue: None,
},
);

// Library features
let unstable_lib_feature_names = collect_unstable_feature_names(&lib_features);
let unstable_book_lib_features_section_file_names =
Expand Down

0 comments on commit d4860fc

Please sign in to comment.