Skip to content

Commit 55872a1

Browse files
authored
Merge pull request rust-lang#4294 from rust-lang/rustup-2025-04-26
Automatic Rustup
2 parents ea9037e + 6c2fa0b commit 55872a1

File tree

222 files changed

+3220
-2145
lines changed

Some content is hidden

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

222 files changed

+3220
-2145
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ jobs:
9191
# Check the `calculate_matrix` job to see how is the matrix defined.
9292
include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
9393
steps:
94+
- name: Install cargo in AWS CodeBuild
95+
if: matrix.codebuild
96+
run: |
97+
# Check if cargo is installed
98+
if ! command -v cargo &> /dev/null; then
99+
echo "Cargo not found, installing Rust..."
100+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
101+
# Make cargo available in PATH
102+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
103+
fi
104+
94105
- name: disable git crlf conversion
95106
run: git config --global core.autocrlf false
96107

@@ -165,6 +176,8 @@ jobs:
165176
run: src/ci/scripts/install-ninja.sh
166177

167178
- name: enable ipv6 on Docker
179+
# Don't run on codebuild because systemctl is not available
180+
if: ${{ !matrix.codebuild }}
168181
run: src/ci/scripts/enable-docker-ipv6.sh
169182

170183
# Disable automatic line ending conversion (again). On Windows, when we're

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4158,7 +4158,6 @@ dependencies = [
41584158
"rustc_data_structures",
41594159
"rustc_index",
41604160
"rustc_macros",
4161-
"rustc_serialize",
41624161
"rustc_type_ir",
41634162
"rustc_type_ir_macros",
41644163
"tracing",

INSTALL.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,31 @@ See [the rustc-dev-guide for more info][sysllvm].
7575

7676
2. Configure the build settings:
7777

78+
If you're unsure which build configurations to use and need a good default, you
79+
can run the interactive `x.py setup` command. This will guide you through selecting
80+
a config profile, setting up the LSP, configuring a Git hook, etc.
81+
82+
With `configure` script, you can handle multiple configurations in a single
83+
command which is useful to create complex/advanced config files. For example:
84+
7885
```sh
79-
./configure
86+
./configure --build=aarch64-unknown-linux-gnu \
87+
--enable-full-tools \
88+
--enable-profiler \
89+
--enable-sanitizers \
90+
--enable-compiler-docs \
91+
--set target.aarch64-unknown-linux-gnu.linker=clang \
92+
--set target.aarch64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
93+
--set target.aarch64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
94+
--set llvm.link-shared=true \
95+
--set llvm.thin-lto=true \
96+
--set llvm.libzstd=true \
97+
--set llvm.ninja=false \
98+
--set rust.debug-assertions=false \
99+
--set rust.jemalloc \
100+
--set rust.use-lld=true \
101+
--set rust.lto=thin \
102+
--set rust.codegen-units=1
80103
```
81104

82105
If you plan to use `x.py install` to create an installation, you can either

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ impl AttrArgs {
19271927
}
19281928

19291929
/// Delimited arguments, as used in `#[attr()/[]/{}]` or `mac!()/[]/{}`.
1930-
#[derive(Clone, Encodable, Decodable, Debug)]
1930+
#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)]
19311931
pub struct DelimArgs {
19321932
pub dspan: DelimSpan,
19331933
pub delim: Delimiter, // Note: `Delimiter::Invisible` never occurs
@@ -1942,18 +1942,6 @@ impl DelimArgs {
19421942
}
19431943
}
19441944

1945-
impl<CTX> HashStable<CTX> for DelimArgs
1946-
where
1947-
CTX: crate::HashStableContext,
1948-
{
1949-
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
1950-
let DelimArgs { dspan, delim, tokens } = self;
1951-
dspan.hash_stable(ctx, hasher);
1952-
delim.hash_stable(ctx, hasher);
1953-
tokens.hash_stable(ctx, hasher);
1954-
}
1955-
}
1956-
19571945
/// Represents a macro definition.
19581946
#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)]
19591947
pub struct MacroDef {

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9+
#![cfg_attr(bootstrap, feature(let_chains))]
910
#![doc(
1011
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
1112
test(attr(deny(warnings)))
@@ -14,7 +15,6 @@
1415
#![feature(associated_type_defaults)]
1516
#![feature(box_patterns)]
1617
#![feature(if_let_guard)]
17-
#![feature(let_chains)]
1818
#![feature(negative_impls)]
1919
#![feature(never_type)]
2020
#![feature(rustdoc_internals)]

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
3333
// tidy-alphabetical-start
3434
#![allow(internal_features)]
35+
#![cfg_attr(bootstrap, feature(let_chains))]
3536
#![doc(rust_logo)]
3637
#![feature(assert_matches)]
3738
#![feature(box_patterns)]
3839
#![feature(exact_size_is_empty)]
3940
#![feature(if_let_guard)]
40-
#![feature(let_chains)]
4141
#![feature(rustdoc_internals)]
4242
// tidy-alphabetical-end
4343

@@ -916,7 +916,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
916916
}
917917

918918
fn lower_delim_args(&self, args: &DelimArgs) -> DelimArgs {
919-
DelimArgs { dspan: args.dspan, delim: args.delim, tokens: args.tokens.clone() }
919+
args.clone()
920920
}
921921

922922
/// Lower an associated item constraint.

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
55
// tidy-alphabetical-start
66
#![allow(internal_features)]
7+
#![cfg_attr(bootstrap, feature(let_chains))]
78
#![doc(rust_logo)]
89
#![feature(box_patterns)]
910
#![feature(if_let_guard)]
1011
#![feature(iter_is_partitioned)]
11-
#![feature(let_chains)]
1212
#![feature(rustdoc_internals)]
1313
// tidy-alphabetical-end
1414

compiler/rustc_attr_data_structures/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// tidy-alphabetical-start
22
#![allow(internal_features)]
3+
#![cfg_attr(bootstrap, feature(let_chains))]
34
#![doc(rust_logo)]
4-
#![feature(let_chains)]
55
#![feature(rustdoc_internals)]
66
// tidy-alphabetical-end
77

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::collections::BTreeMap;
33
use std::ops::Deref;
44
use std::sync::LazyLock;
55

6-
use rustc_ast::{self as ast, DelimArgs};
6+
use rustc_ast as ast;
77
use rustc_attr_data_structures::AttributeKind;
88
use rustc_errors::{DiagCtxtHandle, Diagnostic};
99
use rustc_feature::Features;
@@ -315,11 +315,7 @@ impl<'sess> AttributeParser<'sess> {
315315
fn lower_attr_args(&self, args: &ast::AttrArgs, lower_span: impl Fn(Span) -> Span) -> AttrArgs {
316316
match args {
317317
ast::AttrArgs::Empty => AttrArgs::Empty,
318-
ast::AttrArgs::Delimited(args) => AttrArgs::Delimited(DelimArgs {
319-
dspan: args.dspan,
320-
delim: args.delim,
321-
tokens: args.tokens.clone(),
322-
}),
318+
ast::AttrArgs::Delimited(args) => AttrArgs::Delimited(args.clone()),
323319
// This is an inert key-value attribute - it will never be visible to macros
324320
// after it gets lowered to HIR. Therefore, we can extract literals to handle
325321
// nonterminals in `#[doc]` (e.g. `#[doc = $e]`).

compiler/rustc_attr_parsing/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
7878
// tidy-alphabetical-start
7979
#![allow(internal_features)]
80+
#![cfg_attr(bootstrap, feature(let_chains))]
8081
#![doc(rust_logo)]
81-
#![feature(let_chains)]
8282
#![feature(rustdoc_internals)]
8383
// tidy-alphabetical-end
8484

compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'tcx> UniverseInfo<'tcx> {
4949
UniverseInfo::RelateTys { expected, found }
5050
}
5151

52-
pub(crate) fn report_error(
52+
pub(crate) fn report_erroneous_element(
5353
&self,
5454
mbcx: &mut MirBorrowckCtxt<'_, '_, 'tcx>,
5555
placeholder: ty::PlaceholderRegion,
@@ -68,7 +68,7 @@ impl<'tcx> UniverseInfo<'tcx> {
6868
mbcx.buffer_error(err);
6969
}
7070
UniverseInfo::TypeOp(ref type_op_info) => {
71-
type_op_info.report_error(mbcx, placeholder, error_element, cause);
71+
type_op_info.report_erroneous_element(mbcx, placeholder, error_element, cause);
7272
}
7373
UniverseInfo::Other => {
7474
// FIXME: This error message isn't great, but it doesn't show
@@ -145,8 +145,11 @@ pub(crate) trait TypeOpInfo<'tcx> {
145145
error_region: Option<ty::Region<'tcx>>,
146146
) -> Option<Diag<'infcx>>;
147147

148+
/// Constraints require that `error_element` appear in the
149+
/// values of `placeholder`, but this cannot be proven to
150+
/// hold. Report an error.
148151
#[instrument(level = "debug", skip(self, mbcx))]
149-
fn report_error(
152+
fn report_erroneous_element(
150153
&self,
151154
mbcx: &mut MirBorrowckCtxt<'_, '_, 'tcx>,
152155
placeholder: ty::PlaceholderRegion,
@@ -190,12 +193,7 @@ pub(crate) trait TypeOpInfo<'tcx> {
190193
let nice_error = self.nice_error(mbcx, cause, placeholder_region, error_region);
191194

192195
debug!(?nice_error);
193-
194-
if let Some(nice_error) = nice_error {
195-
mbcx.buffer_error(nice_error);
196-
} else {
197-
mbcx.buffer_error(self.fallback_error(tcx, span));
198-
}
196+
mbcx.buffer_error(nice_error.unwrap_or_else(|| self.fallback_error(tcx, span)));
199197
}
200198
}
201199

@@ -450,7 +448,8 @@ fn try_extract_error_from_region_constraints<'a, 'tcx>(
450448
ty::ReVar(vid) => universe_of_region(vid),
451449
_ => ty::UniverseIndex::ROOT,
452450
};
453-
let matches =
451+
// Are the two regions the same?
452+
let regions_the_same =
454453
|a_region: Region<'tcx>, b_region: Region<'tcx>| match (a_region.kind(), b_region.kind()) {
455454
(RePlaceholder(a_p), RePlaceholder(b_p)) => a_p.bound == b_p.bound,
456455
_ => a_region == b_region,
@@ -459,7 +458,7 @@ fn try_extract_error_from_region_constraints<'a, 'tcx>(
459458
|constraint: &Constraint<'tcx>, cause: &SubregionOrigin<'tcx>, exact| match *constraint {
460459
Constraint::RegSubReg(sub, sup)
461460
if ((exact && sup == placeholder_region)
462-
|| (!exact && matches(sup, placeholder_region)))
461+
|| (!exact && regions_the_same(sup, placeholder_region)))
463462
&& sup != sub =>
464463
{
465464
Some((sub, cause.clone()))
@@ -468,23 +467,21 @@ fn try_extract_error_from_region_constraints<'a, 'tcx>(
468467
if (exact
469468
&& sup == placeholder_region
470469
&& !universe_of_region(vid).can_name(placeholder_universe))
471-
|| (!exact && matches(sup, placeholder_region)) =>
470+
|| (!exact && regions_the_same(sup, placeholder_region)) =>
472471
{
473472
Some((ty::Region::new_var(infcx.tcx, vid), cause.clone()))
474473
}
475474
_ => None,
476475
};
477-
let mut info = region_constraints
478-
.constraints
479-
.iter()
480-
.find_map(|(constraint, cause)| check(constraint, cause, true));
481-
if info.is_none() {
482-
info = region_constraints
476+
477+
let mut find_culprit = |exact_match: bool| {
478+
region_constraints
483479
.constraints
484480
.iter()
485-
.find_map(|(constraint, cause)| check(constraint, cause, false));
486-
}
487-
let (sub_region, cause) = info?;
481+
.find_map(|(constraint, cause)| check(constraint, cause, exact_match))
482+
};
483+
484+
let (sub_region, cause) = find_culprit(true).or_else(|| find_culprit(false))?;
488485

489486
debug!(?sub_region, "cause = {:#?}", cause);
490487
let error = match (error_region, sub_region.kind()) {

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
405405
let universe = placeholder.universe;
406406
let universe_info = self.regioncx.universe_info(universe);
407407

408-
universe_info.report_error(self, placeholder, error_element, cause);
408+
universe_info.report_erroneous_element(self, placeholder, error_element, cause);
409409
}
410410

411411
RegionErrorKind::RegionError { fr_origin, longer_fr, shorter_fr, is_reported } => {

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
5+
#![cfg_attr(bootstrap, feature(let_chains))]
56
#![doc(rust_logo)]
67
#![feature(assert_matches)]
78
#![feature(box_patterns)]
89
#![feature(file_buffered)]
910
#![feature(if_let_guard)]
10-
#![feature(let_chains)]
1111
#![feature(negative_impls)]
1212
#![feature(never_type)]
1313
#![feature(rustc_attrs)]

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,30 +1628,23 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16281628
let longer_fr_scc = self.constraint_sccs.scc(longer_fr);
16291629
debug!("check_bound_universal_region: longer_fr_scc={:?}", longer_fr_scc,);
16301630

1631-
for error_element in self.scc_values.elements_contained_in(longer_fr_scc) {
1632-
match error_element {
1633-
RegionElement::Location(_) | RegionElement::RootUniversalRegion(_) => {}
1634-
// If we have some bound universal region `'a`, then the only
1635-
// elements it can contain is itself -- we don't know anything
1636-
// else about it!
1637-
RegionElement::PlaceholderRegion(placeholder1) => {
1638-
if placeholder == placeholder1 {
1639-
continue;
1640-
}
1641-
}
1642-
}
1643-
1631+
// If we have some bound universal region `'a`, then the only
1632+
// elements it can contain is itself -- we don't know anything
1633+
// else about it!
1634+
if let Some(error_element) = self
1635+
.scc_values
1636+
.elements_contained_in(longer_fr_scc)
1637+
.find(|e| *e != RegionElement::PlaceholderRegion(placeholder))
1638+
{
1639+
// Stop after the first error, it gets too noisy otherwise, and does not provide more information.
16441640
errors_buffer.push(RegionErrorKind::BoundUniversalRegionError {
16451641
longer_fr,
16461642
error_element,
16471643
placeholder,
16481644
});
1649-
1650-
// Stop after the first error, it gets too noisy otherwise, and does not provide more
1651-
// information.
1652-
break;
1645+
} else {
1646+
debug!("check_bound_universal_region: all bounds satisfied");
16531647
}
1654-
debug!("check_bound_universal_region: all bounds satisfied");
16551648
}
16561649

16571650
#[instrument(level = "debug", skip(self, infcx, errors_buffer))]
@@ -2071,7 +2064,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20712064
constraint.category
20722065
};
20732066

2074-
match category {
2067+
let interest = match category {
20752068
// Returns usually provide a type to blame and have specially written diagnostics,
20762069
// so prioritize them.
20772070
ConstraintCategory::Return(_) => 0,
@@ -2123,9 +2116,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
21232116
// specific, and are not used for relations that would make sense to blame.
21242117
ConstraintCategory::BoringNoLocation => 6,
21252118
// Do not blame internal constraints.
2126-
ConstraintCategory::Internal => 7,
2127-
ConstraintCategory::IllegalUniverse => 8,
2128-
}
2119+
ConstraintCategory::IllegalUniverse => 7,
2120+
ConstraintCategory::Internal => 8,
2121+
};
2122+
2123+
debug!("constraint {constraint:?} category: {category:?}, interest: {interest:?}");
2124+
2125+
interest
21292126
};
21302127

21312128
let best_choice = if blame_source {

compiler/rustc_borrowck/src/region_infer/values.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rustc_index::newtype_index! {
2121

2222
/// An individual element in a region value -- the value of a
2323
/// particular region variable consists of a set of these elements.
24-
#[derive(Debug, Clone)]
24+
#[derive(Debug, Clone, PartialEq)]
2525
pub(crate) enum RegionElement {
2626
/// A point in the control-flow graph.
2727
Location(Location),

0 commit comments

Comments
 (0)