Skip to content

Commit 8bc59d4

Browse files
committed
Auto merge of rust-lang#89770 - jkugelman:must-use-from-and-into, r=joshtriplett
Add #[must_use] to From::from and Into::into Risk of churn: **High** Magic 8-Ball says: **Outlook not so good** I figured I'd put this out there. If we don't do it now maybe we save it for a rainy day. Parent issue: rust-lang#89692 r? `@joshtriplett`
2 parents 03545c7 + 2b2eb90 commit 8bc59d4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/convert/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ pub trait AsMut<T: ?Sized> {
273273
#[stable(feature = "rust1", since = "1.0.0")]
274274
pub trait Into<T>: Sized {
275275
/// Performs the conversion.
276+
#[must_use]
276277
#[stable(feature = "rust1", since = "1.0.0")]
277278
fn into(self) -> T;
278279
}
@@ -367,6 +368,7 @@ pub trait Into<T>: Sized {
367368
pub trait From<T>: Sized {
368369
/// Performs the conversion.
369370
#[lang = "from"]
371+
#[must_use]
370372
#[stable(feature = "rust1", since = "1.0.0")]
371373
fn from(_: T) -> Self;
372374
}

0 commit comments

Comments
 (0)