Skip to content

Commit

Permalink
Add test cases for inlining compiler-private items
Browse files Browse the repository at this point in the history
Closes #106421

This was already fixed by
f5d43a0, but now the test cases are
added.
  • Loading branch information
notriddle committed Feb 24, 2024
1 parent 6bdb8a4 commit 24aa348
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/rustdoc/auxiliary/issue-106421-force-unstable.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ compile-flags: -Zforce-unstable-if-unmarked
#![crate_name="foo"]
pub struct FatalError;

impl FatalError {
pub fn raise(self) -> ! {
loop {}
}
}
8 changes: 8 additions & 0 deletions tests/rustdoc/issue-106421-not-internal.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ aux-build:issue-106421-force-unstable.rs
//@ ignore-cross-compile
// This is the version where a non-compiler-internal crate inlines a compiler-internal one.
// In this case, the item shouldn't be documented, because regular users can't get at it.
extern crate foo;

// @!has issue_106421_not_internal/struct.FatalError.html '//*[@id="method.raise"]' 'fn raise'
pub use foo::FatalError;
8 changes: 8 additions & 0 deletions tests/rustdoc/issue-106421.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ aux-build:issue-106421-force-unstable.rs
//@ ignore-cross-compile
//@ compile-flags: -Zforce-unstable-if-unmarked

extern crate foo;

// @has issue_106421/struct.FatalError.html '//*[@id="method.raise"]' 'fn raise'
pub use foo::FatalError;

0 comments on commit 24aa348

Please sign in to comment.