1
Fork 0

rustdoc: remove rust logo from non-Rust crates

This commit is contained in:
Michael Howell 2023-09-19 16:28:18 -07:00
parent 6d6fa792ff
commit c6e6ecb1af
46 changed files with 208 additions and 36 deletions

View file

@ -1108,6 +1108,7 @@ impl CheckAttrVisitor<'_> {
| sym::html_root_url
| sym::html_no_source
| sym::test
| sym::rust_logo
if !self.check_attr_crate_level(attr, meta, hir_id) =>
{
is_valid = false;
@ -1166,6 +1167,18 @@ impl CheckAttrVisitor<'_> {
| sym::plugins
| sym::fake_variadic => {}
sym::rust_logo => {
if !self.tcx.features().rustdoc_internals {
feature_err(
&self.tcx.sess.parse_sess,
sym::rustdoc_internals,
meta.span(),
"the `#[doc(rust_logo)]` attribute is used for Rust branding",
)
.emit();
}
}
sym::test => {
if !self.check_test_attr(meta, hir_id) {
is_valid = false;

View file

@ -6,6 +6,9 @@
#![allow(rustc::potential_query_instability)]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![cfg_attr(not(bootstrap), doc(rust_logo))]
#![cfg_attr(not(bootstrap), feature(rustdoc_internals))]
#![cfg_attr(not(bootstrap), allow(internal_features))]
#![feature(iter_intersperse)]
#![feature(let_chains)]
#![feature(map_try_insert)]