| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Tracking issue: #60405
|
|
Stabilize #![feature(repr_align_enum)] in Rust 1.37.0
On an `enum` item, you may now write:
```rust
#[repr(align(X))]
enum Foo {
// ...
}
```
This has equivalent effects to first defining:
```rust
#[repr(align(X))]
struct AlignX<T>(T);
```
and then using `AlignX<Foo>` in `Foo`'s stead.
r? @nagisa
|
|
|
|
Unlike other built-in attributes, this attribute accepts any input
|
|
|
|
|
|
|
|
|
|
This implements RFC 2480:
* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md
Closes https://github.com/rust-lang/rust/issues/27783
|
|
|
|
|
|
|
|
Rollup of 25 pull requests
Successful merges:
- #56802 (Add DoubleEndedIterator::nth_back)
- #56909 (static eval: Do not ICE on layout size overflow)
- #56914 (Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le)
- #56919 (Remove a wrong multiplier on relocation offset computation)
- #56933 (Add --progress to git submodule commands in x.py)
- #56936 (rename div_euc -> div_euclid, and mod_euc -> rem_euclid)
- #56941 (deny intra-doc link resolution failures in libstd)
- #56945 (Fix rustdoc-js tests)
- #56967 (Replace current crate's searchIndex when regenerating)
- #56970 (Mem uninit doc ptr drop)
- #56973 (make basic CTFE tracing available on release builds)
- #56979 (Adding unwinding support for x86_64_fortanix_unknown_sgx target.)
- #56981 (miri: allocation is infallible)
- #56984 (A few tweaks to dropck_outlives)
- #56989 (Fix compiletest `trim` deprecation warnings)
- #56992 (suggest similar lint names for unknown lints)
- #57002 (Stabilize Vec(Deque)::resize_with)
- #57011 (rustdoc: add new CLI flag to load static files from a different location)
- #57027 (Optimize away a move)
- #57034 (Inline tweaks)
- #57039 (Update migrate warning wording.)
- #57040 (Fix feature gate to point to 1.32.0 for `path_from_str`)
- #57049 (Stabilize #[repr(packed(N))])
- #57050 (Fixed typo in HashMap documentation)
- #57052 (Fix stabilization version numbers (exhaustive_integer_patterns + macro_literal_matcher))
|
|
|
|
RFC #2195 specifies that a repr(int) enum such as:
#[repr(u8)]
enum MyEnum {
B { x: u8, y: i16, z: u8 },
}
has a layout that is equivalent to:
#[repr(C)]
enum MyEnumVariantB { tag: u8, x: u8, y: i16, z: u8 },
However this isn't actually implemented, with the actual layout being
roughly equivalent to:
union MyEnumPayload {
B { x: u8, y: i16, z: u8 },
}
#[repr(packed)]
struct MyEnum {
tag: u8,
payload: MyEnumPayload,
}
Thus the variant payload is *not* subject to repr(C) ordering rules, and
gets re-ordered as `{ x: u8, z: u8, z: i16 }`
The existing tests added in pull-req #45688 fail to catch this as the
repr(C) ordering just happens to match the current Rust ordering in this
case; adding a third field reveals the problem.
|
|
|
|
with clean stderr again.
Most were added mechanically.
|
|
Fix #54047
|