# Rustc bug?: generic T is also Box\<dyn T\>

**URL:** <https://internals.rust-lang.org/t/rustc-bug-generic-t-is-also-box-dyn-t/8956>\
**Category:** compiler\
**Created:** [December 4, 2018, 3:33pm UTC](https://internals.rust-lang.org/t/rustc-bug-generic-t-is-also-box-dyn-t/8956 "2018-12-04T15:33:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Nemo157](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/nemo157/32/11585_2.png) [@Nemo157](https://internals.rust-lang.org/u/Nemo157)\
**Post date:** [December 4, 2018, 3:37pm UTC](https://internals.rust-lang.org/t/rustc-bug-generic-t-is-also-box-dyn-t/8956/3 "2018-12-04T15:37:43Z")

</div>

Consider the following code:

```rust
let boxed: Box<dyn ATrait> = Box::new(SomethingThatImplementsATrait);
let boxed2: Box<dyn ATrait> = boxed.from();

```

In the second line the compiler needs to find an implementation for `<Box<dyn ATrait> as From<Box<dyn ATrait>>>::from`, it can either take the fully generic one from `core`, or, because `Box<dyn ATrait>: ATrait`, the one you have written.

---

_[View the full topic](https://internals.rust-lang.org/t/rustc-bug-generic-t-is-also-box-dyn-t/8956)._
