Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/71036.rs: fixed with errors #365

Merged
merged 1 commit into from
May 15, 2020
Merged

ices/71036.rs: fixed with errors #365

merged 1 commit into from
May 15, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#71036

#![feature(unsize, dispatch_from_dyn)]

use std::marker::Unsize;
use std::ops::DispatchFromDyn;

struct Inner<'a, T: ?Sized> {
    value: &'a T,
}

impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Inner<'a, U>> for Inner<'a, T> {}

impl<'a, T: ?Sized> Inner<'a, T> {
    fn new(value: &'a T) -> Inner<'a, T> {
        Inner { value }
    }
}

pub struct Local<'a, T: ?Sized> {
    inner: &'a Inner<'a, T>,
}

impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Local<'a, U>> for Local<'a, T> {}

impl<'a, T: ?Sized> Local<'a, T> {
    fn new(inner: &'a Inner<'a, T>) -> Local<'a, T> {
        Local { inner }
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0277]: the trait bound `&'a T: std::marker::Unsize<&'a U>` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/71036.rs:22:1
   |
22 | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Local<'a, U>> for Local<'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 Inner<'a, U>>` for `&'a Inner<'a, T>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error[E0277]: the trait bound `&'a T: std::marker::Unsize<&'a U>` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/71036.rs:22:1
   |
22 | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Local<'a, U>> for Local<'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 Inner<'a, U>>` for `&'a Inner<'a, T>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit d4e6bd6 into master May 15, 2020
@Alexendoo Alexendoo deleted the autofix/ices/71036.rs branch May 15, 2020 13:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants