Skip to content

Commit 338153f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into issue-116434
2 parents 915812d + b5c46dc commit 338153f

File tree

2,535 files changed

+35225
-21270
lines changed

Some content is hidden

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

2,535 files changed

+35225
-21270
lines changed

.github/workflows/ci.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ jobs:
294294
- name: x86_64-gnu-integration
295295
env:
296296
CI_ONLY_WHEN_CHANNEL: nightly
297-
os: ubuntu-20.04-16core-64gb
297+
os: ubuntu-20.04-8core-32gb
298298
- name: x86_64-gnu-debug
299299
os: ubuntu-20.04-8core-32gb
300300
env: {}
@@ -319,7 +319,7 @@ jobs:
319319
- name: dist-x86_64-apple
320320
env:
321321
SCRIPT: "./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin"
322-
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin"
322+
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set rust.lto=thin"
323323
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
324324
MACOSX_DEPLOYMENT_TARGET: 10.12
325325
SELECT_XCODE: /Applications/Xcode_13.4.1.app
@@ -332,7 +332,7 @@ jobs:
332332
- name: dist-apple-various
333333
env:
334334
SCRIPT: "./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim"
335-
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
335+
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc"
336336
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
337337
MACOSX_DEPLOYMENT_TARGET: 10.12
338338
SELECT_XCODE: /Applications/Xcode_13.4.1.app
@@ -343,7 +343,7 @@ jobs:
343343
- name: x86_64-apple-1
344344
env:
345345
SCRIPT: "./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc --skip tests/run-make-fulldeps"
346-
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
346+
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc"
347347
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
348348
MACOSX_DEPLOYMENT_TARGET: 10.12
349349
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
@@ -354,7 +354,7 @@ jobs:
354354
- name: x86_64-apple-2
355355
env:
356356
SCRIPT: "./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps"
357-
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
357+
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc"
358358
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
359359
MACOSX_DEPLOYMENT_TARGET: 10.12
360360
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
@@ -364,8 +364,8 @@ jobs:
364364
os: macos-13
365365
- name: dist-aarch64-apple
366366
env:
367-
SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2"
368-
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --disable-docs --set rust.jemalloc --set llvm.ninja=false"
367+
SCRIPT: "./x.py dist bootstrap --include-default-paths --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
368+
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin"
369369
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
370370
SELECT_XCODE: /Applications/Xcode_13.4.1.app
371371
USE_XCODE_CLANG: 1
@@ -375,8 +375,20 @@ jobs:
375375
NO_DEBUG_ASSERTIONS: 1
376376
NO_OVERFLOW_CHECKS: 1
377377
DIST_REQUIRE_ALL_TOOLS: 1
378-
JEMALLOC_SYS_WITH_LG_PAGE: 14
379-
os: macos-13
378+
os: macos-14
379+
- name: aarch64-apple
380+
env:
381+
SCRIPT: "./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
382+
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc"
383+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
384+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
385+
USE_XCODE_CLANG: 1
386+
MACOSX_DEPLOYMENT_TARGET: 11.0
387+
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
388+
NO_LLVM_ASSERTIONS: 1
389+
NO_DEBUG_ASSERTIONS: 1
390+
NO_OVERFLOW_CHECKS: 1
391+
os: macos-14
380392
- name: x86_64-msvc
381393
env:
382394
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"

Cargo.lock

+17-15
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ dependencies = [
3737

3838
[[package]]
3939
name = "ahash"
40-
version = "0.8.6"
40+
version = "0.8.7"
4141
source = "registry+https://github.com/rust-lang/crates.io-index"
42-
checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
42+
checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
4343
dependencies = [
4444
"cfg-if",
4545
"once_cell",
@@ -556,7 +556,7 @@ checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
556556

557557
[[package]]
558558
name = "clippy"
559-
version = "0.1.77"
559+
version = "0.1.78"
560560
dependencies = [
561561
"anstream",
562562
"clippy_config",
@@ -584,7 +584,7 @@ dependencies = [
584584

585585
[[package]]
586586
name = "clippy_config"
587-
version = "0.1.77"
587+
version = "0.1.78"
588588
dependencies = [
589589
"rustc-semver",
590590
"serde",
@@ -607,7 +607,7 @@ dependencies = [
607607

608608
[[package]]
609609
name = "clippy_lints"
610-
version = "0.1.77"
610+
version = "0.1.78"
611611
dependencies = [
612612
"arrayvec",
613613
"cargo_metadata 0.18.0",
@@ -632,7 +632,7 @@ dependencies = [
632632

633633
[[package]]
634634
name = "clippy_utils"
635-
version = "0.1.77"
635+
version = "0.1.78"
636636
dependencies = [
637637
"arrayvec",
638638
"clippy_config",
@@ -1003,7 +1003,7 @@ checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69"
10031003

10041004
[[package]]
10051005
name = "declare_clippy_lint"
1006-
version = "0.1.77"
1006+
version = "0.1.78"
10071007
dependencies = [
10081008
"itertools",
10091009
"quote",
@@ -2090,9 +2090,9 @@ dependencies = [
20902090

20912091
[[package]]
20922092
name = "jobserver"
2093-
version = "0.1.27"
2093+
version = "0.1.28"
20942094
source = "registry+https://github.com/rust-lang/crates.io-index"
2095-
checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d"
2095+
checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6"
20962096
dependencies = [
20972097
"libc",
20982098
]
@@ -2169,9 +2169,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
21692169

21702170
[[package]]
21712171
name = "libc"
2172-
version = "0.2.150"
2172+
version = "0.2.153"
21732173
source = "registry+https://github.com/rust-lang/crates.io-index"
2174-
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
2174+
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
21752175
dependencies = [
21762176
"rustc-std-workspace-core",
21772177
]
@@ -4374,6 +4374,7 @@ dependencies = [
43744374
"rustc_middle",
43754375
"rustc_session",
43764376
"rustc_span",
4377+
"rustc_ty_utils",
43774378
"tracing",
43784379
]
43794380

@@ -5321,6 +5322,7 @@ version = "0.0.0"
53215322
dependencies = [
53225323
"core",
53235324
"getopts",
5325+
"libc",
53245326
"panic_abort",
53255327
"panic_unwind",
53265328
"std",
@@ -6406,18 +6408,18 @@ dependencies = [
64066408

64076409
[[package]]
64086410
name = "zerocopy"
6409-
version = "0.7.28"
6411+
version = "0.7.32"
64106412
source = "registry+https://github.com/rust-lang/crates.io-index"
6411-
checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e"
6413+
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
64126414
dependencies = [
64136415
"zerocopy-derive",
64146416
]
64156417

64166418
[[package]]
64176419
name = "zerocopy-derive"
6418-
version = "0.7.28"
6420+
version = "0.7.32"
64196421
source = "registry+https://github.com/rust-lang/crates.io-index"
6420-
checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b"
6422+
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
64216423
dependencies = [
64226424
"proc-macro2",
64236425
"quote",

RELEASES.md

+93
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,96 @@
1+
Version 1.76.0 (2024-02-08)
2+
==========================
3+
4+
<a id="1.76.0-Language"></a>
5+
6+
Language
7+
--------
8+
- [Document Rust ABI compatibility between various types](https://github.com/rust-lang/rust/pull/115476/)
9+
- [Also: guarantee that char and u32 are ABI-compatible](https://github.com/rust-lang/rust/pull/118032/)
10+
- [Add lint `ambiguous_wide_pointer_comparisons` that supersedes `clippy::vtable_address_comparisons`](https://github.com/rust-lang/rust/pull/117758)
11+
12+
<a id="1.76.0-Compiler"></a>
13+
14+
Compiler
15+
--------
16+
- [Lint pinned `#[must_use]` pointers (in particular, `Box<T>` where `T` is `#[must_use]`) in `unused_must_use`.](https://github.com/rust-lang/rust/pull/118054/)
17+
- [Soundness fix: fix computing the offset of an unsized field in a packed struct](https://github.com/rust-lang/rust/pull/118540/)
18+
- [Soundness fix: fix dynamic size/align computation logic for packed types with dyn Trait tail](https://github.com/rust-lang/rust/pull/118538/)
19+
- [Add `$message_type` field to distinguish json diagnostic outputs](https://github.com/rust-lang/rust/pull/115691/)
20+
- [Enable Rust to use the EHCont security feature of Windows](https://github.com/rust-lang/rust/pull/118013/)
21+
- [Add tier 3 {x86_64,i686}-win7-windows-msvc targets](https://github.com/rust-lang/rust/pull/118150/)
22+
- [Add tier 3 aarch64-apple-watchos target](https://github.com/rust-lang/rust/pull/119074/)
23+
- [Add tier 3 arm64e-apple-ios & arm64e-apple-darwin targets](https://github.com/rust-lang/rust/pull/115526/)
24+
25+
Refer to Rust's [platform support page][platform-support-doc]
26+
for more information on Rust's tiered platform support.
27+
28+
<a id="1.76.0-Libraries"></a>
29+
30+
Libraries
31+
---------
32+
- [Add a column number to `dbg!()`](https://github.com/rust-lang/rust/pull/114962/)
33+
- [Add `std::hash::{DefaultHasher, RandomState}` exports](https://github.com/rust-lang/rust/pull/115694/)
34+
- [Fix rounding issue with exponents in fmt](https://github.com/rust-lang/rust/pull/116301/)
35+
- [Add T: ?Sized to `RwLockReadGuard` and `RwLockWriteGuard`'s Debug impls.](https://github.com/rust-lang/rust/pull/117138/)
36+
- [Windows: Allow `File::create` to work on hidden files](https://github.com/rust-lang/rust/pull/116438/)
37+
38+
<a id="1.76.0-Stabilized-APIs"></a>
39+
40+
Stabilized APIs
41+
---------------
42+
43+
- [`Arc::unwrap_or_clone`](https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.unwrap_or_clone)
44+
- [`Rc::unwrap_or_clone`](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.unwrap_or_clone)
45+
- [`Result::inspect`](https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.inspect)
46+
- [`Result::inspect_err`](https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.inspect_err)
47+
- [`Option::inspect`](https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.inspect)
48+
- [`type_name_of_val`](https://doc.rust-lang.org/stable/std/any/fn.type_name_of_val.html)
49+
- [`std::hash::{DefaultHasher, RandomState}`](https://doc.rust-lang.org/stable/std/hash/index.html#structs)
50+
These were previously available only through `std::collections::hash_map`.
51+
- [`ptr::{from_ref, from_mut}`](https://doc.rust-lang.org/stable/std/ptr/fn.from_ref.html)
52+
- [`ptr::addr_eq`](https://doc.rust-lang.org/stable/std/ptr/fn.addr_eq.html)
53+
54+
<a id="1.76.0-Cargo"></a>
55+
56+
Cargo
57+
-----
58+
59+
See [Cargo release notes](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-176-2024-02-08).
60+
61+
<a id="1.76.0-Rustdoc"></a>
62+
63+
Rustdoc
64+
-------
65+
66+
- [Don't merge cfg and doc(cfg) attributes for re-exports](https://github.com/rust-lang/rust/pull/113091/)
67+
- [rustdoc: allow resizing the sidebar / hiding the top bar](https://github.com/rust-lang/rust/pull/115660/)
68+
- [rustdoc-search: add support for traits and associated types](https://github.com/rust-lang/rust/pull/116085/)
69+
- [rustdoc: Add highlighting for comments in items declaration](https://github.com/rust-lang/rust/pull/117869/)
70+
71+
<a id="1.76.0-Compatibility-Notes"></a>
72+
73+
Compatibility Notes
74+
-------------------
75+
- [Add allow-by-default lint for unit bindings](https://github.com/rust-lang/rust/pull/112380/)
76+
This is expected to be upgraded to a warning by default in a future Rust
77+
release. Some macros emit bindings with type `()` with user-provided spans,
78+
which means that this lint will warn for user code.
79+
- [Remove x86_64-sun-solaris target.](https://github.com/rust-lang/rust/pull/118091/)
80+
- [Remove asmjs-unknown-emscripten target](https://github.com/rust-lang/rust/pull/117338/)
81+
- [Report errors in jobserver inherited through environment variables](https://github.com/rust-lang/rust/pull/113730/)
82+
This [may warn](https://github.com/rust-lang/rust/issues/120515) on benign problems too.
83+
- [Update the minimum external LLVM to 16.](https://github.com/rust-lang/rust/pull/117947/)
84+
- [Improve `print_tts`](https://github.com/rust-lang/rust/pull/114571/)
85+
This change can break some naive manual parsing of token trees in proc macro
86+
code which expect a particular structure after `.to_string()`, rather than just arbitrary Rust code.
87+
- [Make `IMPLIED_BOUNDS_ENTAILMENT` into a hard error from a lint](https://github.com/rust-lang/rust/pull/117984/)
88+
- [Vec's allocation behavior was changed when collecting some iterators](https://github.com/rust-lang/rust/pull/110353)
89+
Allocation behavior is currently not specified, nevertheless changes can be surprising.
90+
See [`impl FromIterator for Vec`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#impl-FromIterator%3CT%3E-for-Vec%3CT%3E)
91+
for more details.
92+
- [Properly reject `default` on free const items](https://github.com/rust-lang/rust/pull/117818/)
93+
194
Version 1.75.0 (2023-12-28)
295
==========================
396

compiler/rustc_arena/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#![cfg_attr(test, feature(test))]
2323
#![feature(strict_provenance)]
2424
#![deny(unsafe_op_in_unsafe_fn)]
25-
#![deny(rustc::untranslatable_diagnostic)]
26-
#![deny(rustc::diagnostic_outside_of_impl)]
2725
#![allow(internal_features)]
2826
#![allow(clippy::mut_from_ref)] // Arena allocators are one of the places where this pattern is fine.
2927

compiler/rustc_ast/src/ast.rs

+26-3
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,16 @@ pub use crate::node_id::{NodeId, CRATE_NODE_ID, DUMMY_NODE_ID};
291291
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)]
292292
pub struct TraitBoundModifiers {
293293
pub constness: BoundConstness,
294+
pub asyncness: BoundAsyncness,
294295
pub polarity: BoundPolarity,
295296
}
296297

297298
impl TraitBoundModifiers {
298-
pub const NONE: Self =
299-
Self { constness: BoundConstness::Never, polarity: BoundPolarity::Positive };
299+
pub const NONE: Self = Self {
300+
constness: BoundConstness::Never,
301+
asyncness: BoundAsyncness::Normal,
302+
polarity: BoundPolarity::Positive,
303+
};
300304
}
301305

302306
/// The AST represents all type param bounds as types.
@@ -2562,6 +2566,25 @@ impl BoundConstness {
25622566
}
25632567
}
25642568

2569+
/// The asyncness of a trait bound.
2570+
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)]
2571+
#[derive(HashStable_Generic)]
2572+
pub enum BoundAsyncness {
2573+
/// `Type: Trait`
2574+
Normal,
2575+
/// `Type: async Trait`
2576+
Async(Span),
2577+
}
2578+
2579+
impl BoundAsyncness {
2580+
pub fn as_str(self) -> &'static str {
2581+
match self {
2582+
Self::Normal => "",
2583+
Self::Async(_) => "async",
2584+
}
2585+
}
2586+
}
2587+
25652588
#[derive(Clone, Encodable, Decodable, Debug)]
25662589
pub enum FnRetTy {
25672590
/// Returns type is not specified.
@@ -3300,7 +3323,7 @@ mod size_asserts {
33003323
static_assert_size!(ForeignItem, 96);
33013324
static_assert_size!(ForeignItemKind, 24);
33023325
static_assert_size!(GenericArg, 24);
3303-
static_assert_size!(GenericBound, 72);
3326+
static_assert_size!(GenericBound, 88);
33043327
static_assert_size!(Generics, 40);
33053328
static_assert_size!(Impl, 136);
33063329
static_assert_size!(Item, 136);

compiler/rustc_ast/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#![feature(min_specialization)]
1919
#![feature(negative_impls)]
2020
#![feature(stmt_expr_attributes)]
21-
#![deny(rustc::untranslatable_diagnostic)]
22-
#![deny(rustc::diagnostic_outside_of_impl)]
2321

2422
#[macro_use]
2523
extern crate rustc_macros;

compiler/rustc_ast_lowering/messages.ftl

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ ast_lowering_argument = argument
1111
ast_lowering_assoc_ty_parentheses =
1212
parenthesized generic arguments cannot be used in associated type constraints
1313
14+
ast_lowering_async_bound_not_on_trait =
15+
`async` bound modifier only allowed on trait, not `{$descr}`
16+
17+
ast_lowering_async_bound_only_for_fn_traits =
18+
`async` bound modifier only allowed on `Fn`/`FnMut`/`FnOnce` traits
19+
1420
ast_lowering_async_coroutines_not_supported =
1521
`async` coroutines are not yet supported
1622
@@ -117,9 +123,6 @@ ast_lowering_never_pattern_with_guard =
117123
a guard on a never pattern will never be run
118124
.suggestion = remove this guard
119125
120-
ast_lowering_not_supported_for_lifetime_binder_async_closure =
121-
`for<...>` binders on `async` closures are not currently supported
122-
123126
ast_lowering_previously_used_here = previously used here
124127
125128
ast_lowering_register1 = register `{$reg1_name}`

compiler/rustc_ast_lowering/src/asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
205205
&sym.qself,
206206
&sym.path,
207207
ParamMode::Optional,
208-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
208+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
209209
None,
210210
);
211211
hir::InlineAsmOperand::SymStatic { path, def_id }

0 commit comments

Comments
 (0)