Skip to content

Commit 1a90ad8

Browse files
authored
Merge branch 'rust-lang:master' into adjust-allocbytes
2 parents 716b920 + ce609db commit 1a90ad8

File tree

1,385 files changed

+20789
-8443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,385 files changed

+20789
-8443
lines changed

.github/ISSUE_TEMPLATE/tracking_issue.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Tracking issues are used to record the overall progress of implementation.
2828
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
2929
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
3030
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
31+
Discussion comments will get marked as off-topic or deleted.
32+
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
3133

3234
### Steps
3335
<!--

.github/workflows/ci.yml

Lines changed: 12 additions & 589 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
491491

492492
[[package]]
493493
name = "chrono"
494-
version = "0.4.37"
494+
version = "0.4.38"
495495
source = "registry+https://github.com/rust-lang/crates.io-index"
496-
checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e"
496+
checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
497497
dependencies = [
498498
"android-tzdata",
499499
"iana-time-zone",
@@ -760,11 +760,9 @@ dependencies = [
760760
"glob",
761761
"home",
762762
"indexmap",
763-
"lazycell",
764763
"libc",
765764
"miow",
766765
"miropt-test-tools",
767-
"once_cell",
768766
"regex",
769767
"rustfix 0.8.1",
770768
"serde",
@@ -2151,12 +2149,6 @@ version = "1.4.0"
21512149
source = "registry+https://github.com/rust-lang/crates.io-index"
21522150
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
21532151

2154-
[[package]]
2155-
name = "lazycell"
2156-
version = "1.3.0"
2157-
source = "registry+https://github.com/rust-lang/crates.io-index"
2158-
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
2159-
21602152
[[package]]
21612153
name = "leb128"
21622154
version = "0.2.5"
@@ -2493,8 +2485,10 @@ name = "miri"
24932485
version = "0.1.0"
24942486
dependencies = [
24952487
"aes",
2488+
"chrono",
24962489
"colored",
24972490
"ctrlc",
2491+
"directories",
24982492
"getrandom",
24992493
"jemalloc-sys",
25002494
"lazy_static",
@@ -3343,6 +3337,7 @@ version = "0.0.0"
33433337
dependencies = [
33443338
"object 0.34.0",
33453339
"regex",
3340+
"similar",
33463341
"wasmparser",
33473342
]
33483343

@@ -5138,6 +5133,12 @@ version = "1.3.0"
51385133
source = "registry+https://github.com/rust-lang/crates.io-index"
51395134
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
51405135

5136+
[[package]]
5137+
name = "similar"
5138+
version = "2.5.0"
5139+
source = "registry+https://github.com/rust-lang/crates.io-index"
5140+
checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640"
5141+
51415142
[[package]]
51425143
name = "siphasher"
51435144
version = "0.3.11"

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,3 @@ strip = true
112112
rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
113113
rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
114114
rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
115-
116-
[patch."https://github.com/rust-lang/rust-clippy"]
117-
clippy_lints = { path = "src/tools/clippy/clippy_lints" }

RELEASES.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,123 @@
1+
Version 1.78.0 (2024-05-02)
2+
==========================
3+
4+
<a id="1.78.0-Language"></a>
5+
6+
Language
7+
--------
8+
- [Stabilize `#[cfg(target_abi = ...)]`](https://github.com/rust-lang/rust/pull/119590/)
9+
- [Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimplemented]` attribute](https://github.com/rust-lang/rust/pull/119888/)
10+
- [Make async-fn-in-trait implementable with concrete signatures](https://github.com/rust-lang/rust/pull/120103/)
11+
- [Make matching on NaN a hard error, and remove the rest of `illegal_floating_point_literal_pattern`](https://github.com/rust-lang/rust/pull/116284/)
12+
- [static mut: allow mutable reference to arbitrary types, not just slices and arrays](https://github.com/rust-lang/rust/pull/117614/)
13+
- [Extend `invalid_reference_casting` to include references casting to bigger memory layout](https://github.com/rust-lang/rust/pull/118983/)
14+
- [Add `non_contiguous_range_endpoints` lint for singleton gaps after exclusive ranges](https://github.com/rust-lang/rust/pull/118879/)
15+
- [Add `wasm_c_abi` lint for use of older wasm-bindgen versions](https://github.com/rust-lang/rust/pull/117918/)
16+
This lint currently only works when using Cargo.
17+
- [Update `indirect_structural_match` and `pointer_structural_match` lints to match RFC](https://github.com/rust-lang/rust/pull/120423/)
18+
- [Make non-`PartialEq`-typed consts as patterns a hard error](https://github.com/rust-lang/rust/pull/120805/)
19+
- [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants](https://github.com/rust-lang/rust/pull/121720/)
20+
- [Remove unnecessary type inference when using associated types inside of higher ranked `where`-bounds](https://github.com/rust-lang/rust/pull/119849)
21+
- [Weaken eager detection of cyclic types during type inference](https://github.com/rust-lang/rust/pull/119989)
22+
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`](https://github.com/rust-lang/rust/pull/119338)
23+
24+
<a id="1.78.0-Compiler"></a>
25+
26+
Compiler
27+
--------
28+
29+
- [Made `INVALID_DOC_ATTRIBUTES` lint deny by default](https://github.com/rust-lang/rust/pull/111505/)
30+
- [Increase accuracy of redundant `use` checking](https://github.com/rust-lang/rust/pull/117772/)
31+
- [Suggest moving definition if non-found macro_rules! is defined later](https://github.com/rust-lang/rust/pull/121130/)
32+
- [Lower transmutes from int to pointer type as gep on null](https://github.com/rust-lang/rust/pull/121282/)
33+
34+
Target changes:
35+
36+
- [Windows tier 1 targets now require at least Windows 10](https://github.com/rust-lang/rust/pull/115141/)
37+
- [Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics in tier 1 Windows](https://github.com/rust-lang/rust/pull/120820/)
38+
- [Add `wasm32-wasip1` tier 2 (without host tools) target](https://github.com/rust-lang/rust/pull/120468/)
39+
- [Add `wasm32-wasip2` tier 3 target](https://github.com/rust-lang/rust/pull/119616/)
40+
- [Rename `wasm32-wasi-preview1-threads` to `wasm32-wasip1-threads`](https://github.com/rust-lang/rust/pull/122170/)
41+
- [Add `arm64ec-pc-windows-msvc` tier 3 target](https://github.com/rust-lang/rust/pull/119199/)
42+
- [Add `armv8r-none-eabihf` tier 3 target for the Cortex-R52](https://github.com/rust-lang/rust/pull/110482/)
43+
- [Add `loongarch64-unknown-linux-musl` tier 3 target](https://github.com/rust-lang/rust/pull/121832/)
44+
45+
Refer to Rust's [platform support page][platform-support-doc]
46+
for more information on Rust's tiered platform support.
47+
48+
<a id="1.78.0-Libraries"></a>
49+
50+
Libraries
51+
---------
52+
53+
- [Bump Unicode to version 15.1.0, regenerate tables](https://github.com/rust-lang/rust/pull/120777/)
54+
- [Make align_offset, align_to well-behaved in all cases](https://github.com/rust-lang/rust/pull/121201/)
55+
- [PartialEq, PartialOrd: document expectations for transitive chains](https://github.com/rust-lang/rust/pull/115386/)
56+
- [Optimize away poison guards when std is built with panic=abort](https://github.com/rust-lang/rust/pull/100603/)
57+
- [Replace pthread `RwLock` with custom implementation](https://github.com/rust-lang/rust/pull/110211/)
58+
- [Implement unwind safety for Condvar on all platforms](https://github.com/rust-lang/rust/pull/121768/)
59+
- [Add ASCII fast-path for `char::is_grapheme_extended`](https://github.com/rust-lang/rust/pull/121138/)
60+
61+
<a id="1.78.0-Stabilized-APIs"></a>
62+
63+
Stabilized APIs
64+
---------------
65+
66+
- [`impl Read for &Stdin`](https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin)
67+
- [Accept non `'static` lifetimes for several `std::error::Error` related implementations](https://github.com/rust-lang/rust/pull/113833/)
68+
- [Make `impl<Fd: AsFd>` impl take `?Sized`](https://github.com/rust-lang/rust/pull/114655/)
69+
- [`impl From<TryReserveError> for io::Error`](https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error)
70+
71+
These APIs are now stable in const contexts:
72+
73+
- [`Barrier::new()`](https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new)
74+
75+
<a id="1.78.0-Cargo"></a>
76+
77+
Cargo
78+
-----
79+
80+
- [Stabilize lockfile v4](https://github.com/rust-lang/cargo/pull/12852/)
81+
- [Respect `rust-version` when generating lockfile](https://github.com/rust-lang/cargo/pull/12861/)
82+
- [Control `--charset` via auto-detecting config value](https://github.com/rust-lang/cargo/pull/13337/)
83+
- [Support `target.<triple>.rustdocflags` officially](https://github.com/rust-lang/cargo/pull/13197/)
84+
- [Stabilize global cache data tracking](https://github.com/rust-lang/cargo/pull/13492/)
85+
86+
<a id="1.78.0-Misc"></a>
87+
88+
Misc
89+
----
90+
91+
- [rustdoc: add `--test-builder-wrapper` arg to support wrappers such as RUSTC_WRAPPER when building doctests](https://github.com/rust-lang/rust/pull/114651/)
92+
93+
<a id="1.78.0-Compatibility-Notes"></a>
94+
95+
Compatibility Notes
96+
-------------------
97+
98+
- [Many unsafe precondition checks now run for user code with debug assertions enabled](https://github.com/rust-lang/rust/pull/120594/)
99+
This change helps users catch undefined behavior in their code, though the details of how much is checked are generally not stable.
100+
- [riscv only supports split_debuginfo=off for now](https://github.com/rust-lang/rust/pull/120518/)
101+
- [Consistently check bounds on hidden types of `impl Trait`](https://github.com/rust-lang/rust/pull/121679)
102+
- [Change equality of higher ranked types to not rely on subtyping](https://github.com/rust-lang/rust/pull/118247)
103+
- [When called, additionally check bounds on normalized function return type](https://github.com/rust-lang/rust/pull/118882)
104+
- [Expand coverage for `arithmetic_overflow` lint](https://github.com/rust-lang/rust/pull/119432/)
105+
106+
<a id="1.78.0-Internal-Changes"></a>
107+
108+
Internal Changes
109+
----------------
110+
111+
These changes do not affect any public interfaces of Rust, but they represent
112+
significant improvements to the performance or internals of rustc and related
113+
tools.
114+
115+
- [Update to LLVM 18](https://github.com/rust-lang/rust/pull/120055/)
116+
- [Build `rustc` with 1CGU on `x86_64-pc-windows-msvc`](https://github.com/rust-lang/rust/pull/112267/)
117+
- [Build `rustc` with 1CGU on `x86_64-apple-darwin`](https://github.com/rust-lang/rust/pull/112268/)
118+
- [Introduce `run-make` V2 infrastructure, a `run_make_support` library and port over 2 tests as example](https://github.com/rust-lang/rust/pull/113026/)
119+
- [Windows: Implement condvar, mutex and rwlock using futex](https://github.com/rust-lang/rust/pull/121956/)
120+
1121
Version 1.77.2 (2024-04-09)
2122
===========================
3123

compiler/rustc_abi/src/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub trait LayoutCalculator {
251251
// If all the non-ZST fields have the same ABI and union ABI optimizations aren't
252252
// disabled, we can use that common ABI for the union as a whole.
253253
struct AbiMismatch;
254-
let mut common_non_zst_abi_and_align = if repr.inhibit_union_abi_opt() {
254+
let mut common_non_zst_abi_and_align = if repr.inhibits_union_abi_opt() {
255255
// Can't optimize
256256
Err(AbiMismatch)
257257
} else {

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl ReprOptions {
155155
}
156156

157157
/// Returns `true` if this `#[repr()]` should inhibit union ABI optimisations.
158-
pub fn inhibit_union_abi_opt(&self) -> bool {
158+
pub fn inhibits_union_abi_opt(&self) -> bool {
159159
self.c()
160160
}
161161
}

compiler/rustc_ast/src/ast.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,6 +2786,7 @@ pub enum AttrKind {
27862786
#[derive(Clone, Encodable, Decodable, Debug)]
27872787
pub struct NormalAttr {
27882788
pub item: AttrItem,
2789+
// Tokens for the full attribute, e.g. `#[foo]`, `#![bar]`.
27892790
pub tokens: Option<LazyAttrTokenStream>,
27902791
}
27912792

@@ -2802,6 +2803,7 @@ impl NormalAttr {
28022803
pub struct AttrItem {
28032804
pub path: Path,
28042805
pub args: AttrArgs,
2806+
// Tokens for the meta item, e.g. just the `foo` within `#[foo]` or `#![foo]`.
28052807
pub tokens: Option<LazyAttrTokenStream>,
28062808
}
28072809

@@ -3112,6 +3114,7 @@ pub struct Delegation {
31123114
/// Path resolution id.
31133115
pub id: NodeId,
31143116
pub qself: Option<P<QSelf>>,
3117+
pub rename: Option<Ident>,
31153118
pub path: Path,
31163119
pub body: Option<P<Block>>,
31173120
}

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ impl MetaItem {
298298
}
299299

300300
pub fn value_str(&self) -> Option<Symbol> {
301-
self.kind.value_str()
301+
match &self.kind {
302+
MetaItemKind::NameValue(v) => v.kind.str(),
303+
_ => None,
304+
}
302305
}
303306

304307
fn from_tokens<'a, I>(tokens: &mut iter::Peekable<I>) -> Option<MetaItem>
@@ -362,13 +365,6 @@ impl MetaItem {
362365
}
363366

364367
impl MetaItemKind {
365-
pub fn value_str(&self) -> Option<Symbol> {
366-
match self {
367-
MetaItemKind::NameValue(v) => v.kind.str(),
368-
_ => None,
369-
}
370-
}
371-
372368
fn list_from_tokens(tokens: TokenStream) -> Option<ThinVec<NestedMetaItem>> {
373369
let mut tokens = tokens.trees().peekable();
374370
let mut result = ThinVec::new();
@@ -468,8 +464,9 @@ impl NestedMetaItem {
468464
self.meta_item().and_then(|meta_item| meta_item.meta_item_list())
469465
}
470466

471-
/// Returns a name and single literal value tuple of the `MetaItem`.
472-
pub fn name_value_literal(&self) -> Option<(Symbol, &MetaItemLit)> {
467+
/// If it's a singleton list of the form `foo(lit)`, returns the `foo` and
468+
/// the `lit`.
469+
pub fn singleton_lit_list(&self) -> Option<(Symbol, &MetaItemLit)> {
473470
self.meta_item().and_then(|meta_item| {
474471
meta_item.meta_item_list().and_then(|meta_item_list| {
475472
if meta_item_list.len() == 1

0 commit comments

Comments
 (0)