Skip to content

Commit c67ea44

Browse files
authored
Merge pull request rust-lang#4009 from RalfJung/rustup
Rustup
2 parents 6630802 + c1b8d66 commit c67ea44

File tree

331 files changed

+3286
-1674
lines changed

Some content is hidden

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

331 files changed

+3286
-1674
lines changed

.mailmap

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Alexis Beingessner <[email protected]>
3131
Alfie John <[email protected]> Alfie John <[email protected]>
3232
Alona Enraght-Moony <[email protected]> <[email protected]>
3333
Alona Enraght-Moony <[email protected]> <[email protected]>
34+
Alona Enraght-Moony <[email protected]> <[email protected]>
3435
3536
3637
@@ -75,6 +76,7 @@ Benjamin Jackman <[email protected]>
7576
Benoît Cortier <[email protected]>
7677
Bheesham Persaud <[email protected]> Bheesham Persaud <[email protected]>
7778
79+
7880
7981
blake2-ppc <[email protected]> <blake2-ppc>
8082
blyxyas <[email protected]> Alejandra González <[email protected]>
@@ -172,6 +174,7 @@ Dzmitry Malyshau <[email protected]>
172174
173175
Ed Barnard <[email protected]>
174176
Eduard-Mihai Burtescu <[email protected]>
177+
Eduard-Mihai Burtescu <[email protected]> <[email protected]>
175178
Eduardo Bautista <[email protected]> <=>
176179
177180
Eduardo Broto <[email protected]>
@@ -186,6 +189,7 @@ Erick Tryzelaar <[email protected]> <[email protected]>
186189
Erik Desjardins <[email protected]>
187190
Erik Jensen <[email protected]>
188191
Erin Power <[email protected]>
192+
189193
190194
191195
Esteban Küber <[email protected]>
@@ -198,6 +202,7 @@ F001 <[email protected]>
198202
Fabian Kössel <[email protected]>
199203
Falco Hirschenberger <[email protected]> <[email protected]>
200204
Felix S. Klock II <[email protected]> Felix S Klock II <[email protected]>
205+
201206
Félix Saparelli <[email protected]>
202207
Flaper Fesp <[email protected]>
203208
Florian Berger <[email protected]>
@@ -245,7 +250,7 @@ Irina Popa <[email protected]>
245250
Ivan Ivaschenko <[email protected]>
246251
ivan tkachenko <[email protected]>
247252
J. J. Weber <[email protected]>
248-
Jack Huey <[email protected]>
253+
249254
250255
Jacob Greenfield <[email protected]>
251256
@@ -292,6 +297,7 @@ John Clements <[email protected]> <[email protected]>
292297
John Hodge <[email protected]> John Hodge <[email protected]>
293298
John Hörnvall <[email protected]>
294299
John Kåre Alsaker <[email protected]>
300+
John Kåre Alsaker <[email protected]> <[email protected]>
295301
John Talling <[email protected]>
296302
John Van Enk <[email protected]>
297303
Jonas Tepe <[email protected]>
@@ -368,6 +374,7 @@ Lukas Lueg <[email protected]>
368374
Luke Metz <[email protected]>
369375
370376
377+
371378
372379
Maik Klein <[email protected]>
373380
Malo Jaffré <[email protected]>
@@ -409,6 +416,7 @@ mental <[email protected]>
409416
410417
Michael Williams <[email protected]>
411418
Michael Woerister <michaelwoerister@posteo> <michaelwoerister@gmail>
419+
Michael Woerister <michaelwoerister@posteo> <[email protected]>
412420
Michael Woerister <michaelwoerister@posteo> <[email protected]>
413421
Michael Woerister <michaelwoerister@posteo> <[email protected]>
414422
Michael Zhang <[email protected]>
@@ -422,6 +430,7 @@ Ms2ger <[email protected]> <[email protected]>
422430
msizanoen1 <[email protected]>
423431
Mukilan Thiagarajan <[email protected]>
424432
Nadrieril Feneanar <[email protected]>
433+
Nadrieril Feneanar <[email protected]> <[email protected]>
425434
426435
427436
Nathan Ringo <[email protected]>
@@ -442,6 +451,8 @@ Niclas Schwarzlose <[email protected]>
442451
Nicolas Abram <[email protected]>
443452
Nicole Mazzuca <[email protected]>
444453
454+
455+
445456
446457
447458
@@ -460,6 +471,7 @@ Oliver Scherer <[email protected]> <[email protected]>
460471
461472
462473
474+
463475
Oliver Scherer <[email protected]>
464476
465477
Onur Özkan <[email protected]>
@@ -496,6 +508,7 @@ Raphaël Huchet <[email protected]>
496508
rChaser53 <[email protected]>
497509
Rémy Rakic <[email protected]>
498510
511+
499512
Renato Riccieri Santos Zannon <[email protected]>
500513
501514
Ricky Hosfelt <[email protected]>
@@ -525,6 +538,7 @@ Samuel Tardieu <[email protected]>
525538
Santiago Pastorino <[email protected]>
526539
Santiago Pastorino <[email protected]> <[email protected]>
527540
Scott McMurray <[email protected]>
541+
528542
Scott Olson <[email protected]> Scott Olson <[email protected]>
529543
Sean Gillespie <[email protected]> swgillespie <[email protected]>
530544
Seiichi Uchida <[email protected]>
@@ -536,6 +550,7 @@ Shyam Sundar B <[email protected]>
536550
Simon Barber-Dueck <[email protected]> Simon BD <simon@server>
537551
538552
Simonas Kazlauskas <[email protected]> Simonas Kazlauskas <[email protected]>
553+
Simonas Kazlauskas <[email protected]> <[email protected]>
539554
Siva Prasad <[email protected]>
540555
541556
Srinivas Reddy Thatiparthy <[email protected]>
@@ -556,6 +571,8 @@ Tatsuyuki Ishi <[email protected]>
556571
557572
Tero Hänninen <[email protected]> Tero Hänninen <[email protected]>
558573
574+
575+
559576
Theo Belaire <[email protected]> Theo Belaire <[email protected]>
560577
Theodore Luo Wang <[email protected]>
561578
Thiago Pontes <[email protected]> thiagopnts <[email protected]>
@@ -593,7 +610,8 @@ Waffle Lapkin <[email protected]>
593610
594611
whitequark <[email protected]>
595612
596-
Wim Looman <[email protected]>
613+
614+
597615
Without Boats <[email protected]>
598616
599617
Xinye Tao <[email protected]>

Cargo.lock

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,9 +3204,11 @@ dependencies = [
32043204
"rand",
32053205
"rand_xoshiro",
32063206
"rustc_data_structures",
3207+
"rustc_feature",
32073208
"rustc_index",
32083209
"rustc_macros",
32093210
"rustc_serialize",
3211+
"rustc_span",
32103212
"tracing",
32113213
]
32123214

@@ -3749,11 +3751,11 @@ dependencies = [
37493751
name = "rustc_hir_pretty"
37503752
version = "0.0.0"
37513753
dependencies = [
3754+
"rustc_abi",
37523755
"rustc_ast",
37533756
"rustc_ast_pretty",
37543757
"rustc_hir",
37553758
"rustc_span",
3756-
"rustc_target",
37573759
]
37583760

37593761
[[package]]
@@ -3938,14 +3940,14 @@ dependencies = [
39383940
name = "rustc_lint_defs"
39393941
version = "0.0.0"
39403942
dependencies = [
3943+
"rustc_abi",
39413944
"rustc_ast",
39423945
"rustc_data_structures",
39433946
"rustc_error_messages",
39443947
"rustc_hir",
39453948
"rustc_macros",
39463949
"rustc_serialize",
39473950
"rustc_span",
3948-
"rustc_target",
39493951
"serde",
39503952
]
39513953

@@ -4004,7 +4006,6 @@ dependencies = [
40044006
"rustc_span",
40054007
"rustc_target",
40064008
"rustc_type_ir",
4007-
"snap",
40084009
"tempfile",
40094010
"tracing",
40104011
]
@@ -4054,6 +4055,7 @@ version = "0.0.0"
40544055
dependencies = [
40554056
"either",
40564057
"itertools",
4058+
"rustc_abi",
40574059
"rustc_apfloat",
40584060
"rustc_arena",
40594061
"rustc_ast",
@@ -4069,7 +4071,6 @@ dependencies = [
40694071
"rustc_pattern_analysis",
40704072
"rustc_session",
40714073
"rustc_span",
4072-
"rustc_target",
40734074
"rustc_trait_selection",
40744075
"tracing",
40754076
]
@@ -4889,12 +4890,6 @@ version = "1.13.2"
48894890
source = "registry+https://github.com/rust-lang/crates.io-index"
48904891
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
48914892

4892-
[[package]]
4893-
name = "snap"
4894-
version = "1.1.1"
4895-
source = "registry+https://github.com/rust-lang/crates.io-index"
4896-
checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b"
4897-
48984893
[[package]]
48994894
name = "socket2"
49004895
version = "0.5.7"

compiler/rustc_abi/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ bitflags = "2.4.1"
99
rand = { version = "0.8.4", default-features = false, optional = true }
1010
rand_xoshiro = { version = "0.6.0", optional = true }
1111
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
12+
rustc_feature = { path = "../rustc_feature", optional = true }
1213
rustc_index = { path = "../rustc_index", default-features = false }
1314
rustc_macros = { path = "../rustc_macros", optional = true }
1415
rustc_serialize = { path = "../rustc_serialize", optional = true }
16+
rustc_span = { path = "../rustc_span", optional = true }
1517
tracing = "0.1"
1618
# tidy-alphabetical-end
1719

@@ -22,8 +24,10 @@ default = ["nightly", "randomize"]
2224
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
2325
nightly = [
2426
"dep:rustc_data_structures",
27+
"dep:rustc_feature",
2528
"dep:rustc_macros",
2629
"dep:rustc_serialize",
30+
"dep:rustc_span",
2731
"rustc_index/nightly",
2832
]
2933
randomize = ["dep:rand", "dep:rand_xoshiro", "nightly"]

compiler/rustc_target/src/spec/abi/mod.rs renamed to compiler/rustc_abi/src/extern_abi/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ use rustc_span::{Span, Symbol};
77
#[cfg(test)]
88
mod tests;
99

10+
use ExternAbi as Abi;
11+
1012
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug)]
1113
#[derive(HashStable_Generic, Encodable, Decodable)]
12-
pub enum Abi {
14+
pub enum ExternAbi {
1315
// Some of the ABIs come first because every time we add a new ABI, we have to re-bless all the
1416
// hashing tests. These are used in many places, so giving them stable values reduces test
1517
// churn. The specific values are meaningless.

compiler/rustc_abi/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// tidy-alphabetical-start
22
#![cfg_attr(feature = "nightly", allow(internal_features))]
33
#![cfg_attr(feature = "nightly", doc(rust_logo))]
4+
#![cfg_attr(feature = "nightly", feature(assert_matches))]
45
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
56
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
67
#![cfg_attr(feature = "nightly", feature(step_trait))]
@@ -28,8 +29,15 @@ mod layout;
2829
#[cfg(test)]
2930
mod tests;
3031

32+
#[cfg(feature = "nightly")]
33+
mod extern_abi;
34+
3135
pub use callconv::{Heterogeneous, HomogeneousAggregate, Reg, RegKind};
3236
#[cfg(feature = "nightly")]
37+
pub use extern_abi::{
38+
AbiDisabled, AbiUnsupported, ExternAbi, all_names, enabled_names, is_enabled, is_stable, lookup,
39+
};
40+
#[cfg(feature = "nightly")]
3341
pub use layout::{FIRST_VARIANT, FieldIdx, Layout, TyAbiInterface, TyAndLayout, VariantIdx};
3442
pub use layout::{LayoutCalculator, LayoutCalculatorError};
3543

compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,6 +2810,8 @@ pub struct ModSpans {
28102810
/// E.g., `extern { .. }` or `extern "C" { .. }`.
28112811
#[derive(Clone, Encodable, Decodable, Debug)]
28122812
pub struct ForeignMod {
2813+
/// Span of the `extern` keyword.
2814+
pub extern_span: Span,
28132815
/// `unsafe` keyword accepted syntactically for macro DSLs, but not
28142816
/// semantically by Rust.
28152817
pub safety: Safety,

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ pub fn walk_ty<T: MutVisitor>(vis: &mut T, ty: &mut P<Ty>) {
525525
}
526526

527527
fn walk_foreign_mod<T: MutVisitor>(vis: &mut T, foreign_mod: &mut ForeignMod) {
528-
let ForeignMod { safety, abi: _, items } = foreign_mod;
528+
let ForeignMod { extern_span: _, safety, abi: _, items } = foreign_mod;
529529
visit_safety(vis, safety);
530530
items.flat_map_in_place(|item| vis.flat_map_foreign_item(item));
531531
}

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ impl WalkItemKind for ItemKind {
366366
}
367367
ModKind::Unloaded => {}
368368
},
369-
ItemKind::ForeignMod(ForeignMod { safety: _, abi: _, items }) => {
369+
ItemKind::ForeignMod(ForeignMod { extern_span: _, safety: _, abi: _, items }) => {
370370
walk_list!(visitor, visit_foreign_item, items);
371371
}
372372
ItemKind::GlobalAsm(asm) => try_visit!(visitor.visit_inline_asm(asm)),

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,8 @@ impl<'a> AstValidator<'a> {
677677
Self::check_decl_no_pat(&bfty.decl, |span, _, _| {
678678
self.dcx().emit_err(errors::PatternFnPointer { span });
679679
});
680-
if let Extern::Implicit(_) = bfty.ext {
681-
let sig_span = self.sess.source_map().next_point(ty.span.shrink_to_lo());
682-
self.maybe_lint_missing_abi(sig_span, ty.id);
680+
if let Extern::Implicit(extern_span) = bfty.ext {
681+
self.maybe_lint_missing_abi(extern_span, ty.id);
683682
}
684683
}
685684
TyKind::TraitObject(bounds, ..) => {
@@ -953,7 +952,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
953952
walk_list!(self, visit_attribute, &item.attrs);
954953
return; // Avoid visiting again.
955954
}
956-
ItemKind::ForeignMod(ForeignMod { abi, safety, .. }) => {
955+
ItemKind::ForeignMod(ForeignMod { extern_span, abi, safety, .. }) => {
957956
self.with_in_extern_mod(*safety, |this| {
958957
let old_item = mem::replace(&mut this.extern_mod, Some(item.span));
959958
this.visibility_not_permitted(
@@ -977,7 +976,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
977976
}
978977

979978
if abi.is_none() {
980-
this.maybe_lint_missing_abi(item.span, item.id);
979+
this.maybe_lint_missing_abi(*extern_span, item.id);
981980
}
982981
visit::walk_item(this, item);
983982
this.extern_mod = old_item;
@@ -1350,13 +1349,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13501349
if let FnKind::Fn(
13511350
_,
13521351
_,
1353-
FnSig { span: sig_span, header: FnHeader { ext: Extern::Implicit(_), .. }, .. },
1352+
FnSig { header: FnHeader { ext: Extern::Implicit(extern_span), .. }, .. },
13541353
_,
13551354
_,
13561355
_,
13571356
) = fk
13581357
{
1359-
self.maybe_lint_missing_abi(*sig_span, id);
1358+
self.maybe_lint_missing_abi(*extern_span, id);
13601359
}
13611360

13621361
// Functions without bodies cannot have patterns.

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
15251525
matches!(
15261526
adj.kind,
15271527
ty::adjustment::Adjust::Borrow(ty::adjustment::AutoBorrow::Ref(
1528-
_,
15291528
ty::adjustment::AutoBorrowMutability::Not
15301529
| ty::adjustment::AutoBorrowMutability::Mut {
15311530
allow_two_phase_borrow: ty::adjustment::AllowTwoPhase::No

compiler/rustc_codegen_cranelift/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ use std::sync::Arc;
4040
use cranelift_codegen::isa::TargetIsa;
4141
use cranelift_codegen::settings::{self, Configurable};
4242
use rustc_codegen_ssa::CodegenResults;
43+
use rustc_codegen_ssa::back::versioned_llvm_target;
4344
use rustc_codegen_ssa::traits::CodegenBackend;
4445
use rustc_data_structures::profiling::SelfProfilerRef;
4546
use rustc_errors::ErrorGuaranteed;
@@ -260,7 +261,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
260261
}
261262

262263
fn target_triple(sess: &Session) -> target_lexicon::Triple {
263-
match sess.target.llvm_target.parse() {
264+
// FIXME(madsmtm): Use `sess.target.llvm_target` once target-lexicon supports unversioned macOS.
265+
// See <https://github.com/bytecodealliance/target-lexicon/pull/113>
266+
match versioned_llvm_target(sess).parse() {
264267
Ok(triple) => triple,
265268
Err(err) => sess.dcx().fatal(format!("target not recognized: {}", err)),
266269
}

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,6 @@ fn probestack_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attribute> {
232232
return None;
233233
}
234234

235-
// probestack doesn't play nice either with gcov profiling.
236-
if cx.sess().opts.unstable_opts.profile {
237-
return None;
238-
}
239-
240235
let attr_value = match cx.sess().target.stack_probes {
241236
StackProbeType::None => return None,
242237
// Request LLVM to generate the probes inline. If the given LLVM version does not support

0 commit comments

Comments
 (0)