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

Incorrect signature in documentation for implementation of generic alias #111420

Closed
drewcassidy opened this issue May 10, 2023 · 0 comments · Fixed by #111448
Closed

Incorrect signature in documentation for implementation of generic alias #111420

drewcassidy opened this issue May 10, 2023 · 0 comments · Fixed by #111448
Assignees
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@drewcassidy
Copy link

drewcassidy commented May 10, 2023

I tried this code:

// Cross Product
impl<T: Copy> Vector<T, 3> {
   // ✂️ snip ✂️ 
}

where Vector is

pub type Vector<T, const N: usize> = Matrix<T, N, 1>;

In the cargo doc output, this shows impl<T: Copy> Matrix<T, N, 1> even though N no longer exists in this context, its been concretized to 3
image

If I change the implementation to use Matrix instead of the Vector alias, I see what I would expect. no more N

image

Project is here, with the specific impl here

Meta

rustc --version --verbose:

rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: aarch64-apple-darwin
release: 1.69.0
LLVM version: 15.0.7

Backtrace

I don't seem to get anything and I don't know why

@drewcassidy drewcassidy added the C-bug Category: This is a bug. label May 10, 2023
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 10, 2023
@compiler-errors compiler-errors self-assigned this May 10, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 11, 2023
…, r=notriddle

Use proper impl self type for alias impl in rustdoc

We don't want to use `type_of(type_alias)`, we want to use `type_of(impl)` -- this will give us the self type of the impl *properly substituted* in the case that it's an alias.

Fixes rust-lang#111420
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. 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.

3 participants