Skip to content

instantiating an opaque with another opaque stops being an error #29

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

Open
lcnr opened this issue Jun 6, 2023 · 0 comments
Open

instantiating an opaque with another opaque stops being an error #29

lcnr opened this issue Jun 6, 2023 · 0 comments

Comments

@lcnr
Copy link
Contributor

lcnr commented Jun 6, 2023

#![feature(type_alias_impl_trait)]

type Tait = impl Sized;
type Tait2 = impl Sized;

fn mk<T>() -> T { todo!() }

fn main() {
    let x: Tait = 1u32;
    let y: Tait2 = x;
}

cc rust-lang/rust#112076

the current solver intentionally hard errors when it encounters this situation https://github.com/rust-lang/rust/blob/fd9bf594366e73efb1a26a023e0b4de8eff82b94/compiler/rustc_infer/src/infer/opaque_types.rs#L152-L167

the behavior feels fairly straightforward and how I'd expect it to happen, so this is fine to me

@lcnr lcnr changed the title instantiating TAIT with another TAIT stops being an error instantiating an opaque with another opaque stops being an error Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant