-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 6 pull requests #48307
Rollup of 6 pull requests #48307
Commits on Feb 1, 2018
-
Generate documentation for auto-trait impls
A new section is added to both both struct and trait doc pages. On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync. On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library. Synthesized impls for a particular auto trait ('synthetic impls') take into account generic bounds. For example, a type 'struct Foo<T>(T)' will have 'impl<T> Send for Foo<T> where T: Send' generated for it. Manual implementations of auto traits are also taken into account. If we have the following types: 'struct Foo<T>(T)' 'struct Wrapper<T>(Foo<T>)' 'unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow Then Wrapper will have the following impl generated: 'impl<T> Send for Wrapper<T>' reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls However, if a type can *never* implement a particular auto trait (e.g. 'struct MyStruct<T>(*const T)'), then a negative impl will be generated (in this case, 'impl<T> !Send for MyStruct<T>') All of this means that a user should be able to copy-paste a synthetic impl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
Configuration menu - View commit details
-
Copy full SHA for 0ad7ff4 - Browse repository at this point
Copy the full SHA 0ad7ff4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14534ff - Browse repository at this point
Copy the full SHA 14534ffView commit details
Commits on Feb 10, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 4d8b73d - Browse repository at this point
Copy the full SHA 4d8b73dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 764a830 - Browse repository at this point
Copy the full SHA 764a830View commit details
Commits on Feb 15, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 16c1a1e - Browse repository at this point
Copy the full SHA 16c1a1eView commit details
Commits on Feb 16, 2018
-
Configuration menu - View commit details
-
Copy full SHA for e067470 - Browse repository at this point
Copy the full SHA e067470View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9c75a8 - Browse repository at this point
Copy the full SHA e9c75a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1713c22 - Browse repository at this point
Copy the full SHA 1713c22View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e27aa8 - Browse repository at this point
Copy the full SHA 6e27aa8View commit details
Commits on Feb 17, 2018
-
Configuration menu - View commit details
-
Copy full SHA for c8f206f - Browse repository at this point
Copy the full SHA c8f206fView commit details -
Wording fixes from review for File.
Alexis Hunt committedFeb 17, 2018 Configuration menu - View commit details
-
Copy full SHA for ec90597 - Browse repository at this point
Copy the full SHA ec90597View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01a70c6 - Browse repository at this point
Copy the full SHA 01a70c6View commit details -
Add a span field to Visibility::Restricted
This span covers the whole visibility expression: e.g. `pub (in path)`.
Configuration menu - View commit details
-
Copy full SHA for 0bddba9 - Browse repository at this point
Copy the full SHA 0bddba9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d6bdf29 - Browse repository at this point
Copy the full SHA d6bdf29View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5099a7 - Browse repository at this point
Copy the full SHA b5099a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 291c51b - Browse repository at this point
Copy the full SHA 291c51bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e9fa57 - Browse repository at this point
Copy the full SHA 8e9fa57View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e46927 - Browse repository at this point
Copy the full SHA 8e46927View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4452446 - Browse repository at this point
Copy the full SHA 4452446View commit details -
Rollup merge of rust-lang#47799 - topecongiro:fix-span-of-visibility,…
… r=petrochenkov Fix span of visibility This PR 1. adds a closing parenthesis to the span of `Visibility::Crate` (e.g. `pub(crate)`). The current span only covers `pub(crate`. 2. adds a `span` field to `Visibility::Restricted`. This span covers the entire visibility expression (e.g. `pub (in self)`). Currently all we can have is a span for `Path`. This PR is motivated by the bug found in rustfmt (rust-lang/rustfmt#2398). The first change is a strict improvement IMHO. The second change may not be desirable, as it adds a field which is currently not used by the compiler.
Configuration menu - View commit details
-
Copy full SHA for 4aedf27 - Browse repository at this point
Copy the full SHA 4aedf27View commit details -
Rollup merge of rust-lang#47833 - Aaron1011:final_auto_trait, r=Guill…
…aumeGomez,QuietMisdreavus Generate documentation for auto-trait impls A new section is added to both both struct and trait doc pages. On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync. ![Auto trait implementations for Cloned](https://i.imgur.com/XtTV6IJ.png) On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library. ![Auto trait implementors for Send](https://i.imgur.com/3GRBpTy.png) Synthesized impls for a particular auto trait ('synthetic impls') take generic bounds into account. For example, a type ```rust struct Foo<T>(T) ``` will have 'impl<T> Send for Foo<T> where T: Send' generated for it. Manual implementations of auto traits are also taken into account. If we have the following types: ```rust struct Foo<T>(T) struct Wrapper<T>(Foo<T>) unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow ``` Then Wrapper will have the following impl generated: ```rust impl<T> Send for Wrapper<T> ``` reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls: ![A ridiculous demonstration type](https://i.imgur.com/TkZMWuN.png) However, if a type can *never* implement a particular auto trait (e.g. `struct MyStruct<T>(*const T)`), then a negative impl will be generated (in this case, `impl<T> !Send for MyStruct<T>`) All of this means that a user should be able to copy-paste a syntheticimpl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
Configuration menu - View commit details
-
Copy full SHA for 79e5bd5 - Browse repository at this point
Copy the full SHA 79e5bd5View commit details -
Rollup merge of rust-lang#48194 - GuillaumeGomez:doc-test-command, r=…
…Mark-Simulacrum Doc test command r? @Mark-Simulacrum
Configuration menu - View commit details
-
Copy full SHA for 6078dc2 - Browse repository at this point
Copy the full SHA 6078dc2View commit details -
Rollup merge of rust-lang#48273 - alercah:file-warning, r=joshtriplett
Add a warning to File about mutability. Fixes rust-lang#47708.
Configuration menu - View commit details
-
Copy full SHA for c67a636 - Browse repository at this point
Copy the full SHA c67a636View commit details -
Rollup merge of rust-lang#48275 - matthiaskrgr:codespell, r=kennytm,v…
…arkor fix more typos found by codespell.
Configuration menu - View commit details
-
Copy full SHA for bc7d9c7 - Browse repository at this point
Copy the full SHA bc7d9c7View commit details -
Rollup merge of rust-lang#48282 - Centril:spelling-fix/iter-repeat-wi…
…th, r=kennytm Fix spelling in core::iter::repeat_with: s/not/note Fixes spelling error in rust-lang#48156 (comment). Tracking issue: rust-lang#48169
Configuration menu - View commit details
-
Copy full SHA for 1825fbe - Browse repository at this point
Copy the full SHA 1825fbeView commit details