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

rustdoc: Fn trait sugar output types are broken for inlined signatures #21801

Closed
tomjakubowski opened this issue Jan 31, 2015 · 3 comments
Closed
Assignees
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-medium Medium priority T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Milestone

Comments

@tomjakubowski
Copy link
Contributor

For example, see: http://doc.rust-lang.org/std/collections/struct.Bitv.html#method.from_fn

fn from_fn<F>(len: usize, f: F) -> Bitv 
where F: FnMut(usize), <F as FnMut(usize)>::Output == bool

Should look like:

fn from_fn<F>(len: usize, f: F) -> Bitv 
where F: FnMut(usize) -> bool

This is because of the change to use associated types for the output.

@tomjakubowski
Copy link
Contributor Author

Specifically, this:

ac94ae5#diff-6ad072c1ebc79b7620832915f2323d55R550

Like all "resugaring" of projection predicates, rustdoc will need to merge the F: Fn(usize) and <F as FnMut(usize)>::Output == bool bounds into one, which will likely mean an extra step when cleaning ty::Generics, after cleaning the individual ty::Predicates in the predicates field.

@tomjakubowski
Copy link
Contributor Author

I can't nominate issues but I think this is crucial for 1.0 because of the pervasive use of closures in the standard library. Rendering Fn trait bounds this way all over the standard library documentation is not going to do Rust any PR favors.

@sfackler sfackler added I-nominated T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 1, 2015
@brson brson added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Feb 5, 2015
@pnkfelix
Copy link
Member

pnkfelix commented Feb 5, 2015

1.0 polish

@pnkfelix pnkfelix added the P-medium Medium priority label Feb 5, 2015
@pnkfelix pnkfelix added this to the 1.0 milestone Feb 5, 2015
@emberian emberian self-assigned this Mar 26, 2015
@alexcrichton alexcrichton assigned alexcrichton and unassigned emberian Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-medium Medium priority T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants