Skip to content

Commit 35551d0

Browse files
committed
Auto merge of #3291 - rust-lang:rustup-2024-02-06, r=saethlin
Automatic Rustup
2 parents f45a5b1 + 08e7741 commit 35551d0

File tree

927 files changed

+11702
-10321
lines changed

Some content is hidden

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

927 files changed

+11702
-10321
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
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
@@ -365,7 +365,7 @@ jobs:
365365
- name: dist-aarch64-apple
366366
env:
367367
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"
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"
369369
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
370370
SELECT_XCODE: /Applications/Xcode_13.4.1.app
371371
USE_XCODE_CLANG: 1

Cargo.lock

Lines changed: 8 additions & 8 deletions
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",
@@ -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
]
@@ -6406,18 +6406,18 @@ dependencies = [
64066406

64076407
[[package]]
64086408
name = "zerocopy"
6409-
version = "0.7.28"
6409+
version = "0.7.32"
64106410
source = "registry+https://github.com/rust-lang/crates.io-index"
6411-
checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e"
6411+
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
64126412
dependencies = [
64136413
"zerocopy-derive",
64146414
]
64156415

64166416
[[package]]
64176417
name = "zerocopy-derive"
6418-
version = "0.7.28"
6418+
version = "0.7.32"
64196419
source = "registry+https://github.com/rust-lang/crates.io-index"
6420-
checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b"
6420+
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
64216421
dependencies = [
64226422
"proc-macro2",
64236423
"quote",

RELEASES.md

Lines changed: 93 additions & 0 deletions
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+
- [Warn against ambiguous wide pointer 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_ast/src/ast.rs

Lines changed: 26 additions & 3 deletions
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_lowering/messages.ftl

Lines changed: 6 additions & 0 deletions
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

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,3 +395,18 @@ pub(crate) struct GenericParamDefaultInBinder {
395395
#[primary_span]
396396
pub span: Span,
397397
}
398+
399+
#[derive(Diagnostic)]
400+
#[diag(ast_lowering_async_bound_not_on_trait)]
401+
pub(crate) struct AsyncBoundNotOnTrait {
402+
#[primary_span]
403+
pub span: Span,
404+
pub descr: &'static str,
405+
}
406+
407+
#[derive(Diagnostic)]
408+
#[diag(ast_lowering_async_bound_only_for_fn_traits)]
409+
pub(crate) struct AsyncBoundOnlyForFnTraits {
410+
#[primary_span]
411+
pub span: Span,
412+
}

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
100100
ParenthesizedGenericArgs::Err,
101101
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
102102
None,
103+
// Method calls can't have bound modifiers
104+
None,
103105
));
104106
let receiver = self.lower_expr(receiver);
105107
let args =

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(super) struct ItemLowerer<'a, 'hir> {
2525
pub(super) tcx: TyCtxt<'hir>,
2626
pub(super) resolver: &'a mut ResolverAstLowering,
2727
pub(super) ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>,
28-
pub(super) owners: &'a mut IndexVec<LocalDefId, hir::MaybeOwner<&'hir hir::OwnerInfo<'hir>>>,
28+
pub(super) owners: &'a mut IndexVec<LocalDefId, hir::MaybeOwner<'hir>>,
2929
}
3030

3131
/// When we have a ty alias we *may* have two where clauses. To give the best diagnostics, we set the span
@@ -64,10 +64,7 @@ impl<'a, 'hir> ItemLowerer<'a, 'hir> {
6464
}
6565
}
6666

67-
pub(super) fn lower_node(
68-
&mut self,
69-
def_id: LocalDefId,
70-
) -> hir::MaybeOwner<&'hir hir::OwnerInfo<'hir>> {
67+
pub(super) fn lower_node(&mut self, def_id: LocalDefId) -> hir::MaybeOwner<'hir> {
7168
let owner = self.owners.ensure_contains_elem(def_id, || hir::MaybeOwner::Phantom);
7269
if let hir::MaybeOwner::Phantom = owner {
7370
let node = self.ast_index[def_id];
@@ -343,14 +340,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
343340
let itctx = ImplTraitContext::Universal;
344341
let (generics, (trait_ref, lowered_ty)) =
345342
self.lower_generics(ast_generics, *constness, id, &itctx, |this| {
346-
let constness = match *constness {
347-
Const::Yes(span) => BoundConstness::Maybe(span),
348-
Const::No => BoundConstness::Never,
343+
let modifiers = TraitBoundModifiers {
344+
constness: match *constness {
345+
Const::Yes(span) => BoundConstness::Maybe(span),
346+
Const::No => BoundConstness::Never,
347+
},
348+
asyncness: BoundAsyncness::Normal,
349+
// we don't use this in bound lowering
350+
polarity: BoundPolarity::Positive,
349351
};
350352

351353
let trait_ref = trait_ref.as_ref().map(|trait_ref| {
352354
this.lower_trait_ref(
353-
constness,
355+
modifiers,
354356
trait_ref,
355357
&ImplTraitContext::Disallowed(ImplTraitPosition::Trait),
356358
)

0 commit comments

Comments
 (0)