-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Rustdoc should show which marker traits a type implements #17606
Comments
cc #13231 (this is one of the motivating reasons for opt-in built-in bounds.) |
Will this simply fall out naturally from OIBIT? |
Now that |
OIBITs didn't solve this. Well, it solved it for |
Nominating. I really think this needs to be fixed. Not having |
I think the easiest solution is to walk all the impls for the type and check whether !Sized or !Share are among them. If not, synthesize a positive impl for documentation purposes. — On Sat, Apr 11, 2015 at 4:22 PM, Kevin Ballard notifications@github.com
|
Not 1.0; P-low. (Also, not clear how to solve this, since most of the time the presence/absence of an impl is dependent on the particular type parameters you are instantiated with.) |
Hm, I would prefer P-medium here; I think this is a very important piece of documentation to provide. |
As an additional urge to boost the priority on this: as someone who has been learning Rust, this is still super bewildering for Copy. i32 and i64 both implement Copy (as far as I can tell), but https://doc.rust-lang.org/nightly/std/primitive.i32.html and https://doc.rust-lang.org/std/marker/trait.Copy.html don't list the integer types as being copy-able. This is mostly confusing when I'm trying to explain to other people the difference between a type which implements move semantics and a type which implements copy semantics; some of the core types don't expose their underlying behavior in the documentation. |
So it looks like @jonathandturner, if you wanted to do some rustdoc hacking, fixing the issue around |
Still an issue. |
Worth mention this issue: #33772 Not directly related, but remotely similar |
Note that !Sync doesn't yet show up in docs because of rust-lang/rust#17606.
My issue has been closed as a dupe of this one, so let me add that implemented kinds are not the only missing bit of information: Other things that rustdoc should show include variance of lifetime/type parameters and whether type parameters appear only below a pointer indirection (the latter being relevant for recursive types). |
I'd like to work on this. |
I wasted a reasonable amount of time today because I thought some type wasn't Send + Sync because rustdoc did not show this to me :/ |
Thanks to #47833 this issue is now resolved! Starting in tomorrow's nightly docs, there will be a new "Auto Trait Implementations" section showing off under what conditions a type impls Send or Sync. |
Great work on this! I’ve been waiting for this feature for a while now. :-) |
I don't think there's any way right now to find out if some type is e.g.
Sync
without trying to compile code that depends on it.The text was updated successfully, but these errors were encountered: