Skip to content

Commit 246835e

Browse files
committed
rustdoc-search: let From and Into be unboxed
1 parent f068d8b commit 246835e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

library/core/src/convert/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ pub trait AsMut<T: ?Sized> {
443443
/// [`Vec`]: ../../std/vec/struct.Vec.html
444444
#[rustc_diagnostic_item = "Into"]
445445
#[stable(feature = "rust1", since = "1.0.0")]
446+
#[doc(search_unbox)]
446447
pub trait Into<T>: Sized {
447448
/// Converts this type into the (usually inferred) input type.
448449
#[must_use]
@@ -577,6 +578,7 @@ pub trait Into<T>: Sized {
577578
all(_Self = "&str", T = "alloc::string::String"),
578579
note = "to coerce a `{T}` into a `{Self}`, use `&*` as a prefix",
579580
))]
581+
#[doc(search_unbox)]
580582
pub trait From<T>: Sized {
581583
/// Converts to this type from the input type.
582584
#[rustc_diagnostic_item = "from_fn"]

tests/rustdoc-js/impl-trait-inlining.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@ const EXPECTED = [
2222
},
2323
],
2424
},
25+
{
26+
'query': 'tyctxt, defid, symbol -> bool',
27+
'others': [
28+
{
29+
'path': 'foo::TyCtxt',
30+
'name': 'has_attr',
31+
'displayType': "`TyCtxt`, Into<`DefId`>, `Symbol` -> `bool`",
32+
},
33+
],
34+
},
2535
];

tests/rustdoc-js/impl-trait-inlining.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![crate_name="foo"]
1+
#![crate_name = "foo"]
22

33
pub struct TyCtxt;
44
pub struct DefId;

0 commit comments

Comments
 (0)