Skip to content

Commit 8e9e6e9

Browse files
committed
Make more traits of the From/Into family diagnostic items
Following traits are now diagnostic items: - `From` (unchanged) - `Into` - `TryFrom` - `TryInto` This also adds symbols for those items: - `into_trait` - `try_from_trait` - `try_into_trait`
1 parent 564b4d2 commit 8e9e6e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/convert/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ pub trait AsMut<T: ?Sized> {
267267
///
268268
/// [`String`]: ../../std/string/struct.String.html
269269
/// [`Vec`]: ../../std/vec/struct.Vec.html
270+
#[rustc_diagnostic_item = "into_trait"]
270271
#[stable(feature = "rust1", since = "1.0.0")]
271272
pub trait Into<T>: Sized {
272273
/// Performs the conversion.
@@ -382,6 +383,7 @@ pub trait From<T>: Sized {
382383
///
383384
/// This suffers the same restrictions and reasoning as implementing
384385
/// [`Into`], see there for details.
386+
#[rustc_diagnostic_item = "try_into_trait"]
385387
#[stable(feature = "try_from", since = "1.34.0")]
386388
pub trait TryInto<T>: Sized {
387389
/// The type returned in the event of a conversion error.
@@ -462,6 +464,7 @@ pub trait TryInto<T>: Sized {
462464
///
463465
/// [`try_from`]: TryFrom::try_from
464466
/// [`!`]: ../../std/primitive.never.html
467+
#[rustc_diagnostic_item = "try_from_trait"]
465468
#[stable(feature = "try_from", since = "1.34.0")]
466469
pub trait TryFrom<T>: Sized {
467470
/// The type returned in the event of a conversion error.

0 commit comments

Comments
 (0)