rustdoc-search: let From and Into be unboxed

This commit is contained in:
Michael Howell 2024-12-13 11:05:30 -07:00
parent f068d8b809
commit 246835eda4
3 changed files with 13 additions and 1 deletions

View file

@ -443,6 +443,7 @@ pub trait AsMut<T: ?Sized> {
/// [`Vec`]: ../../std/vec/struct.Vec.html
#[rustc_diagnostic_item = "Into"]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(search_unbox)]
pub trait Into<T>: Sized {
/// Converts this type into the (usually inferred) input type.
#[must_use]
@ -577,6 +578,7 @@ pub trait Into<T>: 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<T>: Sized {
/// Converts to this type from the input type.
#[rustc_diagnostic_item = "from_fn"]

View file

@ -22,4 +22,14 @@ const EXPECTED = [
},
],
},
{
'query': 'tyctxt, defid, symbol -> bool',
'others': [
{
'path': 'foo::TyCtxt',
'name': 'has_attr',
'displayType': "`TyCtxt`, Into<`DefId`>, `Symbol` -> `bool`",
},
],
},
];

View file

@ -1,4 +1,4 @@
#![crate_name="foo"]
#![crate_name = "foo"]
pub struct TyCtxt;
pub struct DefId;