Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trait object warning. #666

Merged
merged 1 commit into from
Aug 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/types/trait-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ if the sets of auto traits are the same and the lifetime bounds are the same.
For example, `dyn Trait + Send + UnwindSafe` is the same as
`dyn Trait + Unwindsafe + Send`.

<div class="warning">

***Warning:*** With two trait object types, even when the complete set of traits
is the same, if the base traits differ, the type is different. For example,
`dyn Send + Sync` is a different type from `dyn Sync + Send`. See [issue 33140].

</div>

Due to the opaqueness of which concrete type the value is of, trait objects are
[dynamically sized types]. Like all
<abbr title="dynamically sized types">DSTs</abbr>, trait objects are used
Expand Down Expand Up @@ -109,6 +101,5 @@ inferred with a sensible choice.
[auto traits]: ../special-types-and-traits.md#auto-traits
[defaults]: ../lifetime-elision.md#default-trait-object-lifetimes
[dynamically sized types]: ../dynamically-sized-types.md
[issue 33140]: https://github.com/rust-lang/rust/issues/33140
[object safe]: ../items/traits.md#object-safety
[supertraits]: ../items/traits.md#supertraits