Skip to content

Commit dd6a074

Browse files
authored
Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnison
Remove spotlight I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it. r? @kinnison cc @ollie27
2 parents 0cbaefc + 13c6d58 commit dd6a074

File tree

22 files changed

+7
-400
lines changed

22 files changed

+7
-400
lines changed

src/doc/rustdoc/src/unstable-features.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,27 +138,6 @@ Book][unstable-doc-cfg] and [its tracking issue][issue-doc-cfg].
138138
[unstable-doc-cfg]: ../unstable-book/language-features/doc-cfg.html
139139
[issue-doc-cfg]: https://github.com/rust-lang/rust/issues/43781
140140

141-
### Adding your trait to the "Important Traits" dialog
142-
143-
Rustdoc keeps a list of a few traits that are believed to be "fundamental" to a given type when
144-
implemented on it. These traits are intended to be the primary interface for their types, and are
145-
often the only thing available to be documented on their types. For this reason, Rustdoc will track
146-
when a given type implements one of these traits and call special attention to it when a function
147-
returns one of these types. This is the "Important Traits" dialog, visible as a circle-i button next
148-
to the function, which, when clicked, shows the dialog.
149-
150-
In the standard library, the traits that qualify for inclusion are `Iterator`, `io::Read`, and
151-
`io::Write`. However, rather than being implemented as a hard-coded list, these traits have a
152-
special marker attribute on them: `#[doc(spotlight)]`. This means that you could apply this
153-
attribute to your own trait to include it in the "Important Traits" dialog in documentation.
154-
155-
The `#[doc(spotlight)]` attribute currently requires the `#![feature(doc_spotlight)]` feature gate.
156-
For more information, see [its chapter in the Unstable Book][unstable-spotlight] and [its tracking
157-
issue][issue-spotlight].
158-
159-
[unstable-spotlight]: ../unstable-book/language-features/doc-spotlight.html
160-
[issue-spotlight]: https://github.com/rust-lang/rust/issues/45040
161-
162141
### Exclude certain dependencies from documentation
163142

164143
The standard library uses several dependencies which, in turn, use several types and traits from the

src/doc/unstable-book/src/language-features/doc-spotlight.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/libcore/future/future.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use crate::task::{Context, Poll};
2424
/// `.await` the value.
2525
///
2626
/// [`Waker`]: ../task/struct.Waker.html
27-
#[doc(spotlight)]
2827
#[must_use = "futures do nothing unless you `.await` or poll them"]
2928
#[stable(feature = "futures_api", since = "1.36.0")]
3029
#[lang = "future_trait"]

src/libcore/iter/traits/iterator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item = ()>) {}
9292
label = "`{Self}` is not an iterator",
9393
message = "`{Self}` is not an iterator"
9494
)]
95-
#[doc(spotlight)]
9695
#[must_use = "iterators are lazy and do nothing unless consumed"]
9796
pub trait Iterator {
9897
/// The type of the elements being iterated over.

src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
#![feature(custom_inner_attributes)]
9191
#![feature(decl_macro)]
9292
#![feature(doc_cfg)]
93-
#![feature(doc_spotlight)]
9493
#![feature(extern_types)]
9594
#![feature(fundamental)]
9695
#![feature(intrinsics)]

src/librustc_ast_passes/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
245245
include => external_doc
246246
cfg => doc_cfg
247247
masked => doc_masked
248-
spotlight => doc_spotlight
249248
alias => doc_alias
250249
keyword => doc_keyword
251250
);

src/librustc_feature/active.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,6 @@ declare_features! (
360360
/// Allows `#[doc(masked)]`.
361361
(active, doc_masked, "1.21.0", Some(44027), None),
362362

363-
/// Allows `#[doc(spotlight)]`.
364-
(active, doc_spotlight, "1.22.0", Some(45040), None),
365-
366363
/// Allows `#[doc(include = "some-file")]`.
367364
(active, external_doc, "1.22.0", Some(44732), None),
368365

src/librustc_span/symbol.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ symbols! {
270270
doc_cfg,
271271
doc_keyword,
272272
doc_masked,
273-
doc_spotlight,
274273
doctest,
275274
document_private_items,
276275
dotdoteq_in_patterns,
@@ -689,7 +688,6 @@ symbols! {
689688
Some,
690689
specialization,
691690
speed,
692-
spotlight,
693691
sse4a_target_feature,
694692
stable,
695693
staged_api,

src/librustdoc/clean/inline.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,13 @@ pub fn build_external_trait(cx: &DocContext<'_>, did: DefId) -> clean::Trait {
198198
let generics = (cx.tcx.generics_of(did), predicates).clean(cx);
199199
let generics = filter_non_trait_generics(did, generics);
200200
let (generics, supertrait_bounds) = separate_supertrait_bounds(generics);
201-
let is_spotlight = load_attrs(cx, did).clean(cx).has_doc_flag(sym::spotlight);
202201
let is_auto = cx.tcx.trait_is_auto(did);
203202
clean::Trait {
204203
auto: auto_trait,
205204
unsafety: cx.tcx.trait_def(did).unsafety,
206205
generics,
207206
items: trait_items,
208207
bounds: supertrait_bounds,
209-
is_spotlight,
210208
is_auto,
211209
}
212210
}

src/librustdoc/clean/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,6 @@ impl Clean<FnRetTy> for hir::FnRetTy<'_> {
10131013
impl Clean<Item> for doctree::Trait<'_> {
10141014
fn clean(&self, cx: &DocContext<'_>) -> Item {
10151015
let attrs = self.attrs.clean(cx);
1016-
let is_spotlight = attrs.has_doc_flag(sym::spotlight);
10171016
Item {
10181017
name: Some(self.name.clean(cx)),
10191018
attrs,
@@ -1028,7 +1027,6 @@ impl Clean<Item> for doctree::Trait<'_> {
10281027
items: self.items.iter().map(|ti| ti.clean(cx)).collect(),
10291028
generics: self.generics.clean(cx),
10301029
bounds: self.bounds.clean(cx),
1031-
is_spotlight,
10321030
is_auto: self.is_auto.clean(cx),
10331031
}),
10341032
}

0 commit comments

Comments
 (0)