8000 Rollup of 9 pull requests by Dylan-DPC-zz · Pull Request #69652 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 9 pull requests #69652

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

Closed
wants to merge 19 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6f568e7
miri engine: turn some debug_assert into assert
RalfJung Feb 28, 2020
5982e9d
downgrade some assertions to debug_ again
RalfJung Feb 29, 2020
275dac7
doc(librustc_error_codes): add long error explanation for E0719
thekuom Mar 1, 2020
99a595e
Fix a leak in `DiagnosticBuilder::into_diagnostic`.
nnethercote Mar 2, 2020
4643b12
Update my mailmap entry
XAMPPRocky Mar 2, 2020
ba49ed0
clean up E0378 explanation
GuillaumeGomez Mar 2, 2020
0ec1408
Don't convert Results to Options just for matching.
matthiaskrgr Mar 1, 2020
fdc14cb
Toolstate: don't duplicate nightly tool list.
ehuss Mar 2, 2020
4281fe0
Update books
ehuss Mar 2, 2020
d8e3557
Remove `usable_size` APIs
TimDiekmann Mar 2, 2020
f53764a
Rollup merge of #69565 - RalfJung:assert, r=eddyb
Dylan-DPC Mar 3, 2020
d198d60
Rollup merge of #69609 - TimDiekmann:excess, r=Amanieu
Dylan-DPC Mar 3, 2020
1eb9857
Rollup merge of #69620 - thekuom:doc/61137-add-long-error-code-e0719,…
Dylan-DPC Mar 3, 2020
28e4c7a
Rollup merge of #69626 - ehuss:toolstate-nightly-cleanup, r=Mark-Simu…
Dylan-DPC Mar 3, 2020
6a07f16
Rollup merge of #69628 - nnethercote:fix-DiagnosticBuilder-into_diagn…
Dylan-DPC Mar 3, 2020
473c7a8
Rollup merge of #69633 - XAMPPRocky:master, r=Dylan-DPC
Dylan-DPC Mar 3, 2020
11ff6dd
Rollup merge of #69634 - GuillaumeGomez:clean-up-e0378, r=Dylan-DPC
Dylan-DPC Mar 3, 2020
917ecab
Rollup merge of #69637 - matthiaskrgr:if_let_some_result, r=ecstatic-…
Dylan-DPC Mar 3, 2020
284cd89
Rollup merge of #69641 - ehuss:update-books, r=ehuss
Dylan-DPC Mar 3, 2020
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
42 changes: 22 additions & 20 deletions src/librustc_error_codes/error_codes/E0378.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
The `DispatchFromDyn` trait was implemented on something which is not a pointer
or a newtype wrapper around a pointer.

Erroneous code example:

```compile-fail,E0378
#![feature(dispatch_from_dyn)]
use std::ops::DispatchFromDyn;

struct WrapperExtraField<T> {
ptr: T,
extra_stuff: i32,
}

impl<T, U> DispatchFromDyn<WrapperExtraField<U>> for WrapperExtraField<T>
where
T: DispatchFromDyn<U>,
{}
```

The `DispatchFromDyn` trait currently can only be implemented for
builtin pointer types and structs that are newtype wrappers around them
— that is, the struct must have only one field (except for`PhantomData`),
and that field must itself implement `DispatchFromDyn`.

Examples:

```
#![feature(dispatch_from_dyn, unsize)]
use std::{
Expand All @@ -20,6 +38,8 @@ where
{}
```

Another example:

```
#![feature(dispatch_from_dyn)]
use std::{
Expand All @@ -37,21 +57,3 @@ where
T: DispatchFromDyn<U>,
{}
```

Example of illegal `DispatchFromDyn` implementation
(illegal because of extra field)

```compile-fail,E0378
#![feature(dispatch_from_dyn)]
use std::ops::DispatchFromDyn;

struct WrapperExtraField<T> {
ptr: T,
extra_stuff: i32,
}

impl<T, U> DispatchFromDyn<WrapperExtraField<U>> for WrapperExtraField<T>
where
T: DispatchFromDyn<U>,
{}
```
0