diff --git a/src/test/run-pass/try_from.rs b/src/test/run-pass/try_from.rs index 767c2b914717..4522ce3a8d61 100644 --- a/src/test/run-pass/try_from.rs +++ b/src/test/run-pass/try_from.rs @@ -1,30 +1,23 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// This test relies on `TryFrom` being auto impl for all `T: Into` -// and `TryInto` being auto impl for all `U: TryFrom` +// This test relies on `TryFrom` being blanket impl for all `T: Into` +// and `TryInto` being blanket impl for all `U: TryFrom` // This test was added to show the motivation for doing this -// over `TryFrom` being auto impl for all `T: From` +// over `TryFrom` being blanket impl for all `T: From` #![feature(try_from, never_type)] use std::convert::TryInto; struct Foo { - t: T + t: T, } -/* // This fails to compile due to coherence restrictions -// as of rust version 1.32.x +// as of Rust version 1.32.x, therefore it could not be used +// instead of the `Into` version of the impl, and serves as +// motivation for a blanket impl for all `T: Into`, instead +// of a blanket impl for all `T: From` +/* impl From> for Box { fn from(foo: Foo) -> Box { Box::new(foo.t)