Skip to content

Commit 9f3c3ff

Browse files
committed
Auto merge of #2804 - saethlin:rustup, r=RalfJung
Rustup
2 parents 72014a8 + d56332e commit 9f3c3ff

File tree

762 files changed

+14366
-8634
lines changed

Some content is hidden

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

762 files changed

+14366
-8634
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
NO_DEBUG_ASSERTIONS: 1
323323
NO_OVERFLOW_CHECKS: 1
324324
DIST_REQUIRE_ALL_TOOLS: 1
325-
os: macos-latest
325+
os: macos-12-xl
326326
- name: dist-apple-various
327327
env:
328328
SCRIPT: "./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim"
@@ -333,7 +333,7 @@ jobs:
333333
NO_LLVM_ASSERTIONS: 1
334334
NO_DEBUG_ASSERTIONS: 1
335335
NO_OVERFLOW_CHECKS: 1
336-
os: macos-latest
336+
os: macos-12-xl
337337
- name: dist-x86_64-apple-alt
338338
env:
339339
SCRIPT: "./x.py dist bootstrap --include-default-paths"
@@ -344,7 +344,7 @@ jobs:
344344
NO_LLVM_ASSERTIONS: 1
345345
NO_DEBUG_ASSERTIONS: 1
346346
NO_OVERFLOW_CHECKS: 1
347-
os: macos-latest
347+
os: macos-12-xl
348348
- name: x86_64-apple-1
349349
env:
350350
SCRIPT: "./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps"
@@ -355,7 +355,7 @@ jobs:
355355
NO_LLVM_ASSERTIONS: 1
356356
NO_DEBUG_ASSERTIONS: 1
357357
NO_OVERFLOW_CHECKS: 1
358-
os: macos-latest
358+
os: macos-12-xl
359359
- name: x86_64-apple-2
360360
env:
361361
SCRIPT: "./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps"
@@ -366,7 +366,7 @@ jobs:
366366
NO_LLVM_ASSERTIONS: 1
367367
NO_DEBUG_ASSERTIONS: 1
368368
NO_OVERFLOW_CHECKS: 1
369-
os: macos-latest
369+
os: macos-12-xl
370370
- name: dist-aarch64-apple
371371
env:
372372
SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2"
@@ -381,7 +381,7 @@ jobs:
381381
NO_OVERFLOW_CHECKS: 1
382382
DIST_REQUIRE_ALL_TOOLS: 1
383383
JEMALLOC_SYS_WITH_LG_PAGE: 14
384-
os: macos-latest
384+
os: macos-12-xl
385385
- name: x86_64-msvc-1
386386
env:
387387
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"

.mailmap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Adrien Tétar <adri-from-59@hotmail.fr>
1515
Ahmed Charles <ahmedcharles@gmail.com> <acharles@outlook.com>
1616
Alan Egerton <eggyal@gmail.com>
1717
Alan Stoate <alan.stoate@gmail.com>
18-
Albert Larsan <albert.larsan@gmail.com> Albert Larsan <74931857+albertlarsan68@users.noreply.github.com>
18+
Albert Larsan <albert.larsan@gmail.com> <74931857+albertlarsan68@users.noreply.github.com>
1919
Alessandro Decina <alessandro.d@gmail.com>
2020
Alex Burka <durka42+github@gmail.com> Alex Burka <aburka@seas.upenn.edu>
2121
Alex Hansen <ahansen2@trinity.edu>

Cargo.lock

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,9 +1373,9 @@ dependencies = [
13731373

13741374
[[package]]
13751375
name = "ena"
1376-
version = "0.14.0"
1376+
version = "0.14.1"
13771377
source = "registry+https://github.com/rust-lang/crates.io-index"
1378-
checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3"
1378+
checksum = "b2e5d13ca2353ab7d0230988629def93914a8c4015f621f9b13ed2955614731d"
13791379
dependencies = [
13801380
"log",
13811381
]
@@ -1922,15 +1922,6 @@ dependencies = [
19221922
"libc",
19231923
]
19241924

1925-
[[package]]
1926-
name = "hermit-abi"
1927-
version = "0.2.6"
1928-
source = "registry+https://github.com/rust-lang/crates.io-index"
1929-
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
1930-
dependencies = [
1931-
"libc",
1932-
]
1933-
19341925
[[package]]
19351926
name = "hermit-abi"
19361927
version = "0.3.0"
@@ -2222,14 +2213,14 @@ dependencies = [
22222213

22232214
[[package]]
22242215
name = "is-terminal"
2225-
version = "0.4.2"
2216+
version = "0.4.4"
22262217
source = "registry+https://github.com/rust-lang/crates.io-index"
2227-
checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
2218+
checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857"
22282219
dependencies = [
2229-
"hermit-abi 0.2.6",
2220+
"hermit-abi 0.3.0",
22302221
"io-lifetimes",
22312222
"rustix",
2232-
"windows-sys 0.42.0",
2223+
"windows-sys 0.45.0",
22332224
]
22342225

22352226
[[package]]
@@ -2260,9 +2251,9 @@ dependencies = [
22602251

22612252
[[package]]
22622253
name = "jobserver"
2263-
version = "0.1.24"
2254+
version = "0.1.26"
22642255
source = "registry+https://github.com/rust-lang/crates.io-index"
2265-
checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
2256+
checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
22662257
dependencies = [
22672258
"libc",
22682259
]
@@ -2328,9 +2319,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
23282319

23292320
[[package]]
23302321
name = "libc"
2331-
version = "0.2.138"
2322+
version = "0.2.139"
23322323
source = "registry+https://github.com/rust-lang/crates.io-index"
2333-
checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8"
2324+
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
23342325
dependencies = [
23352326
"rustc-std-workspace-core",
23362327
]
@@ -3810,6 +3801,8 @@ dependencies = [
38103801
"rustc_span",
38113802
"rustc_symbol_mangling",
38123803
"rustc_target",
3804+
"serde",
3805+
"serde_json",
38133806
"smallvec",
38143807
"tempfile",
38153808
"tracing",

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# The Rust Programming Language
22

3+
[![Rust Community](https://img.shields.io/badge/Rust_Community%20-Join_us-brightgreen?style=plastic&logo=rust)](https://www.rust-lang.org/community)
4+
35
This is the main source code repository for [Rust]. It contains the compiler,
46
standard library, and documentation.
57

compiler/rustc_abi/src/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,14 +1505,6 @@ pub struct PointeeInfo {
15051505
pub safe: Option<PointerKind>,
15061506
}
15071507

1508-
/// Used in `might_permit_raw_init` to indicate the kind of initialisation
1509-
/// that is checked to be valid
1510-
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
1511-
pub enum InitKind {
1512-
Zero,
1513-
UninitMitigated0x01Fill,
1514-
}
1515-
15161508
impl LayoutS {
15171509
/// Returns `true` if the layout corresponds to an unsized type.
15181510
pub fn is_unsized(&self) -> bool {

compiler/rustc_ast/src/util/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl AssocOp {
225225
AssignOp(_) | // `{ 42 } +=`
226226
As | // `{ 42 } as usize`
227227
// Equal | // `{ 42 } == { 42 }` Accepting these here would regress incorrect
228-
// NotEqual | // `{ 42 } != { 42 } struct literals parser recovery.
228+
// NotEqual | // `{ 42 } != { 42 }` struct literals parser recovery.
229229
Colon, // `{ 42 }: usize`
230230
)
231231
}

compiler/rustc_ast_lowering/locales/en-US.ftl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ ast_lowering_misplaced_impl_trait =
2222
ast_lowering_misplaced_assoc_ty_binding =
2323
associated type bounds are only allowed in where clauses and function signatures, not in {$position}
2424
25-
ast_lowering_rustc_box_attribute_error =
26-
#[rustc_box] requires precisely one argument and no other attributes are allowed
27-
2825
ast_lowering_underscore_expr_lhs_assign =
2926
in expressions, `_` can only be used on the left-hand side of an assignment
3027
.label = `_` not allowed here

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ pub struct MisplacedAssocTyBinding<'a> {
8787
pub position: DiagnosticArgFromDisplay<'a>,
8888
}
8989

90-
#[derive(Diagnostic, Clone, Copy)]
91-
#[diag(ast_lowering_rustc_box_attribute_error)]
92-
pub struct RustcBoxAttributeError {
93-
#[primary_span]
94-
pub span: Span,
95-
}
96-
9790
#[derive(Diagnostic, Clone, Copy)]
9891
#[diag(ast_lowering_underscore_expr_lhs_assign)]
9992
pub struct UnderscoreExprLhsAssign {

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::errors::{
22
AsyncGeneratorsNotSupported, AsyncNonMoveClosureNotSupported, AwaitOnlyInAsyncFnAndBlocks,
33
BaseExpressionDoubleDot, ClosureCannotBeStatic, FunctionalRecordUpdateDestructuringAssignemnt,
44
GeneratorTooManyParameters, InclusiveRangeWithNoEnd, NotSupportedForLifetimeBinderAsyncClosure,
5-
RustcBoxAttributeError, UnderscoreExprLhsAssign,
5+
UnderscoreExprLhsAssign,
66
};
77
use super::ResolverAstLoweringExt;
88
use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};
@@ -83,15 +83,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
8383
}
8484
ExprKind::Tup(elts) => hir::ExprKind::Tup(self.lower_exprs(elts)),
8585
ExprKind::Call(f, args) => {
86-
if e.attrs.get(0).map_or(false, |a| a.has_name(sym::rustc_box)) {
87-
if let [inner] = &args[..] && e.attrs.len() == 1 {
88-
let kind = hir::ExprKind::Box(self.lower_expr(&inner));
89-
return hir::Expr { hir_id, kind, span: self.lower_span(e.span) };
90-
} else {
91-
let guar = self.tcx.sess.emit_err(RustcBoxAttributeError { span: e.span });
92-
hir::ExprKind::Err(guar)
93-
}
94-
} else if let Some(legacy_args) = self.resolver.legacy_const_generic_args(f) {
86+
if let Some(legacy_args) = self.resolver.legacy_const_generic_args(f) {
9587
self.lower_legacy_const_generics((**f).clone(), args.clone(), &legacy_args)
9688
} else {
9789
let f = self.lower_expr(f);

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_hir::def::{DefKind, Res};
1313
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID};
1414
use rustc_hir::PredicateOrigin;
1515
use rustc_index::vec::{Idx, IndexVec};
16-
use rustc_middle::ty::{DefIdTree, ResolverAstLowering, TyCtxt};
16+
use rustc_middle::ty::{ResolverAstLowering, TyCtxt};
1717
use rustc_span::edit_distance::find_best_match_for_name;
1818
use rustc_span::source_map::DesugaringKind;
1919
use rustc_span::symbol::{kw, sym, Ident};
@@ -1339,13 +1339,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
13391339
.map(|predicate| self.lower_where_predicate(predicate)),
13401340
);
13411341

1342-
let mut params: SmallVec<[hir::GenericParam<'hir>; 4]> =
1343-
self.lower_generic_params_mut(&generics.params).collect();
1342+
let mut params: SmallVec<[hir::GenericParam<'hir>; 4]> = self
1343+
.lower_generic_params_mut(&generics.params, hir::GenericParamSource::Generics)
1344+
.collect();
13441345

13451346
// Introduce extra lifetimes if late resolution tells us to.
13461347
let extra_lifetimes = self.resolver.take_extra_lifetime_params(parent_node_id);
13471348
params.extend(extra_lifetimes.into_iter().filter_map(|(ident, node_id, res)| {
1348-
self.lifetime_res_to_generic_param(ident, node_id, res)
1349+
self.lifetime_res_to_generic_param(
1350+
ident,
1351+
node_id,
1352+
res,
1353+
hir::GenericParamSource::Generics,
1354+
)
13491355
}));
13501356

13511357
let has_where_clause_predicates = !generics.where_clause.predicates.is_empty();
@@ -1449,7 +1455,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
14491455
span,
14501456
}) => hir::WherePredicate::BoundPredicate(hir::WhereBoundPredicate {
14511457
hir_id: self.next_id(),
1452-
bound_generic_params: self.lower_generic_params(bound_generic_params),
1458+
bound_generic_params: self
1459+
.lower_generic_params(bound_generic_params, hir::GenericParamSource::Binder),
14531460
bounded_ty: self
14541461
.lower_ty(bounded_ty, &ImplTraitContext::Disallowed(ImplTraitPosition::Bound)),
14551462
bounds: self.arena.alloc_from_iter(bounds.iter().map(|bound| {

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
804804
ident: Ident,
805805
node_id: NodeId,
806806
res: LifetimeRes,
807+
source: hir::GenericParamSource,
807808
) -> Option<hir::GenericParam<'hir>> {
808809
let (name, kind) = match res {
809810
LifetimeRes::Param { .. } => {
@@ -837,6 +838,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
837838
pure_wrt_drop: false,
838839
kind: hir::GenericParamKind::Lifetime { kind },
839840
colon_span: None,
841+
source,
840842
})
841843
}
842844

@@ -852,11 +854,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
852854
binder: NodeId,
853855
generic_params: &[GenericParam],
854856
) -> &'hir [hir::GenericParam<'hir>] {
855-
let mut generic_params: Vec<_> = self.lower_generic_params_mut(generic_params).collect();
857+
let mut generic_params: Vec<_> = self
858+
.lower_generic_params_mut(generic_params, hir::GenericParamSource::Binder)
859+
.collect();
856860
let extra_lifetimes = self.resolver.take_extra_lifetime_params(binder);
857861
debug!(?extra_lifetimes);
858862
generic_params.extend(extra_lifetimes.into_iter().filter_map(|(ident, node_id, res)| {
859-
self.lifetime_res_to_generic_param(ident, node_id, res)
863+
self.lifetime_res_to_generic_param(ident, node_id, res, hir::GenericParamSource::Binder)
860864
}));
861865
let generic_params = self.arena.alloc_from_iter(generic_params);
862866
debug!(?generic_params);
@@ -1375,8 +1379,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13751379
span,
13761380
);
13771381
let ident = Ident::from_str_and_span(&pprust::ty_to_string(t), span);
1378-
let (param, bounds, path) =
1379-
self.lower_generic_and_bounds(*def_node_id, span, ident, bounds);
1382+
let (param, bounds, path) = self.lower_universal_param_and_bounds(
1383+
*def_node_id,
1384+
span,
1385+
ident,
1386+
bounds,
1387+
);
13801388
self.impl_trait_defs.push(param);
13811389
if let Some(bounds) = bounds {
13821390
self.impl_trait_bounds.push(bounds);
@@ -1530,6 +1538,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15301538
pure_wrt_drop: false,
15311539
kind: hir::GenericParamKind::Lifetime { kind },
15321540
colon_span: None,
1541+
source: hir::GenericParamSource::Generics,
15331542
}
15341543
},
15351544
));
@@ -1598,7 +1607,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15981607
hir::OwnerNode::Item(self.arena.alloc(opaque_ty_item))
15991608
}
16001609

1601-
/// Given a `parent_def_id`, a list of `lifetimes_in_bounds and a `remapping` hash to be
1610+
/// Given a `parent_def_id`, a list of `lifetimes_in_bounds` and a `remapping` hash to be
16021611
/// filled, this function creates new definitions for `Param` and `Fresh` lifetimes, inserts the
16031612
/// new definition, adds it to the remapping with the definition of the given lifetime and
16041613
/// returns a list of lifetimes to be lowered afterwards.
@@ -1987,6 +1996,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19871996
pure_wrt_drop: false,
19881997
kind: hir::GenericParamKind::Lifetime { kind },
19891998
colon_span: None,
1999+
source: hir::GenericParamSource::Generics,
19902000
}
19912001
},
19922002
));
@@ -2152,16 +2162,25 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
21522162
fn lower_generic_params_mut<'s>(
21532163
&'s mut self,
21542164
params: &'s [GenericParam],
2165+
source: hir::GenericParamSource,
21552166
) -> impl Iterator<Item = hir::GenericParam<'hir>> + Captures<'a> + Captures<'s> {
2156-
params.iter().map(move |param| self.lower_generic_param(param))
2167+
params.iter().map(move |param| self.lower_generic_param(param, source))
21572168
}
21582169

2159-
fn lower_generic_params(&mut self, params: &[GenericParam]) -> &'hir [hir::GenericParam<'hir>] {
2160-
self.arena.alloc_from_iter(self.lower_generic_params_mut(params))
2170+
fn lower_generic_params(
2171+
&mut self,
2172+
params: &[GenericParam],
2173+
source: hir::GenericParamSource,
2174+
) -> &'hir [hir::GenericParam<'hir>] {
2175+
self.arena.alloc_from_iter(self.lower_generic_params_mut(params, source))
21612176
}
21622177

21632178
#[instrument(level = "trace", skip(self))]
2164-
fn lower_generic_param(&mut self, param: &GenericParam) -> hir::GenericParam<'hir> {
2179+
fn lower_generic_param(
2180+
&mut self,
2181+
param: &GenericParam,
2182+
source: hir::GenericParamSource,
2183+
) -> hir::GenericParam<'hir> {
21652184
let (name, kind) = self.lower_generic_param_kind(param);
21662185

21672186
let hir_id = self.lower_node_id(param.id);
@@ -2174,6 +2193,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
21742193
pure_wrt_drop: self.tcx.sess.contains_name(&param.attrs, sym::may_dangle),
21752194
kind,
21762195
colon_span: param.colon_span.map(|s| self.lower_span(s)),
2196+
source,
21772197
}
21782198
}
21792199

@@ -2266,7 +2286,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22662286
}
22672287

22682288
#[instrument(level = "debug", skip(self), ret)]
2269-
fn lower_generic_and_bounds(
2289+
fn lower_universal_param_and_bounds(
22702290
&mut self,
22712291
node_id: NodeId,
22722292
span: Span,
@@ -2286,6 +2306,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22862306
span,
22872307
kind: hir::GenericParamKind::Type { default: None, synthetic: true },
22882308
colon_span: None,
2309+
source: hir::GenericParamSource::Generics,
22892310
};
22902311

22912312
let preds = self.lower_generic_bound_predicate(

0 commit comments

Comments
 (0)