Skip to content

Commit

Permalink
Rollup merge of rust-lang#135858 - fmease:rustdoc-mv-obj-save-dyn-com…
Browse files Browse the repository at this point in the history
…pat-ii, r=GuillaumeGomez

rustdoc: Finalize dyn compatibility renaming

Update the Reference link to use the new URL fragment from rust-lang/reference#1666 (this change has finally hit stable). Fixes a FIXME.

Follow-up to rust-lang#131594.
Part of rust-lang#130852.
  • Loading branch information
matthiaskrgr authored Jan 22, 2025
2 parents b0bb6e3 + ff7cf14 commit 413f87a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,15 +914,14 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
let mut extern_crates = FxIndexSet::default();

if !t.is_dyn_compatible(cx.tcx()) {
// FIXME(dyn_compat_renaming): Update the URL once the Reference is updated.
write_section_heading(
w,
"Dyn Compatibility",
"dyn-compatibility",
None,
format!(
"<div class=\"dyn-compatibility-info\"><p>This trait is <b>not</b> \
<a href=\"{base}/reference/items/traits.html#object-safety\">dyn compatible</a>.</p>\
<a href=\"{base}/reference/items/traits.html#dyn-compatibility\">dyn compatible</a>.</p>\
<p><i>In older versions of Rust, dyn compatibility was called \"object safety\", \
so this trait is not object safe.</i></p></div>",
base = crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc/sidebar/sidebar-items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub trait Foo {
}

//@ has foo/trait.DynCompatible.html
//@ !has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' ''
//@ !has - '//div[@class="sidebar-elems"]//h3/a[@href="#dyn-compatibility"]' ''
pub trait DynCompatible {
fn access(&self);
}
Expand Down

0 comments on commit 413f87a

Please sign in to comment.