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

Combination of TAIT and ATB does not allow projection (unsatisfied bound) #63591

Closed
Centril opened this issue Aug 15, 2019 · 0 comments · Fixed by #81485
Closed

Combination of TAIT and ATB does not allow projection (unsatisfied bound) #63591

Centril opened this issue Aug 15, 2019 · 0 comments · Fixed by #81485
Labels
C-bug Category: This is a bug. F-associated_type_bounds `#![feature(associated_type_bounds)]` F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Centril
Copy link
Contributor

Centril commented Aug 15, 2019

This should pass but does not:

// check-pass

#![feature(associated_type_bounds)]
#![feature(type_alias_impl_trait)]

fn main() {}

trait Bar { type Assoc; }

trait Thing {
    type Out;
    fn func() -> Self::Out;
}

struct AssocIsCopy;
impl Bar for AssocIsCopy { type Assoc = u8; }

impl Thing for AssocIsCopy {
    type Out = impl Bar<Assoc: Copy>;

    fn func() -> Self::Out {
        AssocIsCopy
        //~^ ERROR the trait bound `<AssocIsCopy as Bar>::Assoc: std::marker::Copy` is not satisfied
    }
}

cc @alexreg @varkor @nikomatsakis

@Centril Centril added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` F-associated_type_bounds `#![feature(associated_type_bounds)]` labels Aug 15, 2019
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 2, 2021
Add some tests for associated-type-bounds issues

Closes rust-lang#38917
Closes rust-lang#40093
Closes rust-lang#43475
Closes rust-lang#63591

rust-lang#47897 is likely closable too, but it needs an MCVE
~~rust-lang#38917, rust-lang#40093, rust-lang#43475, rust-lang#47897 all are mislabeled and shouldn't have the `F-associated-type-bounds` label~~

~~rust-lang#71685 is also mislabeled as commented on in that thread~~
@bors bors closed this as completed in a61e6ab Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-associated_type_bounds `#![feature(associated_type_bounds)]` F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Development

Successfully merging a pull request may close this issue.

1 participant