Skip to content

Commit 0ee8f32

Browse files
authored
Merge pull request #4290 from RalfJung/rustup
Rustup
2 parents 288931b + f2bbc1b commit 0ee8f32

File tree

912 files changed

+16492
-9168
lines changed

Some content is hidden

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

912 files changed

+16492
-9168
lines changed

.github/workflows/ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ jobs:
125125
# which then uses log commands to actually set them.
126126
EXTRA_VARIABLES: ${{ toJson(matrix.env) }}
127127

128-
- name: setup upstream remote
129-
run: src/ci/scripts/setup-upstream-remote.sh
130-
131128
- name: ensure the channel matches the target branch
132129
run: src/ci/scripts/verify-channel.sh
133130

Cargo.lock

+23-63
Original file line numberDiff line numberDiff line change
@@ -546,12 +546,14 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
546546

547547
[[package]]
548548
name = "clippy"
549-
version = "0.1.87"
549+
version = "0.1.88"
550550
dependencies = [
551551
"anstream",
552+
"askama",
552553
"cargo_metadata 0.18.1",
553554
"clippy_config",
554555
"clippy_lints",
556+
"clippy_lints_internal",
555557
"clippy_utils",
556558
"color-print",
557559
"filetime",
@@ -562,7 +564,6 @@ dependencies = [
562564
"pulldown-cmark 0.11.3",
563565
"quote",
564566
"regex",
565-
"rinja",
566567
"rustc_tools_util 0.4.2",
567568
"serde",
568569
"serde_json",
@@ -577,7 +578,7 @@ dependencies = [
577578

578579
[[package]]
579580
name = "clippy_config"
580-
version = "0.1.87"
581+
version = "0.1.88"
581582
dependencies = [
582583
"clippy_utils",
583584
"itertools",
@@ -602,30 +603,37 @@ dependencies = [
602603

603604
[[package]]
604605
name = "clippy_lints"
605-
version = "0.1.87"
606+
version = "0.1.88"
606607
dependencies = [
607608
"arrayvec",
608609
"cargo_metadata 0.18.1",
609610
"clippy_config",
610611
"clippy_utils",
611612
"itertools",
612613
"quine-mc_cluskey",
613-
"regex",
614614
"regex-syntax 0.8.5",
615615
"semver",
616616
"serde",
617-
"serde_json",
618-
"tempfile",
619617
"toml 0.7.8",
620618
"unicode-normalization",
621619
"unicode-script",
622620
"url",
623621
"walkdir",
624622
]
625623

624+
[[package]]
625+
name = "clippy_lints_internal"
626+
version = "0.0.1"
627+
dependencies = [
628+
"clippy_config",
629+
"clippy_utils",
630+
"regex",
631+
"rustc-semver",
632+
]
633+
626634
[[package]]
627635
name = "clippy_utils"
628-
version = "0.1.87"
636+
version = "0.1.88"
629637
dependencies = [
630638
"arrayvec",
631639
"itertools",
@@ -2244,22 +2252,6 @@ dependencies = [
22442252
"libc",
22452253
]
22462254

2247-
[[package]]
2248-
name = "mime"
2249-
version = "0.3.17"
2250-
source = "registry+https://github.com/rust-lang/crates.io-index"
2251-
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
2252-
2253-
[[package]]
2254-
name = "mime_guess"
2255-
version = "2.0.5"
2256-
source = "registry+https://github.com/rust-lang/crates.io-index"
2257-
checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
2258-
dependencies = [
2259-
"mime",
2260-
"unicase",
2261-
]
2262-
22632255
[[package]]
22642256
name = "minifier"
22652257
version = "0.3.5"
@@ -3084,45 +3076,6 @@ dependencies = [
30843076
"walkdir",
30853077
]
30863078

3087-
[[package]]
3088-
name = "rinja"
3089-
version = "0.3.5"
3090-
source = "registry+https://github.com/rust-lang/crates.io-index"
3091-
checksum = "3dc4940d00595430b3d7d5a01f6222b5e5b51395d1120bdb28d854bb8abb17a5"
3092-
dependencies = [
3093-
"itoa",
3094-
"rinja_derive",
3095-
]
3096-
3097-
[[package]]
3098-
name = "rinja_derive"
3099-
version = "0.3.5"
3100-
source = "registry+https://github.com/rust-lang/crates.io-index"
3101-
checksum = "08d9ed0146aef6e2825f1b1515f074510549efba38d71f4554eec32eb36ba18b"
3102-
dependencies = [
3103-
"basic-toml",
3104-
"memchr",
3105-
"mime",
3106-
"mime_guess",
3107-
"proc-macro2",
3108-
"quote",
3109-
"rinja_parser",
3110-
"rustc-hash 2.1.1",
3111-
"serde",
3112-
"syn 2.0.100",
3113-
]
3114-
3115-
[[package]]
3116-
name = "rinja_parser"
3117-
version = "0.3.5"
3118-
source = "registry+https://github.com/rust-lang/crates.io-index"
3119-
checksum = "93f9a866e2e00a7a1fb27e46e9e324a6f7c0e7edc4543cae1d38f4e4a100c610"
3120-
dependencies = [
3121-
"memchr",
3122-
"nom",
3123-
"serde",
3124-
]
3125-
31263079
[[package]]
31273080
name = "run_make_support"
31283081
version = "0.2.0"
@@ -3196,6 +3149,12 @@ dependencies = [
31963149
"crossbeam-utils",
31973150
]
31983151

3152+
[[package]]
3153+
name = "rustc-semver"
3154+
version = "1.1.0"
3155+
source = "registry+https://github.com/rust-lang/crates.io-index"
3156+
checksum = "5be1bdc7edf596692617627bbfeaba522131b18e06ca4df2b6b689e3c5d5ce84"
3157+
31993158
[[package]]
32003159
name = "rustc-stable-hash"
32013160
version = "0.1.2"
@@ -4562,6 +4521,7 @@ dependencies = [
45624521
"rustc_hir",
45634522
"rustc_middle",
45644523
"rustc_span",
4524+
"smallvec",
45654525
"tracing",
45664526
]
45674527

compiler/rustc_ast_lowering/src/path.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_hir as hir;
55
use rustc_hir::GenericArg;
66
use rustc_hir::def::{DefKind, PartialRes, Res};
77
use rustc_hir::def_id::DefId;
8-
use rustc_middle::span_bug;
8+
use rustc_middle::{span_bug, ty};
99
use rustc_session::parse::add_feature_diagnostics;
1010
use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, Ident, Span, Symbol, sym};
1111
use smallvec::{SmallVec, smallvec};
@@ -590,14 +590,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
590590
/// lowering of `async Fn()` bounds to desugar to another trait like `LendingFn`.
591591
fn map_trait_to_async_trait(&self, def_id: DefId) -> Option<DefId> {
592592
let lang_items = self.tcx.lang_items();
593-
if Some(def_id) == lang_items.fn_trait() {
594-
lang_items.async_fn_trait()
595-
} else if Some(def_id) == lang_items.fn_mut_trait() {
596-
lang_items.async_fn_mut_trait()
597-
} else if Some(def_id) == lang_items.fn_once_trait() {
598-
lang_items.async_fn_once_trait()
599-
} else {
600-
None
593+
match self.tcx.fn_trait_kind_from_def_id(def_id)? {
594+
ty::ClosureKind::Fn => lang_items.async_fn_trait(),
595+
ty::ClosureKind::FnMut => lang_items.async_fn_mut_trait(),
596+
ty::ClosureKind::FnOnce => lang_items.async_fn_once_trait(),
601597
}
602598
}
603599
}

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1265,12 +1265,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
12651265
&& let CallKind::FnCall { fn_trait_id, self_ty } = kind
12661266
&& let ty::Param(_) = self_ty.kind()
12671267
&& ty == self_ty
1268-
&& [
1269-
self.infcx.tcx.lang_items().fn_once_trait(),
1270-
self.infcx.tcx.lang_items().fn_mut_trait(),
1271-
self.infcx.tcx.lang_items().fn_trait(),
1272-
]
1273-
.contains(&Some(fn_trait_id))
1268+
&& self.infcx.tcx.fn_trait_kind_from_def_id(fn_trait_id).is_some()
12741269
{
12751270
// Do not suggest `F: FnOnce() + Clone`.
12761271
false

compiler/rustc_borrowck/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,12 @@ struct MirBorrowckCtxt<'a, 'infcx, 'tcx> {
702702
// 2. loans made in overlapping scopes do not conflict
703703
// 3. assignments do not affect things loaned out as immutable
704704
// 4. moves do not affect things loaned out in any way
705-
impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a, '_, 'tcx> {
705+
impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a, '_, 'tcx> {
706706
fn visit_after_early_statement_effect(
707707
&mut self,
708708
_results: &mut Results<'tcx, Borrowck<'a, 'tcx>>,
709709
state: &BorrowckDomain,
710-
stmt: &'a Statement<'tcx>,
710+
stmt: &Statement<'tcx>,
711711
location: Location,
712712
) {
713713
debug!("MirBorrowckCtxt::process_statement({:?}, {:?}): {:?}", location, stmt, state);
@@ -783,7 +783,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
783783
&mut self,
784784
_results: &mut Results<'tcx, Borrowck<'a, 'tcx>>,
785785
state: &BorrowckDomain,
786-
term: &'a Terminator<'tcx>,
786+
term: &Terminator<'tcx>,
787787
loc: Location,
788788
) {
789789
debug!("MirBorrowckCtxt::process_terminator({:?}, {:?}): {:?}", loc, term, state);
@@ -896,7 +896,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
896896
&mut self,
897897
_results: &mut Results<'tcx, Borrowck<'a, 'tcx>>,
898898
state: &BorrowckDomain,
899-
term: &'a Terminator<'tcx>,
899+
term: &Terminator<'tcx>,
900900
loc: Location,
901901
) {
902902
let span = term.source_info.span;
@@ -1363,7 +1363,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
13631363
fn consume_rvalue(
13641364
&mut self,
13651365
location: Location,
1366-
(rvalue, span): (&'a Rvalue<'tcx>, Span),
1366+
(rvalue, span): (&Rvalue<'tcx>, Span),
13671367
state: &BorrowckDomain,
13681368
) {
13691369
match rvalue {
@@ -1636,7 +1636,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
16361636
fn consume_operand(
16371637
&mut self,
16381638
location: Location,
1639-
(operand, span): (&'a Operand<'tcx>, Span),
1639+
(operand, span): (&Operand<'tcx>, Span),
16401640
state: &BorrowckDomain,
16411641
) {
16421642
match *operand {

compiler/rustc_codegen_cranelift/example/std_example.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
unboxed_closures
99
)]
1010
#![allow(internal_features)]
11-
// FIXME once abi_unsupported_vector_types is a hard error disable the foo test when the respective
12-
// target feature is not enabled.
13-
#![allow(abi_unsupported_vector_types)]
1411

1512
#[cfg(target_arch = "x86_64")]
1613
use std::arch::x86_64::*;

compiler/rustc_const_eval/src/util/type_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
5656
| ty::Coroutine(def_id, args) => self.print_def_path(def_id, args),
5757
ty::Foreign(def_id) => self.print_def_path(def_id, &[]),
5858

59-
ty::Alias(ty::Weak, _) => bug!("type_name: unexpected weak projection"),
59+
ty::Alias(ty::Free, _) => bug!("type_name: unexpected free alias"),
6060
ty::Alias(ty::Inherent, _) => bug!("type_name: unexpected inherent projection"),
6161
ty::CoroutineWitness(..) => bug!("type_name: unexpected `CoroutineWitness`"),
6262
}

compiler/rustc_hir_analysis/src/check/intrinsic.rs

+26-34
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
33
use rustc_abi::ExternAbi;
44
use rustc_errors::DiagMessage;
5-
use rustc_hir::{self as hir};
6-
use rustc_middle::bug;
5+
use rustc_hir::{self as hir, LangItem};
76
use rustc_middle::traits::{ObligationCause, ObligationCauseCode};
87
use rustc_middle::ty::{self, Ty, TyCtxt};
98
use rustc_span::def_id::LocalDefId;
@@ -173,23 +172,22 @@ pub(crate) fn check_intrinsic_type(
173172
ty::BoundVariableKind::Region(ty::BoundRegionKind::ClosureEnv),
174173
]);
175174
let mk_va_list_ty = |mutbl| {
176-
tcx.lang_items().va_list().map(|did| {
177-
let region = ty::Region::new_bound(
178-
tcx,
179-
ty::INNERMOST,
180-
ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BoundRegionKind::Anon },
181-
);
182-
let env_region = ty::Region::new_bound(
183-
tcx,
184-
ty::INNERMOST,
185-
ty::BoundRegion {
186-
var: ty::BoundVar::from_u32(2),
187-
kind: ty::BoundRegionKind::ClosureEnv,
188-
},
189-
);
190-
let va_list_ty = tcx.type_of(did).instantiate(tcx, &[region.into()]);
191-
(Ty::new_ref(tcx, env_region, va_list_ty, mutbl), va_list_ty)
192-
})
175+
let did = tcx.require_lang_item(LangItem::VaList, Some(span));
176+
let region = ty::Region::new_bound(
177+
tcx,
178+
ty::INNERMOST,
179+
ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BoundRegionKind::Anon },
180+
);
181+
let env_region = ty::Region::new_bound(
182+
tcx,
183+
ty::INNERMOST,
184+
ty::BoundRegion {
185+
var: ty::BoundVar::from_u32(2),
186+
kind: ty::BoundRegionKind::ClosureEnv,
187+
},
188+
);
189+
let va_list_ty = tcx.type_of(did).instantiate(tcx, &[region.into()]);
190+
(Ty::new_ref(tcx, env_region, va_list_ty, mutbl), va_list_ty)
193191
};
194192

195193
let (n_tps, n_lts, n_cts, inputs, output, safety) = if name_str.starts_with("atomic_") {
@@ -548,23 +546,17 @@ pub(crate) fn check_intrinsic_type(
548546
)
549547
}
550548

551-
sym::va_start | sym::va_end => match mk_va_list_ty(hir::Mutability::Mut) {
552-
Some((va_list_ref_ty, _)) => (0, 0, vec![va_list_ref_ty], tcx.types.unit),
553-
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
554-
},
549+
sym::va_start | sym::va_end => {
550+
(0, 0, vec![mk_va_list_ty(hir::Mutability::Mut).0], tcx.types.unit)
551+
}
555552

556-
sym::va_copy => match mk_va_list_ty(hir::Mutability::Not) {
557-
Some((va_list_ref_ty, va_list_ty)) => {
558-
let va_list_ptr_ty = Ty::new_mut_ptr(tcx, va_list_ty);
559-
(0, 0, vec![va_list_ptr_ty, va_list_ref_ty], tcx.types.unit)
560-
}
561-
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
562-
},
553+
sym::va_copy => {
554+
let (va_list_ref_ty, va_list_ty) = mk_va_list_ty(hir::Mutability::Not);
555+
let va_list_ptr_ty = Ty::new_mut_ptr(tcx, va_list_ty);
556+
(0, 0, vec![va_list_ptr_ty, va_list_ref_ty], tcx.types.unit)
557+
}
563558

564-
sym::va_arg => match mk_va_list_ty(hir::Mutability::Mut) {
565-
Some((va_list_ref_ty, _)) => (1, 0, vec![va_list_ref_ty], param(0)),
566-
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
567-
},
559+
sym::va_arg => (1, 0, vec![mk_va_list_ty(hir::Mutability::Mut).0], param(0)),
568560

569561
sym::nontemporal_store => {
570562
(1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], tcx.types.unit)

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ fn check_variances_for_type_defn<'tcx>(
19911991
ItemKind::TyAlias(..) => {
19921992
assert!(
19931993
tcx.type_alias_is_lazy(item.owner_id),
1994-
"should not be computing variance of non-weak type alias"
1994+
"should not be computing variance of non-free type alias"
19951995
);
19961996
}
19971997
kind => span_bug!(item.span, "cannot compute the variances of {kind:?}"),
@@ -2223,7 +2223,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for IsProbablyCyclical<'tcx> {
22232223
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<(), ()> {
22242224
let def_id = match ty.kind() {
22252225
ty::Adt(adt_def, _) => Some(adt_def.did()),
2226-
ty::Alias(ty::Weak, alias_ty) => Some(alias_ty.def_id),
2226+
ty::Alias(ty::Free, alias_ty) => Some(alias_ty.def_id),
22272227
_ => None,
22282228
};
22292229
if let Some(def_id) = def_id {

compiler/rustc_hir_analysis/src/coherence/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ fn visit_implementation_of_pointer_like(checker: &Checker<'_>) -> Result<(), Err
750750
ObligationCause::misc(impl_span, checker.impl_def_id),
751751
param_env,
752752
nontrivial_field_ty,
753-
tcx.lang_items().pointer_like().unwrap(),
753+
tcx.require_lang_item(LangItem::PointerLike, Some(impl_span)),
754754
);
755755
// FIXME(dyn-star): We should regionck this implementation.
756756
if ocx.select_all_or_error().is_empty() {

0 commit comments

Comments
 (0)