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

Negative impls are incorrectly mentioned as positive in help messages #74382

Closed
lcnr opened this issue Jul 15, 2020 · 1 comment
Closed

Negative impls are incorrectly mentioned as positive in help messages #74382

lcnr opened this issue Jul 15, 2020 · 1 comment
Labels
C-bug Category: This is a bug. D-confusing Diagnostics: Confusing error or lint that should be reworked. F-negative_impls #![feature(negative_impls)] requires-nightly This issue requires a nightly compiler in some way.

Comments

@lcnr
Copy link
Contributor

lcnr commented Jul 15, 2020

#![feature(optin_builtin_traits)]
#![feature(negative_impls)]

auto trait Foo {}

impl !Foo for () {}

fn test<T: Foo>() {}

fn main() {
    test::<()>();
}

Results in the following error:

error[E0277]: the trait bound `(): Foo` is not satisfied
  --> src/main.rs:11:12
   |
8  | fn test<T: Foo>() {}
   |            --- required by this bound in `test`
...
11 |     test::<()>();
   |            ^^ the trait `Foo` is not implemented for `()`
   |
   = help: the following implementations were found:
             <() as Foo>

The given help here is incorrect.

@lcnr lcnr added C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. D-confusing Diagnostics: Confusing error or lint that should be reworked. F-negative_impls #![feature(negative_impls)] labels Jul 15, 2020
@lcnr
Copy link
Contributor Author

lcnr commented Jul 15, 2020

Ah, this is a duplicate of #70849

@lcnr lcnr closed this as completed Jul 15, 2020
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. D-confusing Diagnostics: Confusing error or lint that should be reworked. F-negative_impls #![feature(negative_impls)] requires-nightly This issue requires a nightly compiler in some way.
Projects
None yet
Development

No branches or pull requests

1 participant