rustdoc: remove rust logo from non-Rust crates
This commit is contained in:
parent
6d6fa792ff
commit
c6e6ecb1af
46 changed files with 208 additions and 36 deletions
|
@ -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;
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue