Skip to content

Commit 2f13379

Browse files
committed
Auto merge of rust-lang#3844 - rust-lang:rustup-2024-08-26, r=RalfJung
Automatic Rustup
2 parents dbfd066 + 9fb611c commit 2f13379

File tree

859 files changed

+10888
-6886
lines changed

Some content is hidden

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

859 files changed

+10888
-6886
lines changed

.github/workflows/dependencies.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ jobs:
6464
- name: cargo update
6565
# Remove first line that always just says "Updating crates.io index"
6666
run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
67+
- name: cargo update library
68+
run: |
69+
echo -e "\nlibrary dependencies:" >> cargo_update.log
70+
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
6771
- name: cargo update rustbook
6872
run: |
6973
echo -e "\nrustbook dependencies:" >> cargo_update.log
@@ -74,6 +78,7 @@ jobs:
7478
name: Cargo-lock
7579
path: |
7680
Cargo.lock
81+
library/Cargo.lock
7782
src/tools/rustbook/Cargo.lock
7883
retention-days: 1
7984
- name: upload cargo-update log artifact for use in PR
@@ -119,7 +124,7 @@ jobs:
119124
git config user.name github-actions
120125
git config user.email [email protected]
121126
git switch --force-create cargo_update
122-
git add ./Cargo.lock ./src/tools/rustbook/Cargo.lock
127+
git add ./Cargo.lock ./library/Cargo.lock ./src/tools/rustbook/Cargo.lock
123128
git commit --no-verify --file=commit.txt
124129
125130
- name: push

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ build/
5656
/src/tools/x/target
5757
# Created by default with `src/ci/docker/run.sh`
5858
/obj/
59-
/rustc-ice*
59+
60+
## ICE reports
61+
rustc-ice-*.txt
6062

6163
## Temporary files
6264
*~

Cargo.lock

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,6 @@ dependencies = [
9494
"yansi-term",
9595
]
9696

97-
[[package]]
98-
name = "annotate-snippets"
99-
version = "0.10.2"
100-
source = "registry+https://github.com/rust-lang/crates.io-index"
101-
checksum = "6d9b665789884a7e8fb06c84b295e923b03ca51edbb7d08f91a6a50322ecbfe6"
102-
dependencies = [
103-
"anstyle",
104-
"unicode-width",
105-
]
106-
10797
[[package]]
10898
name = "annotate-snippets"
10999
version = "0.11.4"
@@ -205,9 +195,9 @@ dependencies = [
205195

206196
[[package]]
207197
name = "ar_archive_writer"
208-
version = "0.4.0"
198+
version = "0.4.2"
209199
source = "registry+https://github.com/rust-lang/crates.io-index"
210-
checksum = "de11a9d32db3327f981143bdf699ade4d637c6887b13b97e6e91a9154666963c"
200+
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
211201
dependencies = [
212202
"object 0.36.3",
213203
]
@@ -420,12 +410,9 @@ version = "0.1.0"
420410

421411
[[package]]
422412
name = "cc"
423-
version = "1.1.13"
413+
version = "1.0.105"
424414
source = "registry+https://github.com/rust-lang/crates.io-index"
425-
checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48"
426-
dependencies = [
427-
"shlex",
428-
]
415+
checksum = "5208975e568d83b6b05cc0a063c8e7e9acc2b43bee6da15616a5b73e109d7437"
429416

430417
[[package]]
431418
name = "cfg-if"
@@ -549,6 +536,7 @@ name = "clippy"
549536
version = "0.1.82"
550537
dependencies = [
551538
"anstream",
539+
"cargo_metadata 0.18.1",
552540
"clippy_config",
553541
"clippy_lints",
554542
"clippy_utils",
@@ -562,6 +550,7 @@ dependencies = [
562550
"regex",
563551
"rustc_tools_util",
564552
"serde",
553+
"serde_json",
565554
"syn 2.0.75",
566555
"tempfile",
567556
"termize",
@@ -576,7 +565,6 @@ name = "clippy_config"
576565
version = "0.1.82"
577566
dependencies = [
578567
"itertools",
579-
"rustc-semver",
580568
"serde",
581569
"toml 0.7.8",
582570
"walkdir",
@@ -608,7 +596,6 @@ dependencies = [
608596
"quine-mc_cluskey",
609597
"regex",
610598
"regex-syntax 0.8.4",
611-
"rustc-semver",
612599
"semver",
613600
"serde",
614601
"serde_json",
@@ -627,7 +614,6 @@ dependencies = [
627614
"arrayvec",
628615
"clippy_config",
629616
"itertools",
630-
"rustc-semver",
631617
"rustc_apfloat",
632618
]
633619

@@ -2240,9 +2226,12 @@ dependencies = [
22402226

22412227
[[package]]
22422228
name = "minifier"
2243-
version = "0.3.0"
2229+
version = "0.3.1"
22442230
source = "registry+https://github.com/rust-lang/crates.io-index"
2245-
checksum = "95bbbf96b9ac3482c2a25450b67a15ed851319bc5fabf3b40742ea9066e84282"
2231+
checksum = "9aa3f302fe0f8de065d4a2d1ed64f60204623cac58b80cd3c2a83a25d5a7d437"
2232+
dependencies = [
2233+
"clap",
2234+
]
22462235

22472236
[[package]]
22482237
name = "minimal-lexical"
@@ -3139,6 +3128,7 @@ dependencies = [
31393128
"bstr",
31403129
"build_helper",
31413130
"gimli 0.31.0",
3131+
"libc",
31423132
"object 0.36.3",
31433133
"regex",
31443134
"serde_json",
@@ -3211,12 +3201,6 @@ dependencies = [
32113201
"num_cpus",
32123202
]
32133203

3214-
[[package]]
3215-
name = "rustc-semver"
3216-
version = "1.1.0"
3217-
source = "registry+https://github.com/rust-lang/crates.io-index"
3218-
checksum = "5be1bdc7edf596692617627bbfeaba522131b18e06ca4df2b6b689e3c5d5ce84"
3219-
32203204
[[package]]
32213205
name = "rustc-stable-hash"
32223206
version = "0.1.0"
@@ -3642,7 +3626,7 @@ dependencies = [
36423626
name = "rustc_errors"
36433627
version = "0.0.0"
36443628
dependencies = [
3645-
"annotate-snippets 0.10.2",
3629+
"annotate-snippets 0.11.4",
36463630
"derive_setters",
36473631
"rustc_ast",
36483632
"rustc_ast_pretty",
@@ -3702,7 +3686,7 @@ dependencies = [
37023686
name = "rustc_fluent_macro"
37033687
version = "0.0.0"
37043688
dependencies = [
3705-
"annotate-snippets 0.10.2",
3689+
"annotate-snippets 0.11.4",
37063690
"fluent-bundle",
37073691
"fluent-syntax",
37083692
"proc-macro2",
@@ -4552,6 +4536,7 @@ dependencies = [
45524536
"bitflags 2.6.0",
45534537
"derive-where",
45544538
"indexmap",
4539+
"rustc-hash",
45554540
"rustc_ast_ir",
45564541
"rustc_data_structures",
45574542
"rustc_index",

RELEASES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ Compatibility Notes
143143
- [Turn `proc_macro_back_compat` lint into a hard error.](https://github.com/rust-lang/rust/pull/125596/)
144144
- [Detect unused structs even when implementing private traits](https://github.com/rust-lang/rust/pull/122382/)
145145
- [`std::sync::ReentrantLockGuard<T>` is no longer `Sync` if `T: !Sync`](https://github.com/rust-lang/rust/pull/125527) which means [`std::io::StdoutLock` and `std::io::StderrLock` are no longer Sync](https://github.com/rust-lang/rust/issues/127340)
146+
- [Type inference will fail in some cases due to new implementations of `FromIterator for Box<str>`.](https://github.com/rust-lang/rust/pull/99969/)
147+
Notably, this breaks versions of the `time` crate before 0.3.35, due to no longer inferring the implementation for `Box<[_]>`.
146148

147149
<a id="1.80-Internal-Changes"></a>
148150

compiler/rustc_ast/src/ast.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,17 @@ pub struct AttrItem {
29022902
pub tokens: Option<LazyAttrTokenStream>,
29032903
}
29042904

2905+
impl AttrItem {
2906+
pub fn is_valid_for_outer_style(&self) -> bool {
2907+
self.path == sym::cfg_attr
2908+
|| self.path == sym::cfg
2909+
|| self.path == sym::forbid
2910+
|| self.path == sym::warn
2911+
|| self.path == sym::allow
2912+
|| self.path == sym::deny
2913+
}
2914+
}
2915+
29052916
/// `TraitRef`s appear in impls.
29062917
///
29072918
/// Resolution maps each `TraitRef`'s `ref_id` to its defining trait; that's all

compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
8686
// Multiple different abi names may actually be the same ABI
8787
// If the specified ABIs are not the same name, alert the user that they resolve to the same ABI
8888
let source_map = self.tcx.sess.source_map();
89-
let equivalent = (source_map.span_to_snippet(*prev_sp)
90-
!= source_map.span_to_snippet(*abi_span))
91-
.then_some(());
89+
let equivalent = source_map.span_to_snippet(*prev_sp)
90+
!= source_map.span_to_snippet(*abi_span);
9291

9392
self.dcx().emit_err(AbiSpecifiedMultipleTimes {
9493
abi_span: *abi_span,
@@ -221,7 +220,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
221220
let parent_def_id = self.current_def_id_parent;
222221
let node_id = self.next_node_id();
223222
// HACK(min_generic_const_args): see lower_anon_const
224-
if !expr.is_potential_trivial_const_arg() {
223+
if !self.tcx.features().const_arg_path
224+
|| !expr.is_potential_trivial_const_arg()
225+
{
225226
self.create_def(
226227
parent_def_id,
227228
node_id,

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub struct AbiSpecifiedMultipleTimes {
184184
#[label]
185185
pub prev_span: Span,
186186
#[note]
187-
pub equivalent: Option<()>,
187+
pub equivalent: bool,
188188
}
189189

190190
#[derive(Diagnostic)]

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
387387
let node_id = self.next_node_id();
388388

389389
// HACK(min_generic_const_args): see lower_anon_const
390-
if !arg.is_potential_trivial_const_arg() {
390+
if !self.tcx.features().const_arg_path || !arg.is_potential_trivial_const_arg() {
391391
// Add a definition for the in-band const def.
392392
self.create_def(parent_def_id, node_id, kw::Empty, DefKind::AnonConst, f.span);
393393
}

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14211421
};
14221422
hir::FnHeader {
14231423
safety: self.lower_safety(h.safety, default_safety),
1424-
asyncness: asyncness,
1424+
asyncness,
14251425
constness: self.lower_constness(h.constness),
14261426
abi: self.lower_extern(h.ext),
14271427
}

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
23582358
span: Span,
23592359
) -> &'hir hir::ConstArg<'hir> {
23602360
let ct_kind = match res {
2361-
Res::Def(DefKind::ConstParam, _) => {
2361+
Res::Def(DefKind::ConstParam, _) if self.tcx.features().const_arg_path => {
23622362
let qpath = self.lower_qpath(
23632363
ty_id,
23642364
&None,
@@ -2433,7 +2433,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
24332433
self.resolver.get_partial_res(expr.id).and_then(|partial_res| partial_res.full_res());
24342434
debug!("res={:?}", maybe_res);
24352435
// FIXME(min_generic_const_args): for now we only lower params to ConstArgKind::Path
2436-
if let Some(res) = maybe_res
2436+
if self.tcx.features().const_arg_path
2437+
&& let Some(res) = maybe_res
24372438
&& let Res::Def(DefKind::ConstParam, _) = res
24382439
&& let ExprKind::Path(qself, path) = &expr.kind
24392440
{
@@ -2464,7 +2465,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
24642465
/// See [`hir::ConstArg`] for when to use this function vs
24652466
/// [`Self::lower_anon_const_to_const_arg`].
24662467
fn lower_anon_const_to_anon_const(&mut self, c: &AnonConst) -> &'hir hir::AnonConst {
2467-
if c.value.is_potential_trivial_const_arg() {
2468+
if self.tcx.features().const_arg_path && c.value.is_potential_trivial_const_arg() {
24682469
// HACK(min_generic_const_args): see DefCollector::visit_anon_const
24692470
// Over there, we guess if this is a bare param and only create a def if
24702471
// we think it's not. However we may can guess wrong (see there for example)

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,8 @@ impl<'a> AstValidator<'a> {
562562
FnHeader { safety: _, coroutine_kind, constness, ext }: FnHeader,
563563
) {
564564
let report_err = |span| {
565-
self.dcx().emit_err(errors::FnQualifierInExtern {
566-
span: span,
567-
block: self.current_extern_span(),
568-
});
565+
self.dcx()
566+
.emit_err(errors::FnQualifierInExtern { span, block: self.current_extern_span() });
569567
};
570568
match coroutine_kind {
571569
Some(knd) => report_err(knd.span()),
@@ -963,14 +961,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
963961
self_ty,
964962
items,
965963
}) => {
966-
let error =
967-
|annotation_span, annotation, only_trait: bool| errors::InherentImplCannot {
968-
span: self_ty.span,
969-
annotation_span,
970-
annotation,
971-
self_ty: self_ty.span,
972-
only_trait: only_trait.then_some(()),
973-
};
964+
let error = |annotation_span, annotation, only_trait| errors::InherentImplCannot {
965+
span: self_ty.span,
966+
annotation_span,
967+
annotation,
968+
self_ty: self_ty.span,
969+
only_trait,
970+
};
974971

975972
self.with_in_trait_impl(None, |this| {
976973
this.visibility_not_permitted(
@@ -1195,7 +1192,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
11951192
} else if where_clauses.after.has_where_token {
11961193
self.dcx().emit_err(errors::WhereClauseAfterTypeAlias {
11971194
span: where_clauses.after.span,
1198-
help: self.session.is_nightly_build().then_some(()),
1195+
help: self.session.is_nightly_build(),
11991196
});
12001197
}
12011198
}

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ pub struct InherentImplCannot<'a> {
484484
#[label(ast_passes_type)]
485485
pub self_ty: Span,
486486
#[note(ast_passes_only_trait)]
487-
pub only_trait: Option<()>,
487+
pub only_trait: bool,
488488
}
489489

490490
#[derive(Diagnostic)]
@@ -528,7 +528,7 @@ pub struct WhereClauseAfterTypeAlias {
528528
#[primary_span]
529529
pub span: Span,
530530
#[help]
531-
pub help: Option<()>,
531+
pub help: bool,
532532
}
533533

534534
#[derive(Diagnostic)]

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
556556
gate_all!(fn_delegation, "functions delegation is not yet fully implemented");
557557
gate_all!(postfix_match, "postfix match is experimental");
558558
gate_all!(mut_ref, "mutable by-reference bindings are experimental");
559-
gate_all!(precise_capturing, "precise captures on `impl Trait` are experimental");
560559
gate_all!(global_registration, "global registration is experimental");
561560
gate_all!(return_type_notation, "return type notation is experimental");
562561

compiler/rustc_attr/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ pub fn find_deprecation(
846846
sess.dcx().emit_err(
847847
session_diagnostics::DeprecatedItemSuggestion {
848848
span: mi.span,
849-
is_nightly: sess.is_nightly_build().then_some(()),
849+
is_nightly: sess.is_nightly_build(),
850850
details: (),
851851
},
852852
);

compiler/rustc_attr/src/session_diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pub(crate) struct DeprecatedItemSuggestion {
342342
pub span: Span,
343343

344344
#[help]
345-
pub is_nightly: Option<()>,
345+
pub is_nightly: bool,
346346

347347
#[note]
348348
pub details: (),

compiler/rustc_borrowck/src/borrowck_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<'infcx, 'tcx> crate::MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
290290
ty: Ty<'_>,
291291
is_index: Option<bool>,
292292
) -> Diag<'infcx> {
293-
let type_name = match (&ty.kind(), is_index) {
293+
let type_name = match (ty.kind(), is_index) {
294294
(&ty::Array(_, _), Some(true)) | (&ty::Array(_, _), None) => "array",
295295
(&ty::Slice(_), _) => "slice",
296296
_ => span_bug!(move_from_span, "this path should not cause illegal move"),

compiler/rustc_borrowck/src/places_conflict.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fn place_components_conflict<'tcx>(
201201

202202
let base_ty = base.ty(body, tcx).ty;
203203

204-
match (elem, &base_ty.kind(), access) {
204+
match (elem, base_ty.kind(), access) {
205205
(_, _, Shallow(Some(ArtificialField::ArrayLength)))
206206
| (_, _, Shallow(Some(ArtificialField::FakeBorrow))) => {
207207
// The array length is like additional fields on the

0 commit comments

Comments
 (0)