From 246835eda4a89bb09842ebc67776fedb6e3aba78 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 13 Dec 2024 11:05:30 -0700 Subject: [PATCH] rustdoc-search: let From and Into be unboxed --- library/core/src/convert/mod.rs | 2 ++ tests/rustdoc-js/impl-trait-inlining.js | 10 ++++++++++ tests/rustdoc-js/impl-trait-inlining.rs | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 432e55e8c9a..e468f4f0f7e 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -443,6 +443,7 @@ pub trait AsMut { /// [`Vec`]: ../../std/vec/struct.Vec.html #[rustc_diagnostic_item = "Into"] #[stable(feature = "rust1", since = "1.0.0")] +#[doc(search_unbox)] pub trait Into: Sized { /// Converts this type into the (usually inferred) input type. #[must_use] @@ -577,6 +578,7 @@ pub trait Into: Sized { all(_Self = "&str", T = "alloc::string::String"), note = "to coerce a `{T}` into a `{Self}`, use `&*` as a prefix", ))] +#[doc(search_unbox)] pub trait From: Sized { /// Converts to this type from the input type. #[rustc_diagnostic_item = "from_fn"] diff --git a/tests/rustdoc-js/impl-trait-inlining.js b/tests/rustdoc-js/impl-trait-inlining.js index 02c9853dd63..e97669c7b30 100644 --- a/tests/rustdoc-js/impl-trait-inlining.js +++ b/tests/rustdoc-js/impl-trait-inlining.js @@ -22,4 +22,14 @@ const EXPECTED = [ }, ], }, + { + 'query': 'tyctxt, defid, symbol -> bool', + 'others': [ + { + 'path': 'foo::TyCtxt', + 'name': 'has_attr', + 'displayType': "`TyCtxt`, Into<`DefId`>, `Symbol` -> `bool`", + }, + ], + }, ]; diff --git a/tests/rustdoc-js/impl-trait-inlining.rs b/tests/rustdoc-js/impl-trait-inlining.rs index a6ca0dcbd8d..f90fb72659a 100644 --- a/tests/rustdoc-js/impl-trait-inlining.rs +++ b/tests/rustdoc-js/impl-trait-inlining.rs @@ -1,4 +1,4 @@ -#![crate_name="foo"] +#![crate_name = "foo"] pub struct TyCtxt; pub struct DefId;