diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-05-14 18:21:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-14 18:21:59 +0200 |
| commit | 7b5bc61e99ea77ff87233295fc3e789e43dd66f0 (patch) | |
| tree | b64230280cd4a445e65ae665e0097b548e9c3989 /src/test/rustdoc-js-std/string-from_ut.js | |
| parent | d7f5e56498bffa50813fbdd34623501c8f5b0a5c (diff) | |
| parent | f6aa161936887bf4a0aaebbd5cfc743132a1ab0b (diff) | |
| download | rust-7b5bc61e99ea77ff87233295fc3e789e43dd66f0.tar.gz rust-7b5bc61e99ea77ff87233295fc3e789e43dd66f0.zip | |
Rollup merge of #72194 - doctorn:dispatch-from-dyn-ice, r=estebank
Don't ICE on missing `Unsize` impl
Previously code of the form
```rust
#![feature(unsize, dispatch_from_dyn)]
use std::marker::Unsize;
use std::ops::DispatchFromDyn;
pub struct Foo<'a, T: ?Sized> {
_inner: &'a &'a T,
}
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {}
```
would generate an ICE due to the missing `Unsize` impl being run through the `suggest_change_mut` suggestion. This PR adds an early exit and a pointer to the appropriate docs regarding `Unsize` instead:
```
error[E0277]: the trait bound `&'a T: std::marker::Unsize<&'a U>` is not satisfied
--> src/test/ui/issues/issue-71036.rs:11:1
|
11 | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unsize<&'a U>` is not implemented for `&'a T`
|
= note: all implementations of `Unsize` are provided automatically by the compiler, see <https://doc.rust-lang.org/stable/std/marker/trait.Unsize.html> for more information
= note: required because of the requirements on the impl of `std::ops::DispatchFromDyn<&'a &'a U>` for `&'a &'a T`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
```
r? @estebank
Resolves #71036
Diffstat (limited to 'src/test/rustdoc-js-std/string-from_ut.js')
0 files changed, 0 insertions, 0 deletions
