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

Weird interaction between higher-ranked lifetimes and associated type bounds #23481

Open
apasel422 opened this Issue Mar 18, 2015 · 2 comments

Comments

Projects
None yet
4 participants
@apasel422
Copy link
Member

apasel422 commented Mar 18, 2015

foo.rs:

pub trait Foo
where
    for<'a> &'a Self: Bar,
    for<'a> <&'a Self as Bar>::Xyz: Clone {}

pub trait Bar {
    type Xyz;
}

impl Foo for () {}

impl<'a> Bar for &'a () {
    type Xyz = usize;
}

Error from rustc 1.0.0-nightly (30e1f9a1c 2015-03-14) (built 2015-03-15)

foo.rs:12:1: 12:19 error: the trait `for<'a> core::clone::Clone` is not implemented for the type `<&'a () as Bar>::Xyz` [E0277]
foo.rs:12 impl Foo for () {}
          ^~~~~~~~~~~~~~~~~~

@huonw huonw changed the title Weird interaction between higher-kinded lifetimes and associated type bounds Weird interaction between higher-ranked lifetimes and associated type bounds Nov 23, 2015

@brson

This comment has been minimized.

Copy link
Contributor

brson commented May 4, 2017

Current error



rustc 1.17.0 (56124baa9 2017-04-24)
error[E0277]: the trait bound `for<'a> <&'a () as Bar>::Xyz: std::clone::Clone` is not satisfied
  --> <anon>:10:6
   |
10 | impl Foo for () {}
   |      ^^^ the trait `for<'a> std::clone::Clone` is not implemented for `<&'a () as Bar>::Xyz`
   |
   = help: the following implementations were found:
             <&'a T as std::clone::Clone>
   = note: required by `Foo`

error: aborting due to previous error

Compilation failed.
@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Sep 24, 2018

Triage: no change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.