Skip to content

Commit

Permalink
Reword trait-object compatibility in rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jun 16, 2024
1 parent f6236f6 commit a1d3dbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -954,13 +954,13 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
if !t.is_object_safe(cx.tcx()) {
write_section_heading(
w,
"Object Safety",
"Trait-Object Safety",
"object-safety",
None,
&format!(
"<div class=\"object-safety-info\">This trait is <b>not</b> \
"<div class=\"object-safety-info\">This trait is <strong>not</strong> compatible with \
<a href=\"{base}/reference/items/traits.html#object-safety\">\
object safe</a>.</div>",
<code>dyn Trait</code> types</a>.</div>",
base = crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL
),
);
Expand Down
4 changes: 2 additions & 2 deletions tests/rustdoc/trait-object-safe.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#![crate_name = "foo"]

// @has 'foo/trait.Unsafe.html'
// @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.'
// @has - '//*[@class="object-safety-info"]' 'This trait is not compatible with dyn Trait types.'
// @has - '//*[@id="object-safety"]' 'Object Safety'
pub trait Unsafe {
fn foo() -> Self;
}

// @has 'foo/trait.Unsafe2.html'
// @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.'
// @has - '//*[@class="object-safety-info"]' 'This trait is not compatible with dyn Trait types.'
// @has - '//*[@id="object-safety"]' 'Object Safety'
pub trait Unsafe2<T> {
fn foo(i: T);
Expand Down

0 comments on commit a1d3dbf

Please sign in to comment.