-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 9 pull requests #104489
Rollup of 9 pull requests #104489
Commits on Nov 12, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d7152f8 - Browse repository at this point
Copy the full SHA d7152f8View commit details -
Update compiler/rustc_codegen_llvm/src/llvm_util.rs
Co-authored-by: Jubilee <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1122400 - Browse repository at this point
Copy the full SHA 1122400View commit details
Commits on Nov 15, 2022
-
Issue error when
-C link-self-contained
option is used on unsupport……ed platforms Document supported targets for `-C link-self-contained` Move `LinkSelfContainedDefault::True` from wasm_base to wasm32_wasi
Configuration menu - View commit details
-
Copy full SHA for 0b6dce4 - Browse repository at this point
Copy the full SHA 0b6dce4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83cc620 - Browse repository at this point
Copy the full SHA 83cc620View commit details -
Configuration menu - View commit details
-
Copy full SHA for 44c4a7b - Browse repository at this point
Copy the full SHA 44c4a7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c3c3719 - Browse repository at this point
Copy the full SHA c3c3719View commit details -
Configuration menu - View commit details
-
Copy full SHA for e694ef5 - Browse repository at this point
Copy the full SHA e694ef5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e656883 - Browse repository at this point
Copy the full SHA e656883View commit details -
Configuration menu - View commit details
-
Copy full SHA for d06aac1 - Browse repository at this point
Copy the full SHA d06aac1View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2fbd01 - Browse repository at this point
Copy the full SHA e2fbd01View commit details -
Only do parser recovery on retried macro matching
This prevents issues with eager parser recovery during macro matching.
Configuration menu - View commit details
-
Copy full SHA for b7b6722 - Browse repository at this point
Copy the full SHA b7b6722View commit details -
rustdoc: remove unused JS IIFE from main.js
This [IIFE] made sense when it was added in f0683f9 and there was a local variable scoped to it, but now it only sets two globals, so it does nothing. [IIFE]: https://developer.mozilla.org/en-US/docs/Glossary/IIFE "immediately invoked function expression"
Configuration menu - View commit details
-
Copy full SHA for 5649cbb - Browse repository at this point
Copy the full SHA 5649cbbView commit details -
rustdoc: remove pointless CSS
.rightside { padding-right: 2px }
This CSS was added in 34bd2b8, as `.since { padding-right: 2px }`, to prevent it from uncomfortably touching the srclink, which was a separate floated element. It was carried forward with 962c0a4 to the new `.rightside`, but its role was replaced with adding " • " between them. All it does now is pushes the element 2px away from the page's right margin. Removing this rule changes the page layout, but you have to look for it to notice it.
Configuration menu - View commit details
-
Copy full SHA for 74969ac - Browse repository at this point
Copy the full SHA 74969acView commit details -
Add the
#[manually_drop]
attribute.This attribute is equivalent to `#[lang = "manually_drop"]`, and the behavior of both are extended to allow the type to define `Drop`, in which case, that will still be run. Only the field drop glue is suppressed. This PR should essentially fully implement rust-lang#100344. Some additional notes: `#[manually_drop]` means "do not destroy the fields automatically during destruction". `ManuallyDrop`, is (or could be) "just" `#[manually_drop] struct ManuallyDrop<T>(T);`. The intent is, per the MCP, to allow customization of the drop order, without making the interface for initializing or accessing the fields of the struct clumsier than a normal Rust type. It also -- and people did seem excited about this part -- lifts `ManuallyDrop` from being a special language supported feature to just another user of `#[manually_drop]`. There is the question of how this interacts with "insignificant" drop. I had trouble understanding the comments, but insignificant drop appears to just be a static analysis tool, and not something that changes behavior. (For example, it's used to detect if a language change will reorder drops in a meaningful way -- meaning, reorder the significant drops, not the insignificant ones.) Since it's unlikely to be used for `#[manually_drop]` types, I don't think it matters a whole lot. And where a destructor is defined, it would seem to make sense for `#[manually_drop]` types to match exactly the behavior of `union`, since they both have the shared property that field drop glue is suppressed. I looked for all locations that queried for `is_manually_drop` in any form, and found two difficult cases which are hardcoded for `ManuallyDrop` in particular. The first is a clippy lint for redundant clones. I don't understand why it special-cases `ManuallyDrop`, and it's almost certainly wrong for it to special-case `#[manually_drop]` types in general. However, without understanding the original rationale, I have trouble figuring the right fix. Perhaps it should simply be deleted altogether. The second is unions -- specifically, the logic for disabling `DerefMut`. `my_union.x.y = z` will automatically dereference `my_union.x` if it implements `DerefMut`, unless it is `ManuallyDrop`, in which case it will not. This is because `ManuallyDrop` is a pointer back to its content, and so this will automatically call `drop` on a probably uninitialized field, and is unsafe. This is true of `ManuallyDrop`, but not necessarily any other `#[manually_drop]` type. I believe the correct fix would, instead, be a way to mark and detect types which are a smart pointer whose pointee is within `self`. See, for example, this playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=76fb22a6214ce453538fc18ec35a839d But that needs to wait for a separate RFC. For now, we apply exactly the same restriction for `ManuallyDrop` and for any other `#[manually_drop]` type, even though it may be confusing. 1. Delete `#[lang = "manually_drop"]`. I'm not sure if anything special needs to be done here other than replacing it with `#[manually_drop]` -- is there a compatibility guarantee that must be upheld? 2. (Optional) Fix the redundant clone check to correctly handle `#[manually_drop]` structs that aren't `ManuallyDrop`. 3. When there is more experience with the feature (e.g. in Crubit) create a full RFC based on the MCP, and go through the remainder of the stabilization process. (Also, do things like generalize the union error messages to not specifically mention `ManuallyDrop`, but also mention `#[manually_drop]`. For as long as the feature is unstable, the error messages would be confusing if they referenced it...)
Configuration menu - View commit details
-
Copy full SHA for 416d642 - Browse repository at this point
Copy the full SHA 416d642View commit details -
Replace manually_drop lang item with attribute.
Co-authored-by: lcnr <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ff7e441 - Browse repository at this point
Copy the full SHA ff7e441View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ae611d - Browse repository at this point
Copy the full SHA 5ae611dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 13bc9c9 - Browse repository at this point
Copy the full SHA 13bc9c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 46b6233 - Browse repository at this point
Copy the full SHA 46b6233View commit details -
rustdoc: remove no-op CSS
#crate-search-div { display: inline-block }
`#crate-search-div` is nested directly below `.search-results-title`, which has `display: inline-flex`. This makes the crate-search-div a [flex item], which makes its display property irrelevant, because flex items have their display [blockified] in any case. [flex item]: https://developer.mozilla.org/en-US/docs/Glossary/Flex_Item [blockified]: https://www.w3.org/TR/css-flexbox-1/#flex-items
Configuration menu - View commit details
-
Copy full SHA for 7854883 - Browse repository at this point
Copy the full SHA 7854883View commit details
Commits on Nov 16, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 1115ec6 - Browse repository at this point
Copy the full SHA 1115ec6View commit details -
Rollup merge of rust-lang#101586 - ssbr:master, r=lcnr
Add the `#[manually_drop]` attribute. This attribute is equivalent to `#[lang = "manually_drop"]`, and the behavior of both are extended to allow the type to define `Drop`, in which case, that will still be run. Only the field drop glue is suppressed. This PR should essentially fully implement rust-lang#100344, and is gated behind the feature flag `manually_drop_attr`. Some additional notes: ### The meaning of `#[manually_drop]` `#[manually_drop]` means "do not destroy the fields automatically during destruction". `ManuallyDrop`, could "just", morally speaking, be `#[manually_drop] struct ManuallyDrop<T>(T);`. The intent is, per the MCP, to allow customization of the drop order, without making the interface for initializing or accessing the fields of the struct clumsier than a normal Rust type. It also -- and people did seem excited about this part -- lifts `ManuallyDrop` from being a special language supported feature to just another user of `#[manually_drop]`. ### Insignificant Drop There is the question of how this interacts with "insignificant" drop. I had trouble understanding the comments, but insignificant drop appears to just be a static analysis tool, and not something that changes behavior. (For example, it's used to detect if a language change will reorder drops in a meaningful way -- meaning, reorder the significant drops, not the insignificant ones.) Since it's unlikely to be used for `#[manually_drop]` types, I don't think it matters a whole lot. And where a destructor is defined, it would seem to make sense for `#[manually_drop]` types to match exactly the behavior of `union`, since they both have the shared property that field drop glue is suppressed. ### Users that expect `adt.is_manually_drop()` <-> "is `std::mem::ManuallyDrop`" I looked for all locations that queried for `is_manually_drop` in any form, and found two difficult cases which are hardcoded for `ManuallyDrop` in particular. The first is a clippy lint for redundant clones. I don't understand why it special-cases `ManuallyDrop`, and it's almost certainly wrong for it to special-case `#[manually_drop]` types in general. However, without understanding the original rationale, I have trouble figuring the right fix. Perhaps it should simply be deleted altogether. The second is unions -- specifically, the logic for disabling `DerefMut`. `my_union.x.y = z` will automatically dereference `my_union.x` if it implements `DerefMut`, unless it is `ManuallyDrop`, in which case it will not. This is because `ManuallyDrop` is a pointer back to its content, and so this will automatically call `drop` on a probably uninitialized field, and is unsafe. This is true of `ManuallyDrop`, but not necessarily any other `#[manually_drop]` type. I believe the correct fix would, instead, be a way to mark and detect types which are a smart pointer whose pointee is within `self`. See, for example, this playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=76fb22a6214ce453538fc18ec35a839d But that needs to wait for a separate RFC. For now, we apply exactly the same restriction for `ManuallyDrop` and for any other `#[manually_drop]` type, even though it may be confusing. ## To-do in future PRs 1. Delete `#[lang = "manually_drop"]`. I'm not sure if anything special needs to be done here other than replacing it with `#[manually_drop]` -- is there a compatibility guarantee that must be upheld? 2. (Optional) Fix the redundant clone check to correctly handle `#[manually_drop]` structs that aren't `ManuallyDrop`. 3. When there is more experience with the feature (e.g. in Crubit) create a full RFC based on the MCP, and go through the remainder of the stabilization process. (Also, do things like generalize the union error messages to not specifically mention `ManuallyDrop`, but also mention `#[manually_drop]`. For as long as the feature is unstable, the error messages would be confusing if they referenced it...)
Configuration menu - View commit details
-
Copy full SHA for ace1ba4 - Browse repository at this point
Copy the full SHA ace1ba4View commit details -
Rollup merge of rust-lang#103750 - calebzulawski:master, r=workingjub…
…ilee Fix some misleading target feature aliases This is the first half of a fix for rust-lang#100752. It looks like these aliases were added in rust-lang#78361 and slipped under the radar, as these features are not AVX512. These features _do_ add AVX512 instructions when used _in combination_ with AVX512F, but without AVX512F, these features still provide 128-bit and 256-bit vector instructions. A user might be mislead into thinking these features imply AVX512F (which is true of the actual AVX512 features). This PR allows using the names as defined by LLVM, which matches Intel documentation. A future PR should change the `std::arch` intrinsics to use these names, and finally remove these aliases from rustc. r? ``@workingjubilee`` cc ``@Amanieu``
Configuration menu - View commit details
-
Copy full SHA for 8af4462 - Browse repository at this point
Copy the full SHA 8af4462View commit details -
Rollup merge of rust-lang#104137 - StackDoubleFlow:err-lsc-unsupporte…
…d, r=bjorn3 Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes rust-lang#103576
Configuration menu - View commit details
-
Copy full SHA for abd4e2d - Browse repository at this point
Copy the full SHA abd4e2dView commit details -
Rollup merge of rust-lang#104317 - RalfJung:ctfe-error-reporting, r=o…
…li-obk cleanup and dedupe CTFE and Miri error reporting It looks like most of the time, this error raised from const_prop_lint is just redundant -- it duplicates the error reported when evaluating the const-eval query. This lets us make `ConstEvalErr` private to the const_eval module which I think is a good step. The Miri change mostly replaces a `match` by `if let`, and dedupes the "this error is impossible in Miri" checks. r? `@oli-obk` Fixes rust-lang#75461
Configuration menu - View commit details
-
Copy full SHA for 2f93cf5 - Browse repository at this point
Copy the full SHA 2f93cf5View commit details -
Rollup merge of rust-lang#104335 - Nilstrieb:macrowo, r=compiler-errors
Only do parser recovery on retried macro matching Eager parser recovery can break macros, so we don't do it at first. But when we already know that the macro failed, we can retry it with recovery enabled to still emit useful diagnostics. Helps with rust-lang#103534
Configuration menu - View commit details
-
Copy full SHA for 4bacbea - Browse repository at this point
Copy the full SHA 4bacbeaView commit details -
Rollup merge of rust-lang#104394 - oli-obk:suggest_method_call, r=lcnr
various cleanups to try to reduce the use of spans inside method resolution definitely review commit by commit.
Configuration menu - View commit details
-
Copy full SHA for 0815d3a - Browse repository at this point
Copy the full SHA 0815d3aView commit details -
Rollup merge of rust-lang#104459 - notriddle:notriddle/main-js-iife, …
…r=GuillaumeGomez rustdoc: remove unused JS IIFE from main.js This [IIFE] made sense when it was added in f0683f9 and there was a local variable scoped to it, but now it only sets two globals, so it does nothing. [IIFE]: https://developer.mozilla.org/en-US/docs/Glossary/IIFE "immediately invoked function expression"
Configuration menu - View commit details
-
Copy full SHA for 2b90e24 - Browse repository at this point
Copy the full SHA 2b90e24View commit details -
Rollup merge of rust-lang#104462 - notriddle:notriddle/rightside-padd…
…ing-right, r=GuillaumeGomez rustdoc: remove pointless CSS `.rightside { padding-right: 2px }` This CSS was added in 34bd2b8, as `.since { padding-right: 2px }`, to prevent it from uncomfortably touching the srclink, which were separate floated elements. It was carried forward with 962c0a4 to the new `.rightside`, but its role was replaced with adding " • " between them. All it does now is pushes the element 2px away from the page's right margin. Removing this rule changes the page layout, but you have to look for it to notice it.
Configuration menu - View commit details
-
Copy full SHA for b57dfaf - Browse repository at this point
Copy the full SHA b57dfafView commit details -
Rollup merge of rust-lang#104466 - notriddle:notriddle/crate-search-d…
…iv-display, r=GuillaumeGomez rustdoc: remove no-op CSS `#crate-search-div { display: inline-block }` `#crate-search-div` is nested directly below `.search-results-title`, which has `display: inline-flex`. This makes the crate-search-div a [flex item], which makes its display property irrelevant, because flex items have their display [blockified] in any case. [flex item]: https://developer.mozilla.org/en-US/docs/Glossary/Flex_Item [blockified]: https://www.w3.org/TR/css-flexbox-1/#flex-items
Configuration menu - View commit details
-
Copy full SHA for 80f51e0 - Browse repository at this point
Copy the full SHA 80f51e0View commit details