未验证 提交 7b723795 编写于 作者: J Jonas Schievink 提交者: GitHub

Rollup merge of #79412 - GuillaumeGomez:cleanup-rustdoc-tests, r=jyn514

Clean up rustdoc tests by removing unnecessary features

r? ``@jyn514``
#![feature(doc_alias)]
#[doc(alias = "true")]
pub struct Foo;
#![feature(doc_alias)]
#[doc(alias = "true")]
pub struct Foo;
......
#![feature(doc_alias)]
#[doc(alias = "Demon Lord")]
pub struct Struct;
#![feature(doc_alias)]
#[doc(alias = "StructItem")]
pub struct Struct {
#[doc(alias = "StructFieldItem")]
......
#![feature(doc_alias)]
pub struct Bar;
pub trait Foo {
type X;
......
error: `#[doc(alias = "...")]` isn't allowed on extern block
--> $DIR/check-doc-alias-attr-location.rs:9:7
--> $DIR/check-doc-alias-attr-location.rs:7:7
|
LL | #[doc(alias = "foo")]
| ^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` isn't allowed on implementation block
--> $DIR/check-doc-alias-attr-location.rs:12:7
--> $DIR/check-doc-alias-attr-location.rs:10:7
|
LL | #[doc(alias = "bar")]
| ^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` isn't allowed on implementation block
--> $DIR/check-doc-alias-attr-location.rs:18:7
--> $DIR/check-doc-alias-attr-location.rs:16:7
|
LL | #[doc(alias = "foobar")]
| ^^^^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` isn't allowed on type alias in implementation block
--> $DIR/check-doc-alias-attr-location.rs:20:11
--> $DIR/check-doc-alias-attr-location.rs:18:11
|
LL | #[doc(alias = "assoc")]
| ^^^^^^^^^^^^^^^
......
#![crate_type = "lib"]
#![feature(doc_alias)]
#[doc(alias = "foo")] // ok!
pub struct Bar;
......
error: doc alias attribute expects a string: #[doc(alias = "0")]
--> $DIR/check-doc-alias-attr.rs:7:7
--> $DIR/check-doc-alias-attr.rs:6:7
|
LL | #[doc(alias)]
| ^^^^^
error: doc alias attribute expects a string: #[doc(alias = "0")]
--> $DIR/check-doc-alias-attr.rs:8:7
--> $DIR/check-doc-alias-attr.rs:7:7
|
LL | #[doc(alias = 0)]
| ^^^^^^^^^
error: doc alias attribute expects a string: #[doc(alias = "0")]
--> $DIR/check-doc-alias-attr.rs:9:7
--> $DIR/check-doc-alias-attr.rs:8:7
|
LL | #[doc(alias("bar"))]
| ^^^^^^^^^^^^
error: '\"' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:10:7
--> $DIR/check-doc-alias-attr.rs:9:7
|
LL | #[doc(alias = "\"")]
| ^^^^^^^^^^^^
error: '\n' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:11:7
--> $DIR/check-doc-alias-attr.rs:10:7
|
LL | #[doc(alias = "\n")]
| ^^^^^^^^^^^^
error: '\n' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:12:7
--> $DIR/check-doc-alias-attr.rs:11:7
|
LL | #[doc(alias = "
| _______^
......@@ -37,19 +37,19 @@ LL | | ")]
| |_^
error: '\t' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:14:7
--> $DIR/check-doc-alias-attr.rs:13:7
|
LL | #[doc(alias = "\t")]
| ^^^^^^^^^^^^
error: `#[doc(alias = "...")]` cannot start or end with ' '
--> $DIR/check-doc-alias-attr.rs:15:7
--> $DIR/check-doc-alias-attr.rs:14:7
|
LL | #[doc(alias = " hello")]
| ^^^^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` cannot start or end with ' '
--> $DIR/check-doc-alias-attr.rs:16:7
--> $DIR/check-doc-alias-attr.rs:15:7
|
LL | #[doc(alias = "hello ")]
| ^^^^^^^^^^^^^^^^
......
#![feature(doc_alias)]
#![feature(trait_alias)]
pub struct Foo;
......
error: `#[doc(alias = "...")]` isn't allowed on associated constant in trait implementation block
--> $DIR/doc-alias-assoc-const.rs:11:11
--> $DIR/doc-alias-assoc-const.rs:10:11
|
LL | #[doc(alias = "CONST_BAZ")]
| ^^^^^^^^^^^^^^^^^^^
......
......@@ -2,13 +2,10 @@
// compile-flags:--test
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
#![feature(cfg_doctest)]
// Make sure `cfg(doctest)` is set when finding doctests but not inside
// the doctests.
/// ```
/// #![feature(cfg_doctest)]
/// assert!(!cfg!(doctest));
/// ```
#[cfg(doctest)]
......
running 1 test
test $DIR/doc-test-doctest-feature.rs - Foo (line 10) ... ok
test $DIR/doc-test-doctest-feature.rs - Foo (line 8) ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
#![feature(deprecated)]
// @has deprecated_future/index.html '//*[@class="stab deprecated"]' \
// 'Deprecated'
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
......
#![feature(deprecated)]
// @has deprecated/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' \
// 'Deprecated'
// @has - '//*[@class="docblock-short"]' 'Deprecated docs'
......
#![feature(const_fn)]
// @has 'issue_76501/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
/// A useless function that always returns 1.
pub const fn bloop() -> i32 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册