Description
Summary
The "diff against nightly" feature for rustdoc tests sometimes stable rustdoc, resulting in a spurious diff
Command used
./x test tests/rustdoc/whitespace-after-where-clause.rs
I'd also modified rustdoc, so that this test fails
Expected behaviour
compiletest prints out a diff between what nightly and in-tree rustdoc produces.
Actual behaviour
compiletest prints out a diff between what nightly and stable rustdoc produces.
This leads to a load of spurious diff:
@@ -409,9 +409,9 @@
<details class="toggle implementors-toggle">
<summary>
<section id="impl-TryInto%3CU%3E-for-T" class="impl">
- <a class="src rightside" href="https://doc.rust-lang.org/1.87.0/src/core/convert/mod.rs.html#791-793">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a>
+ <a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#797-799">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a>
<h3 class="code-header">
- impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.87.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T
+ impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T
</h3>
<div class="where">
<h3 class="code-header">
@@ -418,4 +418,4 @@
- where U: <a class="trait" href="https://doc.rust-lang.org/1.87.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,
+ where U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,
</h3>
</div>
</section>
Bootstrap configuration (bootstrap.toml)
profile = "tools"
change-id = "ignore"
[rust]
deny-warnings = false
Operating system
Ubuntu 24.04.1 LTS (Noble Numbat)
HEAD
Also, this diff to rustdoc which makes it fail the test:
diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs
index 89245fee515..5ce0a3654a9 100644
--- a/src/librustdoc/clean/blanket_impl.rs
+++ b/src/librustdoc/clean/blanket_impl.rs
@@ -93,7 +93,7 @@ pub(crate) fn synthesize_blanket_impls(
generics: clean_ty_generics(
cx,
tcx.generics_of(impl_def_id),
- tcx.explicit_predicates_of(impl_def_id),
+ tcx.predicates_of(impl_def_id),
),
// FIXME(eddyb) compute both `trait_` and `for_` from
// the post-inference `trait_ref`, as it's more accurate.
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 7658e7ad35f..93e643bcd6e 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -2832,7 +2832,7 @@ fn get_name(
}),
ItemKind::Struct(_, generics, variant_data) => StructItem(Struct {
ctor_kind: variant_data.ctor_kind(),
- generics: clean_generics(generics, cx),
+ generics: clean_ty_generics(cx, cx.tcx.generics_of(def_id), cx.tcx.predicates_of(def_id)),
fields: variant_data.fields().iter().map(|x| clean_field(x, cx)).collect(),
}),
ItemKind::Macro(_, macro_def, MacroKind::Bang) => MacroItem(Macro {
Additional context
It looks like compiletest uses the default toolchain, rather than nightly
rust/src/tools/compiletest/src/runtest.rs
Lines 1961 to 1975 in 14863ea
For me, that's stable. Doing rustup override set nightly
fixes this.
Build Log (as a gist, because it's too long for github issues)