Skip to content

Commit 1347cc8

Browse files
authored
Merge pull request #4264 from RalfJung/rustup
Rustup
2 parents 7da4440 + f69ea4d commit 1347cc8

File tree

873 files changed

+7964
-5025
lines changed

Some content is hidden

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

873 files changed

+7964
-5025
lines changed

Diff for: .github/ISSUE_TEMPLATE/library_tracking_issue.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Library Tracking Issue
33
about: A tracking issue for an unstable library feature.
44
title: Tracking Issue for XXX
5-
labels: C-tracking-issue, T-libs-api
5+
labels: C-tracking-issue, T-libs-api, S-tracking-unimplemented
66
---
77
<!--
88
Thank you for creating a tracking issue!
@@ -49,6 +49,8 @@ For larger features, more steps might be involved.
4949
If the feature is changed later, please add those PRs here as well.
5050
-->
5151

52+
(Remember to update the `S-tracking-*` label when checking boxes.)
53+
5254
- [ ] Implementation: #...
5355
- [ ] Final comment period (FCP)[^1]
5456
- [ ] Stabilization PR

Diff for: Cargo.lock

+55-6
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,48 @@ version = "0.7.6"
186186
source = "registry+https://github.com/rust-lang/crates.io-index"
187187
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
188188

189+
[[package]]
190+
name = "askama"
191+
version = "0.13.0"
192+
source = "registry+https://github.com/rust-lang/crates.io-index"
193+
checksum = "9a4e46abb203e00ef226442d452769233142bbfdd79c3941e84c8e61c4112543"
194+
dependencies = [
195+
"askama_derive",
196+
"itoa",
197+
"percent-encoding",
198+
"serde",
199+
"serde_json",
200+
]
201+
202+
[[package]]
203+
name = "askama_derive"
204+
version = "0.13.0"
205+
source = "registry+https://github.com/rust-lang/crates.io-index"
206+
checksum = "54398906821fd32c728135f7b351f0c7494ab95ae421d41b6f5a020e158f28a6"
207+
dependencies = [
208+
"askama_parser",
209+
"basic-toml",
210+
"memchr",
211+
"proc-macro2",
212+
"quote",
213+
"rustc-hash 2.1.1",
214+
"serde",
215+
"serde_derive",
216+
"syn 2.0.100",
217+
]
218+
219+
[[package]]
220+
name = "askama_parser"
221+
version = "0.13.0"
222+
source = "registry+https://github.com/rust-lang/crates.io-index"
223+
checksum = "cf315ce6524c857bb129ff794935cf6d42c82a6cff60526fe2a63593de4d0d4f"
224+
dependencies = [
225+
"memchr",
226+
"serde",
227+
"serde_derive",
228+
"winnow 0.7.4",
229+
]
230+
189231
[[package]]
190232
name = "autocfg"
191233
version = "1.4.0"
@@ -676,7 +718,6 @@ name = "compiletest"
676718
version = "0.0.0"
677719
dependencies = [
678720
"anstyle-svg",
679-
"anyhow",
680721
"build_helper",
681722
"colored",
682723
"diff",
@@ -1357,8 +1398,8 @@ name = "generate-copyright"
13571398
version = "0.1.0"
13581399
dependencies = [
13591400
"anyhow",
1401+
"askama",
13601402
"cargo_metadata 0.18.1",
1361-
"rinja",
13621403
"serde",
13631404
"serde_json",
13641405
"thiserror 1.0.69",
@@ -3078,9 +3119,7 @@ version = "0.3.5"
30783119
source = "registry+https://github.com/rust-lang/crates.io-index"
30793120
checksum = "3dc4940d00595430b3d7d5a01f6222b5e5b51395d1120bdb28d854bb8abb17a5"
30803121
dependencies = [
3081-
"humansize",
30823122
"itoa",
3083-
"percent-encoding",
30843123
"rinja_derive",
30853124
]
30863125

@@ -4598,6 +4637,7 @@ version = "0.0.0"
45984637
dependencies = [
45994638
"bitflags",
46004639
"derive-where",
4640+
"ena",
46014641
"indexmap",
46024642
"rustc-hash 1.1.0",
46034643
"rustc_ast_ir",
@@ -4636,6 +4676,7 @@ name = "rustdoc"
46364676
version = "0.0.0"
46374677
dependencies = [
46384678
"arrayvec",
4679+
"askama",
46394680
"base64",
46404681
"expect-test",
46414682
"indexmap",
@@ -4644,7 +4685,6 @@ dependencies = [
46444685
"pulldown-cmark 0.9.6",
46454686
"pulldown-cmark-escape",
46464687
"regex",
4647-
"rinja",
46484688
"rustdoc-json-types",
46494689
"serde",
46504690
"serde_json",
@@ -5434,7 +5474,7 @@ dependencies = [
54345474
"serde",
54355475
"serde_spanned",
54365476
"toml_datetime",
5437-
"winnow",
5477+
"winnow 0.5.40",
54385478
]
54395479

54405480
[[package]]
@@ -6445,6 +6485,15 @@ dependencies = [
64456485
"memchr",
64466486
]
64476487

6488+
[[package]]
6489+
name = "winnow"
6490+
version = "0.7.4"
6491+
source = "registry+https://github.com/rust-lang/crates.io-index"
6492+
checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36"
6493+
dependencies = [
6494+
"memchr",
6495+
]
6496+
64486497
[[package]]
64496498
name = "winsplit"
64506499
version = "0.1.0"

Diff for: bootstrap.example.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# - A new option
2929
# - A change in the default values
3030
#
31-
# If the change-id does not match the version currently in use, x.py will
31+
# If the change-id does not match the version currently in use, x.py will
3232
# display the changes made to the bootstrap.
3333
# To suppress these warnings, you can set change-id = "ignore".
3434
#change-id = <latest change id in src/bootstrap/src/utils/change_tracker.rs>
@@ -442,6 +442,9 @@
442442
# What custom diff tool to use for displaying compiletest tests.
443443
#compiletest-diff-tool = <none>
444444

445+
# Whether to use the precompiled stage0 libtest with compiletest.
446+
#compiletest-use-stage0-libtest = true
447+
445448
# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).
446449
# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use
447450
# a specific version.

Diff for: compiler/rustc_abi/src/extern_abi.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub enum ExternAbi {
6060
System {
6161
unwind: bool,
6262
},
63-
RustIntrinsic,
6463
RustCall,
6564
/// *Not* a stable ABI, just directly use the Rust types to describe the ABI for LLVM. Even
6665
/// normally ABI-compatible Rust types can become ABI-incompatible with this ABI!
@@ -128,7 +127,6 @@ abi_impls! {
128127
RiscvInterruptS =><= "riscv-interrupt-s",
129128
RustCall =><= "rust-call",
130129
RustCold =><= "rust-cold",
131-
RustIntrinsic =><= "rust-intrinsic",
132130
Stdcall { unwind: false } =><= "stdcall",
133131
Stdcall { unwind: true } =><= "stdcall-unwind",
134132
System { unwind: false } =><= "system",
@@ -199,7 +197,7 @@ impl ExternAbi {
199197
/// - are subject to change between compiler versions
200198
pub fn is_rustic_abi(self) -> bool {
201199
use ExternAbi::*;
202-
matches!(self, Rust | RustCall | RustIntrinsic | RustCold)
200+
matches!(self, Rust | RustCall | RustCold)
203201
}
204202

205203
pub fn supports_varargs(self) -> bool {

Diff for: compiler/rustc_abi/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ pub struct PointeeInfo {
18291829
pub safe: Option<PointerKind>,
18301830
/// If `safe` is `Some`, then the pointer is either null or dereferenceable for this many bytes.
18311831
/// On a function argument, "dereferenceable" here means "dereferenceable for the entire duration
1832-
/// of this function call", i.e. it is UB for the memory that this pointer points to to be freed
1832+
/// of this function call", i.e. it is UB for the memory that this pointer points to be freed
18331833
/// while this function is still running.
18341834
/// The size can be zero if the pointer is not dereferenceable.
18351835
pub size: Size,

Diff for: compiler/rustc_ast/src/ast.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ impl Pat {
563563
/// This is intended for use by diagnostics.
564564
pub fn to_ty(&self) -> Option<P<Ty>> {
565565
let kind = match &self.kind {
566+
PatKind::Missing => unreachable!(),
566567
// In a type expression `_` is an inference variable.
567568
PatKind::Wild => TyKind::Infer,
568569
// An IDENT pattern with no binding mode would be valid as path to a type. E.g. `u32`.
@@ -625,7 +626,8 @@ impl Pat {
625626
| PatKind::Guard(s, _) => s.walk(it),
626627

627628
// These patterns do not contain subpatterns, skip.
628-
PatKind::Wild
629+
PatKind::Missing
630+
| PatKind::Wild
629631
| PatKind::Rest
630632
| PatKind::Never
631633
| PatKind::Expr(_)
@@ -676,6 +678,7 @@ impl Pat {
676678
/// Return a name suitable for diagnostics.
677679
pub fn descr(&self) -> Option<String> {
678680
match &self.kind {
681+
PatKind::Missing => unreachable!(),
679682
PatKind::Wild => Some("_".to_string()),
680683
PatKind::Ident(BindingMode::NONE, ident, None) => Some(format!("{ident}")),
681684
PatKind::Ref(pat, mutbl) => pat.descr().map(|d| format!("&{}{d}", mutbl.prefix_str())),
@@ -769,6 +772,9 @@ pub enum RangeSyntax {
769772
// Adding a new variant? Please update `test_pat` in `tests/ui/macros/stringify.rs`.
770773
#[derive(Clone, Encodable, Decodable, Debug)]
771774
pub enum PatKind {
775+
/// A missing pattern, e.g. for an anonymous param in a bare fn like `fn f(u32)`.
776+
Missing,
777+
772778
/// Represents a wildcard pattern (`_`).
773779
Wild,
774780

@@ -1169,6 +1175,7 @@ pub enum MacStmtStyle {
11691175
#[derive(Clone, Encodable, Decodable, Debug)]
11701176
pub struct Local {
11711177
pub id: NodeId,
1178+
pub super_: Option<Span>,
11721179
pub pat: P<Pat>,
11731180
pub ty: Option<P<Ty>>,
11741181
pub kind: LocalKind,
@@ -3926,7 +3933,7 @@ mod size_asserts {
39263933
static_assert_size!(Item, 144);
39273934
static_assert_size!(ItemKind, 80);
39283935
static_assert_size!(LitKind, 24);
3929-
static_assert_size!(Local, 80);
3936+
static_assert_size!(Local, 96);
39303937
static_assert_size!(MetaItemLit, 40);
39313938
static_assert_size!(Param, 40);
39323939
static_assert_size!(Pat, 72);

Diff for: compiler/rustc_ast/src/expand/autodiff_attrs.rs

+6
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ pub struct AutoDiffAttrs {
9292
pub input_activity: Vec<DiffActivity>,
9393
}
9494

95+
impl AutoDiffAttrs {
96+
pub fn has_primal_ret(&self) -> bool {
97+
matches!(self.ret_activity, DiffActivity::Active | DiffActivity::Dual)
98+
}
99+
}
100+
95101
impl DiffMode {
96102
pub fn is_rev(&self) -> bool {
97103
matches!(self, DiffMode::Reverse)

Diff for: compiler/rustc_ast/src/mut_visit.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,8 @@ fn walk_parenthesized_parameter_data<T: MutVisitor>(vis: &mut T, args: &mut Pare
704704
}
705705

706706
fn walk_local<T: MutVisitor>(vis: &mut T, local: &mut P<Local>) {
707-
let Local { id, pat, ty, kind, span, colon_sp, attrs, tokens } = local.deref_mut();
707+
let Local { id, super_, pat, ty, kind, span, colon_sp, attrs, tokens } = local.deref_mut();
708+
visit_opt(super_, |sp| vis.visit_span(sp));
708709
vis.visit_id(id);
709710
visit_attrs(vis, attrs);
710711
vis.visit_pat(pat);
@@ -1587,7 +1588,7 @@ pub fn walk_pat<T: MutVisitor>(vis: &mut T, pat: &mut P<Pat>) {
15871588
vis.visit_id(id);
15881589
match kind {
15891590
PatKind::Err(_guar) => {}
1590-
PatKind::Wild | PatKind::Rest | PatKind::Never => {}
1591+
PatKind::Missing | PatKind::Wild | PatKind::Rest | PatKind::Never => {}
15911592
PatKind::Ident(_binding_mode, ident, sub) => {
15921593
vis.visit_ident(ident);
15931594
visit_opt(sub, |sub| vis.visit_pat(sub));

Diff for: compiler/rustc_ast/src/visit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ pub fn walk_crate<'a, V: Visitor<'a>>(visitor: &mut V, krate: &'a Crate) -> V::R
323323
}
324324

325325
pub fn walk_local<'a, V: Visitor<'a>>(visitor: &mut V, local: &'a Local) -> V::Result {
326-
let Local { id: _, pat, ty, kind, span: _, colon_sp: _, attrs, tokens: _ } = local;
326+
let Local { id: _, super_: _, pat, ty, kind, span: _, colon_sp: _, attrs, tokens: _ } = local;
327327
walk_list!(visitor, visit_attribute, attrs);
328328
try_visit!(visitor.visit_pat(pat));
329329
visit_opt!(visitor, visit_ty, ty);
@@ -750,7 +750,7 @@ pub fn walk_pat<'a, V: Visitor<'a>>(visitor: &mut V, pattern: &'a Pat) -> V::Res
750750
try_visit!(visitor.visit_pat(subpattern));
751751
try_visit!(visitor.visit_expr(guard_condition));
752752
}
753-
PatKind::Wild | PatKind::Rest | PatKind::Never => {}
753+
PatKind::Missing | PatKind::Wild | PatKind::Rest | PatKind::Never => {}
754754
PatKind::Err(_guar) => {}
755755
PatKind::Tuple(elems) | PatKind::Slice(elems) | PatKind::Or(elems) => {
756756
walk_list!(visitor, visit_pat, elems);

Diff for: compiler/rustc_ast_lowering/src/block.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
9595

9696
fn lower_local(&mut self, l: &Local) -> &'hir hir::LetStmt<'hir> {
9797
// Let statements are allowed to have impl trait in bindings.
98+
let super_ = l.super_;
9899
let ty = l.ty.as_ref().map(|t| {
99100
self.lower_ty(t, self.impl_trait_in_bindings_ctxt(ImplTraitPosition::Variable))
100101
});
@@ -109,7 +110,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
109110
let span = self.lower_span(l.span);
110111
let source = hir::LocalSource::Normal;
111112
self.lower_attrs(hir_id, &l.attrs, l.span);
112-
self.arena.alloc(hir::LetStmt { hir_id, ty, pat, init, els, span, source })
113+
self.arena.alloc(hir::LetStmt { hir_id, super_, ty, pat, init, els, span, source })
113114
}
114115

115116
fn lower_block_check_mode(&mut self, b: &BlockCheckMode) -> hir::BlockCheckMode {

Diff for: compiler/rustc_ast_lowering/src/lib.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1496,18 +1496,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14961496

14971497
fn lower_fn_params_to_names(&mut self, decl: &FnDecl) -> &'hir [Option<Ident>] {
14981498
self.arena.alloc_from_iter(decl.inputs.iter().map(|param| match param.pat.kind {
1499-
PatKind::Ident(_, ident, _) => {
1500-
if ident.name != kw::Empty {
1501-
Some(self.lower_ident(ident))
1502-
} else {
1503-
None
1504-
}
1505-
}
1499+
PatKind::Missing => None,
1500+
PatKind::Ident(_, ident, _) => Some(self.lower_ident(ident)),
15061501
PatKind::Wild => Some(Ident::new(kw::Underscore, self.lower_span(param.pat.span))),
15071502
_ => {
15081503
self.dcx().span_delayed_bug(
15091504
param.pat.span,
1510-
"non-ident/wild param pat must trigger an error",
1505+
"non-missing/ident/wild param pat must trigger an error",
15111506
);
15121507
None
15131508
}
@@ -2223,6 +2218,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22232218
self.attrs.insert(hir_id.local_id, a);
22242219
}
22252220
let local = hir::LetStmt {
2221+
super_: None,
22262222
hir_id,
22272223
init,
22282224
pat,

Diff for: compiler/rustc_ast_lowering/src/pat.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2626
let pat_hir_id = self.lower_node_id(pattern.id);
2727
let node = loop {
2828
match &pattern.kind {
29+
PatKind::Missing => break hir::PatKind::Missing,
2930
PatKind::Wild => break hir::PatKind::Wild,
3031
PatKind::Never => break hir::PatKind::Never,
3132
PatKind::Ident(binding_mode, ident, sub) => {

Diff for: compiler/rustc_ast_lowering/src/stability.rs

-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> {
7979
| ExternAbi::SysV64 { .. }
8080
| ExternAbi::System { .. }
8181
| ExternAbi::EfiApi => Ok(()),
82-
// implementation details
83-
ExternAbi::RustIntrinsic => {
84-
Err(UnstableAbi { abi, feature: sym::intrinsics, explain: GateReason::ImplDetail })
85-
}
8682
ExternAbi::Unadjusted => {
8783
Err(UnstableAbi { abi, feature: sym::abi_unadjusted, explain: GateReason::ImplDetail })
8884
}

Diff for: compiler/rustc_ast_passes/src/ast_validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<'a> AstValidator<'a> {
244244
fn check_decl_no_pat(decl: &FnDecl, mut report_err: impl FnMut(Span, Option<Ident>, bool)) {
245245
for Param { pat, .. } in &decl.inputs {
246246
match pat.kind {
247-
PatKind::Ident(BindingMode::NONE, _, None) | PatKind::Wild => {}
247+
PatKind::Missing | PatKind::Ident(BindingMode::NONE, _, None) | PatKind::Wild => {}
248248
PatKind::Ident(BindingMode::MUT, ident, None) => {
249249
report_err(pat.span, Some(ident), true)
250250
}

0 commit comments

Comments
 (0)