mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 12:43:36 +00:00
Rollup merge of #121218 - ShoyuVanilla:fix-issue-76736, r=notriddle
Fix missing trait impls for type in rustc docs Fixes #76736
This commit is contained in:
commit
8ba0ad0775
@ -443,11 +443,13 @@ pub(crate) fn build_impl(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(stab) = tcx.lookup_stability(did)
|
if !tcx.features().rustc_private && !cx.render_options.force_unstable_if_unmarked {
|
||||||
&& stab.is_unstable()
|
if let Some(stab) = tcx.lookup_stability(did)
|
||||||
&& stab.feature == sym::rustc_private
|
&& stab.is_unstable()
|
||||||
{
|
&& stab.feature == sym::rustc_private
|
||||||
return;
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,8 +479,11 @@ pub(crate) fn build_impl(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(stab) = tcx.lookup_stability(did) {
|
if !tcx.features().rustc_private && !cx.render_options.force_unstable_if_unmarked {
|
||||||
if stab.is_unstable() && stab.feature == sym::rustc_private {
|
if let Some(stab) = tcx.lookup_stability(did)
|
||||||
|
&& stab.is_unstable()
|
||||||
|
&& stab.feature == sym::rustc_private
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,6 +281,8 @@ pub(crate) struct RenderOptions {
|
|||||||
pub(crate) no_emit_shared: bool,
|
pub(crate) no_emit_shared: bool,
|
||||||
/// If `true`, HTML source code pages won't be generated.
|
/// If `true`, HTML source code pages won't be generated.
|
||||||
pub(crate) html_no_source: bool,
|
pub(crate) html_no_source: bool,
|
||||||
|
/// Whether `-Zforce-unstable-if-unmarked` unstable option is set
|
||||||
|
pub(crate) force_unstable_if_unmarked: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||||
@ -347,6 +349,7 @@ impl Options {
|
|||||||
|
|
||||||
let codegen_options = CodegenOptions::build(early_dcx, matches);
|
let codegen_options = CodegenOptions::build(early_dcx, matches);
|
||||||
let unstable_opts = UnstableOptions::build(early_dcx, matches);
|
let unstable_opts = UnstableOptions::build(early_dcx, matches);
|
||||||
|
let force_unstable_if_unmarked = unstable_opts.force_unstable_if_unmarked;
|
||||||
|
|
||||||
let dcx = new_dcx(error_format, None, diagnostic_width, &unstable_opts);
|
let dcx = new_dcx(error_format, None, diagnostic_width, &unstable_opts);
|
||||||
|
|
||||||
@ -760,6 +763,7 @@ impl Options {
|
|||||||
call_locations,
|
call_locations,
|
||||||
no_emit_shared: false,
|
no_emit_shared: false,
|
||||||
html_no_source,
|
html_no_source,
|
||||||
|
force_unstable_if_unmarked,
|
||||||
};
|
};
|
||||||
Some((options, render_options))
|
Some((options, render_options))
|
||||||
}
|
}
|
||||||
|
6
tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs
Normal file
6
tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#![feature(staged_api)]
|
||||||
|
#![unstable(feature = "rustc_private", issue = "none")]
|
||||||
|
|
||||||
|
pub trait MaybeResult<T> {}
|
||||||
|
|
||||||
|
impl<T> MaybeResult<T> for T {}
|
5
tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs
Normal file
5
tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
|
extern crate issue_76736_1;
|
||||||
|
|
||||||
|
pub struct Bar;
|
15
tests/rustdoc/inline_cross/issue-76736-1.rs
Normal file
15
tests/rustdoc/inline_cross/issue-76736-1.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// aux-build:issue-76736-1.rs
|
||||||
|
// aux-build:issue-76736-2.rs
|
||||||
|
|
||||||
|
#![crate_name = "foo"]
|
||||||
|
|
||||||
|
extern crate issue_76736_1;
|
||||||
|
extern crate issue_76736_2;
|
||||||
|
|
||||||
|
// @has foo/struct.Foo.html
|
||||||
|
// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
|
||||||
|
pub struct Foo;
|
||||||
|
|
||||||
|
// @has foo/struct.Bar.html
|
||||||
|
// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
|
||||||
|
pub use issue_76736_2::Bar;
|
16
tests/rustdoc/inline_cross/issue-76736-2.rs
Normal file
16
tests/rustdoc/inline_cross/issue-76736-2.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// aux-build:issue-76736-1.rs
|
||||||
|
// aux-build:issue-76736-2.rs
|
||||||
|
|
||||||
|
#![crate_name = "foo"]
|
||||||
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
|
extern crate issue_76736_1;
|
||||||
|
extern crate issue_76736_2;
|
||||||
|
|
||||||
|
// @has foo/struct.Foo.html
|
||||||
|
// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
|
||||||
|
pub struct Foo;
|
||||||
|
|
||||||
|
// @has foo/struct.Bar.html
|
||||||
|
// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
|
||||||
|
pub use issue_76736_2::Bar;
|
16
tests/rustdoc/inline_cross/issue-76736-3.rs
Normal file
16
tests/rustdoc/inline_cross/issue-76736-3.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// compile-flags: -Zforce-unstable-if-unmarked
|
||||||
|
// aux-build:issue-76736-1.rs
|
||||||
|
// aux-build:issue-76736-2.rs
|
||||||
|
|
||||||
|
#![crate_name = "foo"]
|
||||||
|
|
||||||
|
extern crate issue_76736_1;
|
||||||
|
extern crate issue_76736_2;
|
||||||
|
|
||||||
|
// @has foo/struct.Foo.html
|
||||||
|
// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
|
||||||
|
pub struct Foo;
|
||||||
|
|
||||||
|
// @has foo/struct.Bar.html
|
||||||
|
// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
|
||||||
|
pub use issue_76736_2::Bar;
|
Loading…
Reference in New Issue
Block a user