1
Fork 0

Stabilize custom_code_classes_in_docs feature

This commit is contained in:
Guillaume Gomez 2024-05-01 15:24:32 +02:00
parent 378a43a065
commit 2f6abd190d
23 changed files with 67 additions and 515 deletions

View file

@ -1,83 +0,0 @@
// This test ensures that warnings are working as expected for "custom_code_classes_in_docs"
// feature.
#![feature(custom_code_classes_in_docs)]
#![deny(warnings)]
#![feature(no_core)]
#![no_core]
/// ```{. }
/// main;
/// ```
//~^^^ ERROR unexpected ` ` character after `.`
pub fn foo() {}
/// ```{class= a}
/// main;
/// ```
//~^^^ ERROR unexpected ` ` character after `=`
pub fn foo2() {}
/// ```{#id}
/// main;
/// ```
//~^^^ ERROR unexpected character `#`
pub fn foo3() {}
/// ```{{
/// main;
/// ```
//~^^^ ERROR unexpected character `{`
pub fn foo4() {}
/// ```}
/// main;
/// ```
//~^^^ ERROR unexpected character `}`
pub fn foo5() {}
/// ```)
/// main;
/// ```
//~^^^ ERROR unexpected character `)`
pub fn foo6() {}
/// ```{class=}
/// main;
/// ```
//~^^^ ERROR unexpected `}` character after `=`
pub fn foo7() {}
/// ```(
/// main;
/// ```
//~^^^ ERROR unclosed comment: missing `)` at the end
pub fn foo8() {}
/// ```{class=one=two}
/// main;
/// ```
//~^^^ ERROR unexpected `=` character
pub fn foo9() {}
/// ```{.one.two}
/// main;
/// ```
pub fn foo10() {}
/// ```{class=(one}
/// main;
/// ```
//~^^^ ERROR unexpected `(` character after `=`
pub fn foo11() {}
/// ```{class=one.two}
/// main;
/// ```
pub fn foo12() {}
/// ```{(comment)}
/// main;
/// ```
//~^^^ ERROR unexpected character `(`
pub fn foo13() {}

View file

@ -1,97 +0,0 @@
error: unexpected ` ` character after `.`
--> $DIR/custom_code_classes_in_docs-warning.rs:9:1
|
LL | / /// ```{. }
LL | | /// main;
LL | | /// ```
| |_______^
|
note: the lint level is defined here
--> $DIR/custom_code_classes_in_docs-warning.rs:5:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]`
error: unexpected ` ` character after `=`
--> $DIR/custom_code_classes_in_docs-warning.rs:15:1
|
LL | / /// ```{class= a}
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected character `#`
--> $DIR/custom_code_classes_in_docs-warning.rs:21:1
|
LL | / /// ```{#id}
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected character `{`
--> $DIR/custom_code_classes_in_docs-warning.rs:27:1
|
LL | / /// ```{{
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected character `}`
--> $DIR/custom_code_classes_in_docs-warning.rs:33:1
|
LL | / /// ```}
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected character `)`
--> $DIR/custom_code_classes_in_docs-warning.rs:39:1
|
LL | / /// ```)
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected `}` character after `=`
--> $DIR/custom_code_classes_in_docs-warning.rs:45:1
|
LL | / /// ```{class=}
LL | | /// main;
LL | | /// ```
| |_______^
error: unclosed comment: missing `)` at the end
--> $DIR/custom_code_classes_in_docs-warning.rs:51:1
|
LL | / /// ```(
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected `=` character
--> $DIR/custom_code_classes_in_docs-warning.rs:57:1
|
LL | / /// ```{class=one=two}
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected `(` character after `=`
--> $DIR/custom_code_classes_in_docs-warning.rs:68:1
|
LL | / /// ```{class=(one}
LL | | /// main;
LL | | /// ```
| |_______^
error: unexpected character `(`
--> $DIR/custom_code_classes_in_docs-warning.rs:79:1
|
LL | / /// ```{(comment)}
LL | | /// main;
LL | | /// ```
| |_______^
error: aborting due to 11 previous errors

View file

@ -1,7 +1,6 @@
// This test ensures that warnings are working as expected for "custom_code_classes_in_docs"
// feature.
#![feature(custom_code_classes_in_docs)]
#![deny(warnings)]
#![feature(no_core)]
#![no_core]

View file

@ -1,5 +1,5 @@
error: unclosed quote string `"`
--> $DIR/custom_code_classes_in_docs-warning3.rs:9:1
--> $DIR/custom_code_classes_in_docs-warning3.rs:8:1
|
LL | / /// ```{class="}
LL | | /// main;
@ -11,14 +11,14 @@ LL | | /// ```
| |_______^
|
note: the lint level is defined here
--> $DIR/custom_code_classes_in_docs-warning3.rs:5:9
--> $DIR/custom_code_classes_in_docs-warning3.rs:4:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]`
error: unclosed quote string `"`
--> $DIR/custom_code_classes_in_docs-warning3.rs:9:1
--> $DIR/custom_code_classes_in_docs-warning3.rs:8:1
|
LL | / /// ```{class="}
LL | | /// main;

View file

@ -1,16 +0,0 @@
//@ check-pass
/// ```{class=language-c}
/// int main(void) { return 0; }
/// ```
//~^^^ WARNING custom classes in code blocks will change behaviour
//~| NOTE found these custom classes: class=language-c
//~| NOTE see issue #79483 <https://github.com/rust-lang/rust/issues/79483>
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
//~| HELP add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
pub struct Bar;
/// ```ASN.1
/// int main(void) { return 0; }
/// ```
pub struct Bar2;

View file

@ -1,15 +0,0 @@
warning: custom classes in code blocks will change behaviour
--> $DIR/feature-gate-custom_code_classes_in_docs.rs:3:1
|
LL | / /// ```{class=language-c}
LL | | /// int main(void) { return 0; }
LL | | /// ```
| |_______^
|
= note: see issue #79483 <https://github.com/rust-lang/rust/issues/79483> for more information
= help: add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
= note: found these custom classes: class=language-c
warning: 1 warning emitted

View file

@ -1,5 +1,4 @@
Available passes for running rustdoc:
check-custom-code-classes - check for custom code classes without the feature-gate enabled
check_doc_test_visibility - run various visibility-related lints on doctests
strip-hidden - strips all `#[doc(hidden)]` items from the output
strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports
@ -11,7 +10,6 @@ calculate-doc-coverage - counts the number of items with and without documentati
run-lints - runs some of rustdoc's lints
Default passes for rustdoc:
check-custom-code-classes
collect-trait-impls
check_doc_test_visibility
strip-hidden (when not --document-hidden-items)