rust/tests/rustdoc/inline_cross/implementors-js.rs
Michael Howell ade7ecf909 rustdoc: rename /implementors to /impl.trait
This is shorter, avoids potential conflicts with a crate
named `implementors`[^1], and will be less confusing when JS
include files are added for type aliases.

[^1]: AFAIK, this couldn't actually cause any problems right now,
but it's simpler just to make it impossible than relying on never
having a file named `trait.Foo.js` in the crate data area.
2023-10-22 15:47:34 -07:00

26 lines
889 B
Rust

// aux-build:implementors_inline.rs
// build-aux-docs
// ignore-cross-compile
extern crate implementors_inline;
// @!has trait.impl/implementors_js/trait.MyTrait.js
// @has trait.impl/implementors_inline/my_trait/trait.MyTrait.js
// @!has trait.impl/implementors_inline/prelude/trait.MyTrait.js
// @has implementors_inline/my_trait/trait.MyTrait.html
// @has - '//script/@src' '../../trait.impl/implementors_inline/my_trait/trait.MyTrait.js'
// @has implementors_js/trait.MyTrait.html
// @has - '//script/@src' '../trait.impl/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
}
}