forked from rust-lang/glacier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust-lang/rust#98002 rust-lang/rust#98003 rust-lang/rust#98006 rust-lang/rust#98007 rust-lang/rust#98009
- Loading branch information
1 parent
c984b86
commit 6f51619
Showing
5 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs <<'EOF' | ||
#![crate_name = "foo"] | ||
#![feature(rustdoc_internals)] | ||
// @has foo/index.html '//h2[@id="keywords"]' 'Keywords' | ||
// @has foo/index.html '//a[@href="keyword.match.html"]' 'match' | ||
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Keywords' | ||
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#keywords' | ||
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match' | ||
// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match' | ||
// @has foo/keyword.match.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' | ||
// @has foo/index.html '//a/@href' '../foo/index.html' | ||
// @!has foo/foo/index.html | ||
// @!has-dir foo/foo | ||
// @!has foo/index.html '//span' '🔒' | ||
#[doc(keyword = "match")] | ||
/// this is a test! | ||
mod foo{} | ||
// @has foo/keyword.foo.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' | ||
#[doc(keyword = "foo")] | ||
/// hello | ||
mod bar {} | ||
EOF | ||
|
||
rustdoc --edition=2021 -Zunstable-options --output-format json out.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs <<'EOF' | ||
mod m1 { | ||
pub fn f() {} | ||
} | ||
mod m2 { | ||
pub fn f(_: u8) {} | ||
} | ||
pub use m1::*; | ||
pub use m2::*; | ||
pub mod glob { | ||
pub use *; | ||
} | ||
EOF | ||
|
||
rustdoc --edition=2015 -Zunstable-options --output-format json out.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs <<'EOF' | ||
#![feature(no_core)] | ||
#![no_core] | ||
#[doc(primitive = "usize")] | ||
/// This is the built-in type `usize`. | ||
mod usize { | ||
} | ||
EOF | ||
|
||
rustdoc -Zunstable-options --output-format json --document-private-items out.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs <<'EOF' | ||
#![crate_name = "foo"] | ||
// This test ensures that there is no "infinite redirection" file generated (a | ||
// file which redirects to itself). | ||
// We check it's not a redirection file. | ||
// @has 'foo/builders/struct.ActionRowBuilder.html' | ||
// @has - '//*[@id="synthetic-implementations"]' 'Auto Trait Implementations' | ||
// And that the link in the module is targetting it. | ||
// @has 'foo/builders/index.html' | ||
// @has - '//a[@href="struct.ActionRowBuilder.html"]' 'ActionRowBuilder' | ||
mod auto { | ||
mod action_row { | ||
pub struct ActionRowBuilder; | ||
} | ||
#[doc(hidden)] | ||
pub mod builders { | ||
pub use super::action_row::ActionRowBuilder; | ||
} | ||
} | ||
pub use auto::*; | ||
pub mod builders { | ||
pub use crate::auto::builders::*; | ||
} | ||
EOF | ||
|
||
rustdoc -Zunstable-options --output-format json --cap-lints warn --document-private-items --document-hidden-items out.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs <<'EOF' | ||
// run-rustfix | ||
#![allow(dead_code)] | ||
struct Events<R>(R); | ||
struct Other; | ||
pub trait Trait<T> { | ||
fn handle(value: T) -> Self; | ||
} | ||
// Blanket impl. (If you comment this out, compiler figures out that it | ||
// is passing an `&mut` to a method that must be expecting an `&mut`, | ||
// and injects an auto-reborrow.) | ||
impl<T, U> Trait<U> for T where T: From<U> { | ||
fn handle(_: U) -> Self { unimplemented!() } | ||
} | ||
impl<'a, R> Trait<&'a mut Events<R>> for Other { | ||
fn handle(_: &'a mut Events<R>) -> Self { unimplemented!() } | ||
} | ||
fn this_compiles<'a, R>(value: &'a mut Events<R>) { | ||
for _ in 0..3 { | ||
Other::handle(&mut *value); | ||
} | ||
} | ||
fn this_does_not<'a, R>(value: &'a mut Events<R>) { | ||
for _ in 0..3 { | ||
Other::handle(value); //~ ERROR use of moved value: `value` | ||
} | ||
} | ||
fn main() {} | ||
EOF | ||
|
||
rustdoc -Zunstable-options --output-format json --cap-lints warn --document-private-items --document-hidden-items out.rs |