mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 00:53:48 +00:00
Rollup merge of #97470 - notriddle:notriddle/test-cases, r=GuillaumeGomez
rustdoc: add more test coverage https://github.com/rust-lang/rust/issues/91113
This commit is contained in:
commit
a1dc541c69
@ -0,0 +1,18 @@
|
||||
pub mod my_trait {
|
||||
pub trait MyTrait {
|
||||
fn my_fn(&self) -> Self;
|
||||
}
|
||||
}
|
||||
|
||||
pub mod prelude {
|
||||
#[doc(inline)]
|
||||
pub use crate::my_trait::MyTrait;
|
||||
}
|
||||
|
||||
pub struct SomeStruct;
|
||||
|
||||
impl my_trait::MyTrait for SomeStruct {
|
||||
fn my_fn(&self) -> SomeStruct {
|
||||
SomeStruct
|
||||
}
|
||||
}
|
25
src/test/rustdoc/inline_cross/implementors-js.rs
Normal file
25
src/test/rustdoc/inline_cross/implementors-js.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// aux-build:implementors_inline.rs
|
||||
// build-aux-docs
|
||||
// ignore-cross-compile
|
||||
|
||||
extern crate implementors_inline;
|
||||
|
||||
// @!has implementors/implementors_js/trait.MyTrait.js
|
||||
// @has implementors/implementors_inline/my_trait/trait.MyTrait.js
|
||||
// @!has implementors/implementors_inline/prelude/trait.MyTrait.js
|
||||
// @has implementors_inline/my_trait/trait.MyTrait.html
|
||||
// @has - '//script/@src' '../../implementors/implementors_inline/my_trait/trait.MyTrait.js'
|
||||
// @has implementors_js/trait.MyTrait.html
|
||||
// @has - '//script/@src' '../implementors/implementors_inline/my_trait/trait.MyTrait.js'
|
||||
/// When re-exporting this trait, the HTML will be inlined,
|
||||
/// but, vitally, the JavaScript will be located only at the
|
||||
/// one canonical path.
|
||||
pub use implementors_inline::prelude::MyTrait;
|
||||
|
||||
pub struct OtherStruct;
|
||||
|
||||
impl MyTrait for OtherStruct {
|
||||
fn my_fn(&self) -> OtherStruct {
|
||||
OtherStruct
|
||||
}
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
#![allow(rustdoc::broken_intra_doc_links)]
|
||||
#![forbid(rustdoc::broken_intra_doc_links)]
|
||||
|
||||
//! Email me at <hello@example.com>.
|
||||
//! Email me at <hello-world@example.com>.
|
||||
//! Email me at <hello@localhost> (this warns but will still become a link).
|
||||
//! Email me at <hello@localhost>.
|
||||
//! Email me at <prim@i32>.
|
||||
// @has email_address/index.html '//a[@href="mailto:hello@example.com"]' 'hello@example.com'
|
||||
// @has email_address/index.html '//a[@href="mailto:hello-world@example.com"]' 'hello-world@example.com'
|
||||
// @has email_address/index.html '//a[@href="mailto:hello@localhost"]' 'hello@localhost'
|
||||
// @has email_address/index.html '//a[@href="mailto:prim@i32"]' 'prim@i32'
|
||||
|
Loading…
Reference in New Issue
Block a user