Skip to content

Commit b184dd9

Browse files
authored
Merge pull request rust-lang#4815 from rust-lang/rustup-2026-01-15
Automatic Rustup
2 parents c947436 + c15cdfb commit b184dd9

578 files changed

Lines changed: 5819 additions & 3353 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ name: CI
1111
on:
1212
push:
1313
branches:
14-
- auto
15-
- try
16-
- try-perf
17-
- automation/bors/try
1814
- automation/bors/auto
15+
- automation/bors/try
16+
- try-perf
1917
pull_request:
2018
branches:
2119
- "**"
@@ -33,9 +31,10 @@ defaults:
3331

3432
concurrency:
3533
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
36-
# We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
37-
# are all triggered on the same branch, but which should be able to run concurrently.
38-
group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
34+
# We add an exception for try builds (automation/bors/try branch) and unrolled rollup builds
35+
# (try-perf), which are all triggered on the same branch, but which should be able to run
36+
# concurrently.
37+
group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
3938
cancel-in-progress: true
4039
env:
4140
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
@@ -57,7 +56,7 @@ jobs:
5756
- name: Test citool
5857
# Only test citool on the auto branch, to reduce latency of the calculate matrix job
5958
# on PR/try builds.
60-
if: ${{ github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto' }}
59+
if: ${{ github.ref == 'refs/heads/automation/bors/auto' }}
6160
run: |
6261
cd src/ci/citool
6362
CARGO_INCREMENTAL=0 cargo test
@@ -80,7 +79,7 @@ jobs:
8079
# access the environment.
8180
#
8281
# We only enable the environment for the rust-lang/rust repository, so that CI works on forks.
83-
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
82+
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
8483
env:
8584
CI_JOB_NAME: ${{ matrix.name }}
8685
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
@@ -289,7 +288,7 @@ jobs:
289288
fi
290289
291290
# Get closest bors merge commit
292-
PARENT_COMMIT=`git rev-list --author='122020455+rust-bors\[bot\]@users.noreply.github.com' -n1 --first-parent HEAD^1`
291+
PARENT_COMMIT=`git rev-list --author='bors@rust-lang.org' --author='122020455+rust-bors\[bot\]@users.noreply.github.com' -n1 --first-parent HEAD^1`
293292
294293
./build/citool/debug/citool postprocess-metrics \
295294
--job-name ${CI_JOB_NAME} \
@@ -314,7 +313,7 @@ jobs:
314313
needs: [ calculate_matrix, job ]
315314
# !cancelled() executes the job regardless of whether the previous jobs passed or failed
316315
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
317-
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
316+
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
318317
steps:
319318
- name: checkout the source code
320319
uses: actions/checkout@v5

.github/workflows/post-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
sleep 60
3030
3131
# Get closest bors merge commit
32-
PARENT_COMMIT=`git rev-list --author='122020455+rust-bors\[bot\]@users.noreply.github.com' -n1 --first-parent HEAD^1`
32+
PARENT_COMMIT=`git rev-list --author='bors@rust-lang.org' --author='122020455+rust-bors\[bot\]@users.noreply.github.com' -n1 --first-parent HEAD^1`
3333
echo "Parent: ${PARENT_COMMIT}"
3434
3535
# Find PR for the current commit

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ boolean_coercion <booleancoercion@gmail.com>
9696
Boris Egorov <jightuse@gmail.com> <egorov@linux.com>
9797
bors <bors@rust-lang.org> bors[bot] <26634292+bors[bot]@users.noreply.github.com>
9898
bors <bors@rust-lang.org> bors[bot] <bors[bot]@users.noreply.github.com>
99+
bors <bors@rust-lang.org> <122020455+rust-bors[bot]@users.noreply.github.com>
99100
BoxyUwU <rust@boxyuwu.dev>
100101
BoxyUwU <rust@boxyuwu.dev> <supbscripter@gmail.com>
101102
Braden Nelson <moonheart08@users.noreply.github.com>

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4360,7 +4360,6 @@ dependencies = [
43604360
"rustc_infer",
43614361
"rustc_macros",
43624362
"rustc_middle",
4363-
"rustc_mir_build",
43644363
"rustc_mir_dataflow",
43654364
"rustc_session",
43664365
"rustc_span",

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ See [the rustc-dev-guide for more info][sysllvm].
9797
--set llvm.ninja=false \
9898
--set rust.debug-assertions=false \
9999
--set rust.jemalloc \
100-
--set rust.use-lld=true \
100+
--set rust.bootstrap-override-lld=true \
101101
--set rust.lto=thin \
102102
--set rust.codegen-units=1
103103
```

compiler/rustc_ast/src/ast.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,16 +2109,18 @@ pub struct MacroDef {
21092109
/// `true` if macro was defined with `macro_rules`.
21102110
pub macro_rules: bool,
21112111

2112-
/// If this is a macro used for externally implementable items,
2113-
/// it refers to an extern item which is its "target". This requires
2114-
/// name resolution so can't just be an attribute, so we store it in this field.
2115-
pub eii_extern_target: Option<EiiExternTarget>,
2112+
/// Corresponds to `#[eii_declaration(...)]`.
2113+
/// `#[eii_declaration(...)]` is a built-in attribute macro, not a built-in attribute,
2114+
/// because we require some name resolution to occur in the parameters of this attribute.
2115+
/// Name resolution isn't possible in attributes otherwise, so we encode it in the AST.
2116+
/// During ast lowering, we turn it back into an attribute again
2117+
pub eii_declaration: Option<EiiDecl>,
21162118
}
21172119

21182120
#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic, Walkable)]
2119-
pub struct EiiExternTarget {
2121+
pub struct EiiDecl {
21202122
/// path to the extern item we're targeting
2121-
pub extern_item_path: Path,
2123+
pub foreign_item: Path,
21222124
pub impl_unsafe: bool,
21232125
}
21242126

@@ -2394,7 +2396,7 @@ impl FnSig {
23942396
/// * the `G<Ty> = Ty` in `Trait<G<Ty> = Ty>`
23952397
/// * the `A: Bound` in `Trait<A: Bound>`
23962398
/// * the `RetTy` in `Trait(ArgTy, ArgTy) -> RetTy`
2397-
/// * the `C = { Ct }` in `Trait<C = { Ct }>` (feature `associated_const_equality`)
2399+
/// * the `C = { Ct }` in `Trait<C = { Ct }>` (feature `min_generic_const_args`)
23982400
/// * the `f(..): Bound` in `Trait<f(..): Bound>` (feature `return_type_notation`)
23992401
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
24002402
pub struct AssocItemConstraint {
@@ -3824,7 +3826,7 @@ pub struct EiiImpl {
38243826
///
38253827
/// This field is that shortcut: we prefill the extern target to skip a name resolution step,
38263828
/// making sure it never fails. It'd be awful UX if we fail name resolution in code invisible to the user.
3827-
pub known_eii_macro_resolution: Option<EiiExternTarget>,
3829+
pub known_eii_macro_resolution: Option<EiiDecl>,
38283830
pub impl_safety: Safety,
38293831
pub span: Span,
38303832
pub inner_span: Span,

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@ impl AttributeExt for Attribute {
235235
}
236236
}
237237

238-
fn deprecation_note(&self) -> Option<Symbol> {
238+
fn deprecation_note(&self) -> Option<Ident> {
239239
match &self.kind {
240240
AttrKind::Normal(normal) if normal.item.path == sym::deprecated => {
241241
let meta = &normal.item;
242242

243243
// #[deprecated = "..."]
244244
if let Some(s) = meta.value_str() {
245-
return Some(s);
245+
return Some(Ident { name: s, span: meta.span() });
246246
}
247247

248248
// #[deprecated(note = "...")]
@@ -252,7 +252,7 @@ impl AttributeExt for Attribute {
252252
&& mi.path == sym::note
253253
&& let Some(s) = mi.value_str()
254254
{
255-
return Some(s);
255+
return Some(Ident { name: s, span: mi.span });
256256
}
257257
}
258258
}
@@ -905,7 +905,7 @@ pub trait AttributeExt: Debug {
905905
/// Returns the deprecation note if this is deprecation attribute.
906906
/// * `#[deprecated = "note"]` returns `Some("note")`.
907907
/// * `#[deprecated(note = "note", ...)]` returns `Some("note")`.
908-
fn deprecation_note(&self) -> Option<Symbol>;
908+
fn deprecation_note(&self) -> Option<Ident>;
909909

910910
fn is_proc_macro_attr(&self) -> bool {
911911
[sym::proc_macro, sym::proc_macro_attribute, sym::proc_macro_derive]

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ macro_rules! common_visitor_and_walkers {
489489
WhereEqPredicate,
490490
WhereRegionPredicate,
491491
YieldKind,
492-
EiiExternTarget,
492+
EiiDecl,
493493
EiiImpl,
494494
);
495495

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_abi::ExternAbi;
22
use rustc_ast::visit::AssocCtxt;
33
use rustc_ast::*;
44
use rustc_errors::{E0570, ErrorGuaranteed, struct_span_code_err};
5-
use rustc_hir::attrs::{AttributeKind, EiiDecl, EiiImplResolution};
5+
use rustc_hir::attrs::{AttributeKind, EiiImplResolution};
66
use rustc_hir::def::{DefKind, PerNS, Res};
77
use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
88
use rustc_hir::{
@@ -134,16 +134,16 @@ impl<'hir> LoweringContext<'_, 'hir> {
134134
}
135135
}
136136

137-
fn lower_eii_extern_target(
137+
fn lower_eii_decl(
138138
&mut self,
139139
id: NodeId,
140-
eii_name: Ident,
141-
EiiExternTarget { extern_item_path, impl_unsafe }: &EiiExternTarget,
142-
) -> Option<EiiDecl> {
143-
self.lower_path_simple_eii(id, extern_item_path).map(|did| EiiDecl {
144-
eii_extern_target: did,
140+
name: Ident,
141+
EiiDecl { foreign_item, impl_unsafe }: &EiiDecl,
142+
) -> Option<hir::attrs::EiiDecl> {
143+
self.lower_path_simple_eii(id, foreign_item).map(|did| hir::attrs::EiiDecl {
144+
foreign_item: did,
145145
impl_unsafe: *impl_unsafe,
146-
name: eii_name,
146+
name,
147147
})
148148
}
149149

@@ -160,7 +160,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
160160
}: &EiiImpl,
161161
) -> hir::attrs::EiiImpl {
162162
let resolution = if let Some(target) = known_eii_macro_resolution
163-
&& let Some(decl) = self.lower_eii_extern_target(
163+
&& let Some(decl) = self.lower_eii_decl(
164164
*node_id,
165165
// the expect is ok here since we always generate this path in the eii macro.
166166
eii_macro_path.segments.last().expect("at least one segment").ident,
@@ -196,9 +196,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
196196
eii_impls.iter().map(|i| self.lower_eii_impl(i)).collect(),
197197
))]
198198
}
199-
ItemKind::MacroDef(name, MacroDef { eii_extern_target: Some(target), .. }) => self
200-
.lower_eii_extern_target(id, *name, target)
201-
.map(|decl| vec![hir::Attribute::Parsed(AttributeKind::EiiExternTarget(decl))])
199+
ItemKind::MacroDef(name, MacroDef { eii_declaration: Some(target), .. }) => self
200+
.lower_eii_decl(id, *name, target)
201+
.map(|decl| vec![hir::Attribute::Parsed(AttributeKind::EiiDeclaration(decl))])
202202
.unwrap_or_default(),
203203

204204
ItemKind::ExternCrate(..)
@@ -242,10 +242,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
242242
vis_span,
243243
span: self.lower_span(i.span),
244244
has_delayed_lints: !self.delayed_lints.is_empty(),
245-
eii: find_attr!(
246-
attrs,
247-
AttributeKind::EiiImpls(..) | AttributeKind::EiiExternTarget(..)
248-
),
245+
eii: find_attr!(attrs, AttributeKind::EiiImpls(..) | AttributeKind::EiiDeclaration(..)),
249246
};
250247
self.arena.alloc(item)
251248
}
@@ -539,7 +536,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
539536
);
540537
hir::ItemKind::TraitAlias(constness, ident, generics, bounds)
541538
}
542-
ItemKind::MacroDef(ident, MacroDef { body, macro_rules, eii_extern_target: _ }) => {
539+
ItemKind::MacroDef(ident, MacroDef { body, macro_rules, eii_declaration: _ }) => {
543540
let ident = self.lower_ident(*ident);
544541
let body = Box::new(self.lower_delim_args(body));
545542
let def_id = self.local_def_id(id);
@@ -553,7 +550,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
553550
let macro_def = self.arena.alloc(ast::MacroDef {
554551
body,
555552
macro_rules: *macro_rules,
556-
eii_extern_target: None,
553+
eii_declaration: None,
557554
});
558555
hir::ItemKind::Macro(ident, macro_def, macro_kinds)
559556
}
@@ -693,7 +690,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
693690
has_delayed_lints: !this.delayed_lints.is_empty(),
694691
eii: find_attr!(
695692
attrs,
696-
AttributeKind::EiiImpls(..) | AttributeKind::EiiExternTarget(..)
693+
AttributeKind::EiiImpls(..) | AttributeKind::EiiDeclaration(..)
697694
),
698695
};
699696
hir::OwnerNode::Item(this.arena.alloc(item))

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,6 +2517,28 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
25172517
span,
25182518
}
25192519
}
2520+
ExprKind::Array(elements) => {
2521+
let lowered_elems = self.arena.alloc_from_iter(elements.iter().map(|element| {
2522+
let const_arg = if let ExprKind::ConstBlock(anon_const) = &element.kind {
2523+
let def_id = self.local_def_id(anon_const.id);
2524+
assert_eq!(DefKind::AnonConst, self.tcx.def_kind(def_id));
2525+
self.lower_anon_const_to_const_arg(anon_const)
2526+
} else {
2527+
self.lower_expr_to_const_arg_direct(element)
2528+
};
2529+
&*self.arena.alloc(const_arg)
2530+
}));
2531+
let array_expr = self.arena.alloc(hir::ConstArgArrayExpr {
2532+
span: self.lower_span(expr.span),
2533+
elems: lowered_elems,
2534+
});
2535+
2536+
ConstArg {
2537+
hir_id: self.next_id(),
2538+
kind: hir::ConstArgKind::Array(array_expr),
2539+
span,
2540+
}
2541+
}
25202542
ExprKind::Underscore => ConstArg {
25212543
hir_id: self.lower_node_id(expr.id),
25222544
kind: hir::ConstArgKind::Infer(()),
@@ -2532,6 +2554,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
25322554
| ExprKind::Struct(..)
25332555
| ExprKind::Call(..)
25342556
| ExprKind::Tup(..)
2557+
| ExprKind::Array(..)
25352558
)
25362559
{
25372560
return self.lower_expr_to_const_arg_direct(expr);

0 commit comments

Comments
 (0)