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

where T: ?Sized is not supported #37275

Closed
glandium opened this issue Oct 19, 2016 · 1 comment
Closed

where T: ?Sized is not supported #37275

glandium opened this issue Oct 19, 2016 · 1 comment

Comments

@glandium
Copy link
Contributor

Rust documentation apparently normalizes all generics to use the form where ...., which leads to constructs such as:

pub trait AsRef<T> where T: ?Sized

(from https://doc.rust-lang.org/std/convert/trait.AsRef.html)

except that's not valid Rust:

error: unexpected `?`

The valid form is:

pub trait AsRef<T: ?Sized>

Either the where form for ?Sized should be supported, or the documentation generator shouldn't normalize them. Either way is fine (although for consistency, it would seem the former would be better than the latter), but the current status quo is just confusing: you sometimes don't pick up valid syntax from the documentation.

@bluss
Copy link
Member

bluss commented Oct 19, 2016

Existing issue for Sized in where clauses: #20503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants