| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
negatives fixed recently)
|
|
Use .next() instead of .nth(0) on iterators.
|
|
|
|
|
|
|
|
|
|
Always const qualify literals by type
r? @eddyb
|
|
|
|
|
|
Improve `ty.needs_drop`
* Handle cycles in `needs_drop` correctly
* Normalize types when computing `needs_drop`
* Move queries from rustc to rustc_ty
* Avoid query in simple cases
reopens #65918
|
|
|
|
Co-Authored-By: varkor <github@varkor.com>
|
|
|
|
* Handle arrays with const-generic lengths
* Use closure for repeated code.
|
|
* Handle cycles in `needs_drop` correctly
* Normalize types when computing `needs_drop`
* Move queries from rustc to rustc_ty
|
|
For now, this is all the crate contains, but more
attribute logic & types will be moved there over time.
|
|
This feature adds `X..`, `..X`, and `..=X` patterns.
|
|
Treat extern statics just like statics in the "const pointer to static" representation
fixes #67612
r? @spastorino
cc @RalfJung this does not affect runtime promotion at all. This is just about promotion within static item bodies.
|
|
|
|
|
|
|
|
|
|
representation
|
|
|
|
2. mir::Mutability -> ast::Mutability.
|
|
|
|
|
|
|
|
|
|
Change untagged_unions to not allow union fields with drop
This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass.
Change untagged_unions to not allow union fields with drop
Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).
The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.
Tracking issue: https://github.com/rust-lang/rust/issues/55149
|
|
Return `false` from `needs_drop` for all zero-sized arrays.
Resolves #65348.
This changes the result of the `needs_drop` query from `true` to `false` for types such as `[Box<i32>; 0]`. I believe this change to be sound because a zero-sized array can never actually hold a value. This is an elegant way of resolving #65348 and #64945, but obviously it has much broader implications.
|
|
Optimize `try_expand_impl_trait_type`
A lot of time was being spent expanding some large `impl Future` types in fuchsia. This PR takes the number of types being visited in one expansion from >3 billion to about a thousand, and eliminates the compile time regression in https://github.com/rust-lang/rust/issues/65147 (in fact, compile times are better than they were before).
Thanks to @Mark-Simulacrum for helping identify the issue and to @matthewjasper for suggesting this change.
Fixes #65147.
r? @matthewjasper,@nikomatsakis
|
|
|
|
|
|
|
|
Union fields may now never have a type with attached destructor.
This for example allows unions to use arbitrary field types only by
wrapping
them in ManuallyDrop.
The stable rule remains, that union fields must be Copy. We use the new
rule for the `untagged_union` feature.
See RFC 2514.
Note for ui tests:
We can't test move out through Box's deref-move since we can't
have a Box in a union anymore.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This prevents mutual `async fn` recursion
|
|
|
|
|
|
pnkfelix:issue-60431-make-struct-tail-normalize-when-possible, r=eddyb
Make struct_tail normalize when possible
As noted in commit message: this replaces the existing methods to extract the struct tail(s) with new entry points that make the handling of normalization explicit.
Most of the places that call `struct_tail` are during codegen, post type-checking, and therefore they can get away with using `tcx.normalize_erasing_regions` (this is the entry point `struct_tail_erasing_lifetimes`)
For other cases that may arise, one can use the core method, which is parameterized over the normalization `Ty -> Ty` closure (`struct_tail_with_normalize`).
Or one can use the trivial entry point that does not normalization (`struct_tail_without_normalization`)
----
I spent a little while trying to make a test that exposed the bug via `impl Trait` rather than a projection, but I failed to find something that tripped up the current nightly `rustc`.
* I have *not* spent any time trying to make tests that trip up the other places where `struct_tail` was previously being called. While I do think the task of making such tests could be worthwhile, I am simply running out of time. (Its also possible that the layout code is always the first point called, and thus it may be pointless to try to come up with such tests.)
I also spent a little time discussing with @eddyb where this code should live. They suggested moving `struct_tail` and its sibling `struct_lockstep_tails` to the `LayoutCx`. But in the interest of time, I have left that refactoring (which may be questionable at this point) to a follow-up task.
----
Fix #60431
|