-
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 20 pull requests #126653
Rollup of 20 pull requests #126653
Commits on May 13, 2024
-
Suggest removing unused tuple fields if they are the last fields
Gurinder Singh committedMay 13, 2024 Configuration menu - View commit details
-
Copy full SHA for 012a458 - Browse repository at this point
Copy the full SHA 012a458View commit details
Commits on May 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1e9cd07 - Browse repository at this point
Copy the full SHA 1e9cd07View commit details
Commits on Jun 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 586821e - Browse repository at this point
Copy the full SHA 586821eView commit details
Commits on Jun 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 05b7b46 - Browse repository at this point
Copy the full SHA 05b7b46View commit details
Commits on Jun 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9b05e15 - Browse repository at this point
Copy the full SHA 9b05e15View commit details
Commits on Jun 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 408c8eb - Browse repository at this point
Copy the full SHA 408c8ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 22d0b1e - Browse repository at this point
Copy the full SHA 22d0b1eView commit details -
safe transmute: support non-ZST, variantful, uninhabited enums
Previously, `Tree::from_enum`'s implementation branched into three disjoint cases: 1. enums that uninhabited 2. enums for which all but one variant is uninhabited 3. enums with multiple inhabited variants This branching (incorrectly) did not differentiate between variantful and variantless uninhabited enums. In both cases, we assumed (and asserted) that uninhabited enums are zero-sized types. This assumption is false for enums like: enum Uninhabited { A(!, u128) } ...which, currently, has the same size as `u128`. This faulty assumption manifested as the ICE reported in rust-lang#126460. In this PR, we revise the first case of `Tree::from_enum` to consider only the narrow category of "enums that are uninhabited ZSTs". These enums, whose layouts are described with `Variants::Single { index }`, are special in their layouts otherwise resemble the `!` type and cannot be descended into like typical enums. This first case captures uninhabited enums like: enum Uninhabited { A(!, !), B(!) } The second case is revised to consider the broader category of "enums that defer their layout to one of their variants"; i.e., enums whose layouts are described with `Variants::Single { index }` and that do have a variant at `index`. This second case captures uninhabited enums that are not ZSTs, like: enum Uninhabited { A(!, u128) } ...which represent their variants with `Variants::Single`. Finally, the third case is revised to cover the broader category of "enums with multiple variants", which captures uninhabited, non-ZST enums like: enum Uninhabited { A(u8, !), B(!, u32) } ...which represent their variants with `Variants::Multiple`. This PR also adds a comment requested by RalfJung in his review of rust-lang#126358 to `compiler/rustc_const_eval/src/interpret/discriminant.rs`. Fixes rust-lang#126460
Configuration menu - View commit details
-
Copy full SHA for df1d616 - Browse repository at this point
Copy the full SHA df1d616View commit details
Commits on Jun 15, 2024
-
Ban
ArrayToPointer
andMutToConstPointer
from runtime MIRApparently MIR borrowck cares about at least one of these for checking variance. In runtime MIR, though, there's no need for them as `PtrToPtr` does the same thing. (Banning them simplifies passes like GVN that no longer need to handle multiple cast possibilities.)
Configuration menu - View commit details
-
Copy full SHA for 55fc6bd - Browse repository at this point
Copy the full SHA 55fc6bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 64bba35 - Browse repository at this point
Copy the full SHA 64bba35View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab0e727 - Browse repository at this point
Copy the full SHA ab0e727View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94c2821 - Browse repository at this point
Copy the full SHA 94c2821View commit details
Commits on Jun 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6b84d75 - Browse repository at this point
Copy the full SHA 6b84d75View commit details -
Configuration menu - View commit details
-
Copy full SHA for e74b30e - Browse repository at this point
Copy the full SHA e74b30eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fe2ca6 - Browse repository at this point
Copy the full SHA 5fe2ca6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 764f086 - Browse repository at this point
Copy the full SHA 764f086View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce374fc - Browse repository at this point
Copy the full SHA ce374fcView commit details -
Expand or-candidates mixed with candidates above
We can't mix them with candidates below them, but we can mix them with candidates above.
Configuration menu - View commit details
-
Copy full SHA for 7b764be - Browse repository at this point
Copy the full SHA 7b764beView commit details
Commits on Jun 17, 2024
-
override user defined channel when using precompiled rustc
Signed-off-by: onur-ozkan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 207c5bc - Browse repository at this point
Copy the full SHA 207c5bcView commit details -
simplify
Builder::doc_rust_lang_org_channel
This is already handled at the config parsing level, so we can simplify it. Signed-off-by: onur-ozkan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5ae2446 - Browse repository at this point
Copy the full SHA 5ae2446View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f5b0ef - Browse repository at this point
Copy the full SHA 6f5b0efView commit details -
Sync fuchsia test runner with clang test runner
This synchronizes the fuchsia test running code with the clang test runner. This brings with it: * Improved logging * Uses the fuchsia image from the SDK version * Caches the product bundle across test runs * Strips the binaries to reduce the data sent to the emulator
Configuration menu - View commit details
-
Copy full SHA for b7c2376 - Browse repository at this point
Copy the full SHA b7c2376View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f8c3f7 - Browse repository at this point
Copy the full SHA 0f8c3f7View commit details
Commits on Jun 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 475b63f - Browse repository at this point
Copy the full SHA 475b63fView commit details -
Configuration menu - View commit details
-
Copy full SHA for af10880 - Browse repository at this point
Copy the full SHA af10880View commit details -
Apply suggestions from oli-obk's review
Co-authored-by: Oli Scherer <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1a8eae1 - Browse repository at this point
Copy the full SHA 1a8eae1View commit details -
Replace
move||
withmove ||
incompiler/
andlibrary/
Edit from rust-lang#126631 to revert changes on ui tests
Configuration menu - View commit details
-
Copy full SHA for 7321e79 - Browse repository at this point
Copy the full SHA 7321e79View commit details -
Test that opaque types can't have themselves as a hidden type with in…
…compatible lifetimes
Configuration menu - View commit details
-
Copy full SHA for de473a5 - Browse repository at this point
Copy the full SHA de473a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83cb760 - Browse repository at this point
Copy the full SHA 83cb760View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1597f9 - Browse repository at this point
Copy the full SHA c1597f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 977d3f6 - Browse repository at this point
Copy the full SHA 977d3f6View commit details -
hir_typeck: be more conservative in making "note caller chooses ty pa…
…ram" note - Avoid "caller chooses ty for type param" note if the found type a.k.a. the return expression type *contains* the type parameter, because e.g. `&T` will always be different from `T` (i.e. "well duh"). - Rename `note_caller_chooses_ty_for_ty_param` to `try_note_caller_chooses_ty_for_ty_param` because the note is not always made. Issue: rust-lang#126547
Configuration menu - View commit details
-
Copy full SHA for bfe6a26 - Browse repository at this point
Copy the full SHA bfe6a26View commit details -
Configuration menu - View commit details
-
Copy full SHA for 939026c - Browse repository at this point
Copy the full SHA 939026cView commit details
Commits on Jun 19, 2024
-
Rollup merge of rust-lang#123782 - oli-obk:equal_tait_args, r=compile…
…r-errors Test that opaque types can't have themselves as a hidden type with incompatible lifetimes fixes rust-lang#122876 This PR used to add extra logic to prevent those cases, but after rust-lang#113169 this is implicitly rejected, because such usages are not defining.
Configuration menu - View commit details
-
Copy full SHA for e7eb75b - Browse repository at this point
Copy the full SHA e7eb75bView commit details -
Rollup merge of rust-lang#124135 - petrochenkov:deleglob, r=fmease
delegation: Implement glob delegation Support delegating to all trait methods in one go. Overriding globs with explicit definitions is also supported. The implementation is generally based on the design from rust-lang/rfcs#3530 (comment), but unlike with list delegation in rust-lang#123413 we cannot expand glob delegation eagerly. We have to enqueue it into the queue of unexpanded macros (most other macros are processed this way too), and then a glob delegation waits in that queue until its trait path is resolved, and enough code expands to generate the identifier list produced from the glob. Glob delegation is only allowed in impls, and can only point to traits. Supporting it in other places gives very little practical benefit, but significantly raises the implementation complexity. Part of rust-lang#118212.
Configuration menu - View commit details
-
Copy full SHA for 4d2b4ab - Browse repository at this point
Copy the full SHA 4d2b4abView commit details -
Rollup merge of rust-lang#124580 - gurry:124556-suggest-remove-tuple-…
…field, r=jackh726 Suggest removing unused tuple fields if they are the last fields Fixes rust-lang#124556 We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to `()`.
Configuration menu - View commit details
-
Copy full SHA for 33699c2 - Browse repository at this point
Copy the full SHA 33699c2View commit details -
Rollup merge of rust-lang#125078 - linyihai:issue-124496, r=compiler-…
…errors fix: break inside async closure has incorrect span for enclosing closure Fixes rust-lang#124496
Configuration menu - View commit details
-
Copy full SHA for c5009dd - Browse repository at this point
Copy the full SHA c5009ddView commit details -
Rollup merge of rust-lang#125293 - dingxiangfei2009:tail-expr-temp-li…
…fetime, r=estebank,davidtwco Place tail expression behind terminating scope This PR implements rust-lang#123739 so that we can do further experiments in nightly. A little rewrite has been applied to `for await` lowering. It was previously `unsafe { Pin::unchecked_new(into_async_iter(..)) }`. Under the edition 2024 rule, however, `into_async_iter` gets dropped at the end of the `unsafe` block. This presumably the first Edition 2024 migration rule goes by hoisting `into_async_iter(..)` into `match` one level above, so it now looks like the following. ```rust match into_async_iter($iter_expr) { ref mut iter => match unsafe { Pin::unchecked_new(iter) } { ... } } ```
Configuration menu - View commit details
-
Copy full SHA for 2bae32a - Browse repository at this point
Copy the full SHA 2bae32aView commit details -
Rollup merge of rust-lang#125447 - oli-obk:eq_opaque_pred, r=compiler…
…-errors Allow constraining opaque types during subtyping in the trait system Previous attempt: rust-lang#123979 Sometimes we don't immediately perform subtyping, but instead register a subtyping obligation and solve that obligation when its inference variables become resolved. Unlike immediate subtyping, we currently do not allow registering hidden types for opaque types. This PR also allows that.
Configuration menu - View commit details
-
Copy full SHA for 51ca222 - Browse repository at this point
Copy the full SHA 51ca222View commit details -
Rollup merge of rust-lang#125787 - Oneirical:infinite-test-a-novel, r…
…=jieyouxu Migrate `bin-emit-no-symbols` `run-make` test to `rmake` Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc try-job: armhf-gnu
Configuration menu - View commit details
-
Copy full SHA for 03032b8 - Browse repository at this point
Copy the full SHA 03032b8View commit details -
Rollup merge of rust-lang#125852 - bvanjoi:improve-tip-for-invisible-…
…trait, r=compiler-errors improve tip for inaccessible traits Improve the tips when the candidate method is from an inaccessible trait. For example: ```rs mod m { trait Trait { fn f() {} } impl<T> Trait for T {} } fn main() { struct S; S::f(); } ``` The difference between before and now is: ```diff error[E0599]: no function or associated item named `f` found for struct `S` in the current scope --> ./src/main.rs:88:6 | LL | struct S; | -------- function or associated item `f` not found for this struct LL | S::f(); | ^ function or associated item not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope - help: trait `Trait` which provides `f` is implemented but not in scope; perhaps you want to import it + help: trait `crate::m::Trait` which provides `f` is implemented but not reachable | - LL + use crate::m::Trait; | ```
Configuration menu - View commit details
-
Copy full SHA for aad1f30 - Browse repository at this point
Copy the full SHA aad1f30View commit details -
Rollup merge of rust-lang#126154 - RalfJung:storage-live, r=compiler-…
…errors StorageLive: refresh storage (instead of UB) when local is already live Blocked on [this FCP](rust-lang#99160 (comment)), which also contains the motivation. Fixes rust-lang#99160 Fixes rust-lang#98896 (by declaring it not-a-bug) Fixes rust-lang#119366 Fixes rust-lang/unsafe-code-guidelines#129
Configuration menu - View commit details
-
Copy full SHA for 1381b0c - Browse repository at this point
Copy the full SHA 1381b0cView commit details -
Rollup merge of rust-lang#126308 - scottmcm:ban-some-coercions, r=sae…
…thlin Ban `ArrayToPointer` and `MutToConstPointer` from runtime MIR Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/CastKind.3A.3APointerCoercion.20in.20Runtime.20MIR/near/443955195> Apparently MIR borrowck cares about at least one of these for checking variance. In runtime MIR, though, there's no need for them as `PtrToPtr` does the same thing. (Banning them simplifies passes like GVN that no longer need to handle multiple cast possibilities.) r? mir
Configuration menu - View commit details
-
Copy full SHA for fe0db03 - Browse repository at this point
Copy the full SHA fe0db03View commit details -
Rollup merge of rust-lang#126422 - Urgau:doctest-impl-non-local-def, …
…r=fmease Suggest using a standalone doctest for non-local impl defs This PR tweaks the lint output of the `non_local_definitions` lint to suggest using a standalone doctest instead of a moving the `impl` def to an impossible place as was already done with `macro_rules!` case in rust-lang#124568. Fixes rust-lang#126339 r? ``@fmease``
Configuration menu - View commit details
-
Copy full SHA for fedd86f - Browse repository at this point
Copy the full SHA fedd86fView commit details -
Rollup merge of rust-lang#126493 - jswrenn:fix-126460, r=compiler-errors
safe transmute: support non-ZST, variantful, uninhabited enums Previously, `Tree::from_enum`'s implementation branched into three disjoint cases: 1. enums that uninhabited 2. enums for which all but one variant is uninhabited 3. enums with multiple variants This branching (incorrectly) did not differentiate between variantful and variantless uninhabited enums. In both cases, we assumed (and asserted) that uninhabited enums are zero-sized types. This assumption is false for enums like: enum Uninhabited { A(!, u128) } ...which, currently, has the same size as `u128`. This faulty assumption manifested as the ICE reported in rust-lang#126460. In this PR, we revise the first case of `Tree::from_enum` to consider only the narrow category of "enums that are uninhabited ZSTs". These enums, whose layouts are described with `Variants::Single { index }`, are special in their layouts otherwise resemble the `!` type and cannot be descended into like typical enums. This first case captures uninhabited enums like: enum Uninhabited { A(!, !), B(!) } The second case is revised to consider the broader category of "enums that defer their layout to one of their variants"; i.e., enums whose layouts are described with `Variants::Single { index }` and that do have a variant at `index`. This second case captures uninhabited enums that are not ZSTs, like: enum Uninhabited { A(!, u128) } ...which represent their variants with `Variants::Single`. Finally, the third case is revised to cover the broader category of "enums with multiple variants", which captures uninhabited enums like: enum Uninhabited { A(u8, !), B(!, u32) } ...which represent their variants with `Variants::Multiple`. This PR also adds a comment requested by ```@RalfJung``` in his review of rust-lang#126358 to `compiler/rustc_const_eval/src/interpret/discriminant.rs`. Fixes rust-lang#126460 r? ```@compiler-errors```
Configuration menu - View commit details
-
Copy full SHA for e0ce50b - Browse repository at this point
Copy the full SHA e0ce50bView commit details -
Rollup merge of rust-lang#126504 - erickt:bump-fuchsia, r=tmandry
Sync fuchsia test runner with clang test runner This synchronizes the fuchsia test running code with the clang test runner. This brings with it: * Improved logging * Uses the fuchsia image from the SDK version * Caches the product bundle across test runs * Strips the binaries to reduce the data sent to the emulator r? `@tmandry`
Configuration menu - View commit details
-
Copy full SHA for da963d6 - Browse repository at this point
Copy the full SHA da963d6View commit details -
Rollup merge of rust-lang#126553 - Nadrieril:expand-or-pat-into-above…
…, r=matthewjasper match lowering: expand or-candidates mixed with candidates above This PR tweaks match lowering of or-patterns. Consider this: ```rust match (x, y) { (1, true) => 1, (2, false) => 2, (1 | 2, true | false) => 3, (3 | 4, true | false) => 4, _ => 5, } ``` One might hope that this can be compiled to a single `SwitchInt` on `x` followed by some boolean checks. Before this PR, we compile this to 3 `SwitchInt`s on `x`, because an arm that contains more than one or-pattern was compiled on its own. This PR groups branch `3` with the two branches above, getting us down to 2 `SwitchInt`s on `x`. We can't in general expand or-patterns freely, because this interacts poorly with another optimization we do: or-pattern simplification. When an or-pattern doesn't involve bindings, we branch the success paths of all its alternatives to the same block. The drawback is that in a case like: ```rust match (1, true) { (1 | 2, false) => unreachable!(), (2, _) => unreachable!(), _ => {} } ``` if we used a single `SwitchInt`, by the time we test `false` we don't know whether we came from the `1` case or the `2` case, so we don't know where to go if `false` doesn't match. Hence the limitation: we can process or-pattern alternatives alongside candidates that precede it, but not candidates that follow it. (Unless the or-pattern is the only remaining match pair of its candidate, in which case we can process it alongside whatever). This PR allows the processing of or-pattern alternatives alongside candidates that precede it. One benefit is that we now process or-patterns in a single place in `mod.rs`. r? `@matthewjasper`
Configuration menu - View commit details
-
Copy full SHA for b32d9ef - Browse repository at this point
Copy the full SHA b32d9efView commit details -
Rollup merge of rust-lang#126558 - jieyouxu:caller-chooses-ty, r=fmease
hir_typeck: be more conservative in making "note caller chooses ty param" note In rust-lang#122195 I added a "caller chooses ty for type param" note for when the return expression type a.k.a. found type does not match the expected return type. rust-lang#126547 found that this note was confusing when the found return type *contains* the expected type, e.g. ```rs fn f<T>(t: &T) -> T { t } ``` because the found return type `&T` will *always* be different from the expected return type `T`, so the note was needlessly redundant and confusing. This PR addresses that by not making the note if the found return type contains the expected return type. r? `@fmease` (since you reviewed the original PR) Fixes rust-lang#126547
Configuration menu - View commit details
-
Copy full SHA for 5ec5dda - Browse repository at this point
Copy the full SHA 5ec5ddaView commit details -
Rollup merge of rust-lang#126572 - onur-ozkan:channel-problem, r=club…
…by789 override user defined channel when using precompiled rustc We need to override `rust.channel` if it's manually specified when using the CI rustc. This is because if the compiler uses a different channel than the one specified in config.toml, tests may fail due to using a different channel than the one used by the compiler during tests. For more context, see rust-lang#122709 (comment).
Configuration menu - View commit details
-
Copy full SHA for 187fe5b - Browse repository at this point
Copy the full SHA 187fe5bView commit details -
Rollup merge of rust-lang#126586 - madsmtm:mac-catalyst-maintainers, …
…r=Nilstrieb Add @badboy and @BlackHoleFox as Mac Catalyst maintainers Assented in rust-lang/compiler-team#761 (comment) and https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Promote.20Mac.20Catalyst.20targets.20to.20Tier.202.20compiler-team.23761/near/444590303.
Configuration menu - View commit details
-
Copy full SHA for c4712a0 - Browse repository at this point
Copy the full SHA c4712a0View commit details -
Rollup merge of rust-lang#126594 - zetanumbers:fix-cross-crate-async-…
…drop-glue, r=oli-obk Make async drop code more consistent with regular drop code Fixes rust-lang#126573 Relates to rust-lang#126482 r? ``@petrochenkov``
Configuration menu - View commit details
-
Copy full SHA for 8c38b6a - Browse repository at this point
Copy the full SHA 8c38b6aView commit details -
Rollup merge of rust-lang#126615 - tgross35:gitignore-ice, r=compiler…
…-errors Add `rustc-ice*` to `.gitignore` I am a bit surprised this wasn't already here but there doesn't seem to be any reason not to add it. This will be nice to cut down on `git {add, diff, etc}` noise when debugging crashes.
Configuration menu - View commit details
-
Copy full SHA for 00df302 - Browse repository at this point
Copy the full SHA 00df302View commit details -
Rollup merge of rust-lang#126632 - Vonr:fix/moving-closure-formatting…
…-v2, r=Nilstrieb Replace `move||` with `move ||` Edit from rust-lang#126631 to revert changes in `tests/ui`. There are 18 instances of `move||` across 6 files in the repo: - `compiler/rustc_hir_typeck/src/typeck_root_ctxt.rs` - `library/core/src/sync/atomic.rs` - `library/std/src/sync/condvar.rs` - `library/std/src/sync/mpsc/mod.rs` - `library/std/src/sync/barrier.rs` - `library/std/src/thread/local.rs` I have replaced all such instances with `move ||` instead as it better adheres to modern formatting standards. Ideally, we would have this automated by rustfmt or some other tool, but I do not have the time to implement such a feature or tool. Nonetheless, I would encourage any effort invested into such a tool or feature.
Configuration menu - View commit details
-
Copy full SHA for 68e12d3 - Browse repository at this point
Copy the full SHA 68e12d3View commit details