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

make rustdoc show whether types are affine, Send and/or Freeze #10431

Closed
thestinger opened this issue Nov 11, 2013 · 3 comments
Closed

make rustdoc show whether types are affine, Send and/or Freeze #10431

thestinger opened this issue Nov 11, 2013 · 3 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@thestinger
Copy link
Contributor

It's not possible to tell whether a type is going to have move semantics or Send/Freeze without looking into each layer of the potentially private implementation details.

@thestinger
Copy link
Contributor Author

cc @alexcrichton

@alexcrichton
Copy link
Member

I don't think that this would be too hard to do. There's a few tough parts about this though:

  • What information is shown for generic types? (how do display all of it)
  • This would involve building a cache of information that's sendable because the tcx is destroyed after compilation (it's not sendable across tasks).

I would imagine this would just query all types ahead of time and then place little badges on the relevant pages about what qualities the type has (although again, with generics I'm not sure how this would work).

@alexcrichton
Copy link
Member

Closing in favor of RFC #3 (opt-in builtin traits). When opting in, you'll have to have impl Send for ... somewhere, and the Send trait will show up in the "Implemented Traits" section of the documentation.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 2, 2023
Improve pattern printing for manual_let_else

* Address a formatting issue pointed out in https://github.com/rust-lang/rust-clippy/pull/10175/files#r1137091002
* Replace variables inside | patterns in the if let: `let v = if let V::A(v) | V::B(v) = v { v } else ...`
* Support nested patterns: `let v = if let Ok(Ok(Ok(v))) = v { v } else ...`
* Support tuple structs with more than one arg: `let v = V::W(v, _) = v { v } else ...`; note that more than one *capture* is still not supported, so it bails for `let (v, w) = if let E::F(vi, wi) = x { (vi, wi)}`
* Correctly handle .. in tuple struct patterns: `let v = V::X(v, ..) = v { v } else ...`

- \[ ] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[ ] Executed `cargo dev update_lints`
- \[ ] Added lint documentation
- \[x] Run `cargo dev fmt`

[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints

---

changelog: [`manual_let_else`]: improve variable name in suggestions

Closes rust-lang#10431 as this PR is adding a test for the `mut` case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants