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

Improve "defining opaque type use does not fully define opaque type" error message #66723

Closed
varkor opened this issue Nov 24, 2019 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. 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

@varkor
Copy link
Member

varkor commented Nov 24, 2019

See https://github.com/rust-lang/rust/pull/66178/files#r344249868.

@varkor varkor added A-diagnostics Area: Messages for errors, warnings, and lints F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` labels Nov 24, 2019
@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 25, 2019
@nikomatsakis
Copy link
Contributor

Example test:

#![feature(min_type_alias_impl_trait)]

type Foo = impl Copy;

enum Wrapper<T> {
    First(T),
    Second
}

fn produce() -> Wrapper<Foo> {
    Wrapper::First((22, Default::default()))
}

Outputs:

error[E0283]: type annotations needed
  --> src/lib.rs:11:25
   |
11 |     Wrapper::First((22, Default::default()))
   |                         ^^^^^^^^^^^^^^^^ cannot infer type
   |
   = note: cannot satisfy `_: Default`
   = note: required by `std::default::Default::default`

This seems ok. I'm not sure how we get to that code otherwise. I'm going to close the issue as "good enough".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. 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

No branches or pull requests

4 participants