Skip to content

rustdoc reports error twice for ambiguous (inherent) associated type #88593

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
camelid opened this issue Sep 2, 2021 · 0 comments · Fixed by #89907
Closed

rustdoc reports error twice for ambiguous (inherent) associated type #88593

camelid opened this issue Sep 2, 2021 · 0 comments · Fixed by #89907
Labels
A-associated-items Area: Associated items (types, constants & functions) C-bug Category: This is a bug. F-inherent_associated_types `#![feature(inherent_associated_types)]` requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented Sep 2, 2021

#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

pub struct Struct;

impl Struct {
    pub type AssocTy = usize;
    pub const AssocConst: Self::AssocTy = 42;
}

rustc only emits the error once, but rustdoc emits it twice. rustdoc output:

error[E0223]: ambiguous associated type
  --> $DIR/ambiguous-inherent-assoc-ty.rs:11:27
   |
LL |     pub const AssocConst: Self::AssocTy = 42;
   |                           ^^^^^^^^^^^^^ help: use fully-qualified syntax: `<Struct as Trait>::AssocTy`

error[E0223]: ambiguous associated type
  --> $DIR/ambiguous-inherent-assoc-ty.rs:11:27
   |
LL |     pub const AssocConst: Self::AssocTy = 42;
   |                           ^^^^^^^^^^^^^ help: use fully-qualified syntax: `<Struct as Trait>::AssocTy`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0223`.

cc #88573

@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-associated-items Area: Associated items (types, constants & functions) C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. F-inherent_associated_types `#![feature(inherent_associated_types)]` labels Sep 2, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Oct 16, 2021
…s, r=camelid

Remove FIXME since there is nothing to be fixed

Resolves rust-lang#88593.

The errors are deduplicated when displayed to users. They only appear
multiple times in UI tests.

cc `@jyn514`
r? `@camelid`
@bors bors closed this as completed in c393f33 Oct 17, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) C-bug Category: This is a bug. F-inherent_associated_types `#![feature(inherent_associated_types)]` requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant