Skip to content
/ rust Public
forked from rust-lang/rust

Commit cd952c8

Browse files
committed
Auto merge of rust-lang#2756 - RalfJung:rustup, r=RalfJung
Rustup
2 parents cb15925 + 4aa07c9 commit cd952c8

File tree

28,583 files changed

+28917
-13448
lines changed

Some content is hidden

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

28,583 files changed

+28917
-13448
lines changed

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ a06baa56b95674fc626b3c3fd680d6a65357fe60
66
971c549ca334b7b7406e61e958efcca9c4152822
77
# refactor infcx building
88
283abbf0e7d20176f76006825b5c52e9a4234e4c
9+
# format libstd/sys
10+
c34fbfaad38cf5829ef5cfe780dc9d58480adeaa

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ jobs:
342342
os: macos-12-xl
343343
- name: x86_64-apple-1
344344
env:
345-
SCRIPT: "./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps"
345+
SCRIPT: "./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps"
346346
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
347347
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
348348
MACOSX_DEPLOYMENT_TARGET: 10.8
@@ -353,7 +353,7 @@ jobs:
353353
os: macos-12-xl
354354
- name: x86_64-apple-2
355355
env:
356-
SCRIPT: "./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps"
356+
SCRIPT: "./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps"
357357
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
358358
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
359359
MACOSX_DEPLOYMENT_TARGET: 10.8

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Session.vim
2626
.valgrindrc
2727
.cargo
2828
# Included because it is part of the test case
29-
!/src/test/run-make/thumb-none-qemu/example/.cargo
29+
!/tests/run-make/thumb-none-qemu/example/.cargo
3030

3131
## Configuration
3232
/config.toml
@@ -74,6 +74,6 @@ package-lock.json
7474
package.json
7575

7676
## Rustdoc GUI tests
77-
src/test/rustdoc-gui/src/**.lock
77+
tests/rustdoc-gui/src/**.lock
7878

7979
# Before adding new lines, see the comment at the top.

Cargo.lock

+36-17
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ version = "0.1.1"
203203
source = "registry+https://github.com/rust-lang/crates.io-index"
204204
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
205205

206+
[[package]]
207+
name = "base64"
208+
version = "0.13.1"
209+
source = "registry+https://github.com/rust-lang/crates.io-index"
210+
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
211+
206212
[[package]]
207213
name = "base64ct"
208214
version = "1.5.3"
@@ -328,6 +334,7 @@ name = "cargo"
328334
version = "0.69.0"
329335
dependencies = [
330336
"anyhow",
337+
"base64",
331338
"bytesize",
332339
"cargo-platform 0.1.2",
333340
"cargo-test-macro",
@@ -345,6 +352,7 @@ dependencies = [
345352
"git2-curl",
346353
"glob",
347354
"hex 0.4.2",
355+
"hmac",
348356
"home",
349357
"http-auth",
350358
"humantime 2.0.1",
@@ -375,6 +383,7 @@ dependencies = [
375383
"serde-value",
376384
"serde_ignored",
377385
"serde_json",
386+
"sha1",
378387
"shell-escape",
379388
"snapbox",
380389
"strip-ansi-escapes",
@@ -1778,9 +1787,9 @@ dependencies = [
17781787

17791788
[[package]]
17801789
name = "git2"
1781-
version = "0.15.0"
1790+
version = "0.16.0"
17821791
source = "registry+https://github.com/rust-lang/crates.io-index"
1783-
checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1"
1792+
checksum = "be36bc9e0546df253c0cc41fd0af34f5e92845ad8509462ec76672fac6997f5b"
17841793
dependencies = [
17851794
"bitflags",
17861795
"libc",
@@ -1793,9 +1802,9 @@ dependencies = [
17931802

17941803
[[package]]
17951804
name = "git2-curl"
1796-
version = "0.16.0"
1805+
version = "0.17.0"
17971806
source = "registry+https://github.com/rust-lang/crates.io-index"
1798-
checksum = "ed817a00721e2f8037ba722e60358d4956dae9cca10315fc982f967907d3b0cd"
1807+
checksum = "7577f4e6341ba7c90d883511130a45b956c274ba5f4d205d9f9da990f654cd33"
17991808
dependencies = [
18001809
"curl",
18011810
"git2",
@@ -2335,9 +2344,9 @@ dependencies = [
23352344

23362345
[[package]]
23372346
name = "libgit2-sys"
2338-
version = "0.14.0+1.5.0"
2347+
version = "0.14.1+1.5.0"
23392348
source = "registry+https://github.com/rust-lang/crates.io-index"
2340-
checksum = "47a00859c70c8a4f7218e6d1cc32875c4b55f6799445b842b0d8ed5e4c3d959b"
2349+
checksum = "4a07fb2692bc3593bda59de45a502bb3071659f2c515e28c71e728306b038e17"
23412350
dependencies = [
23422351
"cc",
23432352
"libc",
@@ -5025,18 +5034,18 @@ checksum = "1ef965a420fe14fdac7dd018862966a4c14094f900e1650bbc71ddd7d580c8af"
50255034

50265035
[[package]]
50275036
name = "semver"
5028-
version = "1.0.14"
5037+
version = "1.0.12"
50295038
source = "registry+https://github.com/rust-lang/crates.io-index"
5030-
checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
5039+
checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1"
50315040
dependencies = [
50325041
"serde",
50335042
]
50345043

50355044
[[package]]
50365045
name = "serde"
5037-
version = "1.0.152"
5046+
version = "1.0.147"
50385047
source = "registry+https://github.com/rust-lang/crates.io-index"
5039-
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
5048+
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
50405049
dependencies = [
50415050
"serde_derive",
50425051
]
@@ -5053,9 +5062,9 @@ dependencies = [
50535062

50545063
[[package]]
50555064
name = "serde_derive"
5056-
version = "1.0.152"
5065+
version = "1.0.147"
50575066
source = "registry+https://github.com/rust-lang/crates.io-index"
5058-
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
5067+
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
50595068
dependencies = [
50605069
"proc-macro2",
50615070
"quote",
@@ -5073,9 +5082,9 @@ dependencies = [
50735082

50745083
[[package]]
50755084
name = "serde_json"
5076-
version = "1.0.91"
5085+
version = "1.0.85"
50775086
source = "registry+https://github.com/rust-lang/crates.io-index"
5078-
checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
5087+
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
50795088
dependencies = [
50805089
"indexmap",
50815090
"itoa",
@@ -5094,6 +5103,17 @@ dependencies = [
50945103
"digest",
50955104
]
50965105

5106+
[[package]]
5107+
name = "sha1"
5108+
version = "0.10.5"
5109+
source = "registry+https://github.com/rust-lang/crates.io-index"
5110+
checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
5111+
dependencies = [
5112+
"cfg-if",
5113+
"cpufeatures",
5114+
"digest",
5115+
]
5116+
50975117
[[package]]
50985118
name = "sha2"
50995119
version = "0.10.6"
@@ -5380,9 +5400,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
53805400

53815401
[[package]]
53825402
name = "syn"
5383-
version = "1.0.107"
5403+
version = "1.0.102"
53845404
source = "registry+https://github.com/rust-lang/crates.io-index"
5385-
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
5405+
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
53865406
dependencies = [
53875407
"proc-macro2",
53885408
"quote",
@@ -5556,7 +5576,6 @@ dependencies = [
55565576
"lazy_static",
55575577
"miropt-test-tools",
55585578
"regex",
5559-
"semver",
55605579
"termcolor",
55615580
"walkdir",
55625581
]

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ exclude = [
5151
"compiler/rustc_codegen_cranelift",
5252
"compiler/rustc_codegen_gcc",
5353
"src/bootstrap",
54-
"src/test/rustdoc-gui",
54+
"tests/rustdoc-gui",
5555
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
5656
"obj",
5757
# The `x` binary is a thin wrapper that calls `x.py`, which initializes

RELEASES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Version 1.66.1 (2023-01-10)
2+
===========================
3+
4+
- Added validation of SSH host keys for git URLs in Cargo ([CVE-2022-46176](https://www.cve.org/CVERecord?id=CVE-2022-46176))
5+
16
Version 1.66.0 (2022-12-15)
27
==========================
38

compiler/rustc_abi/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1263,8 +1263,8 @@ pub enum Variants<V: Idx> {
12631263

12641264
/// Enum-likes with more than one inhabited variant: each variant comes with
12651265
/// a *discriminant* (usually the same as the variant index but the user can
1266-
/// assign explicit discriminant values). That discriminant is encoded
1267-
/// as a *tag* on the machine. The layout of each variant is
1266+
/// assign explicit discriminant values). That discriminant is encoded
1267+
/// as a *tag* on the machine. The layout of each variant is
12681268
/// a struct, and they all have space reserved for the tag.
12691269
/// For enums, the tag is the sole field of the layout.
12701270
Multiple {

compiler/rustc_ast/src/ast.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,7 @@ impl Expr {
13071307
pub struct Closure {
13081308
pub binder: ClosureBinder,
13091309
pub capture_clause: CaptureBy,
1310+
pub constness: Const,
13101311
pub asyncness: Async,
13111312
pub movability: Movability,
13121313
pub fn_decl: P<FnDecl>,

compiler/rustc_ast/src/mut_visit.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
13621362
ExprKind::Closure(box Closure {
13631363
binder,
13641364
capture_clause: _,
1365+
constness,
13651366
asyncness,
13661367
movability: _,
13671368
fn_decl,
@@ -1370,6 +1371,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
13701371
fn_arg_span: _,
13711372
}) => {
13721373
vis.visit_closure_binder(binder);
1374+
visit_constness(constness, vis);
13731375
vis.visit_asyncness(asyncness);
13741376
vis.visit_fn_decl(fn_decl);
13751377
vis.visit_expr(body);

compiler/rustc_ast/src/util/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl ExprPrecedence {
304304
| ExprPrecedence::Yeet => PREC_JUMP,
305305

306306
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
307-
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
307+
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
308308
// ensures that `pprust` will add parentheses in the right places to get the desired
309309
// parse.
310310
ExprPrecedence::Range => PREC_RANGE,

compiler/rustc_ast/src/visit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
836836
binder,
837837
capture_clause: _,
838838
asyncness: _,
839+
constness: _,
839840
movability: _,
840841
fn_decl,
841842
body,

compiler/rustc_ast_lowering/src/expr.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
209209
ExprKind::Closure(box Closure {
210210
binder,
211211
capture_clause,
212+
constness,
212213
asyncness,
213214
movability,
214215
fn_decl,
@@ -233,6 +234,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
233234
binder,
234235
*capture_clause,
235236
e.id,
237+
*constness,
236238
*movability,
237239
fn_decl,
238240
body,
@@ -651,6 +653,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
651653
fn_decl_span: self.lower_span(span),
652654
fn_arg_span: None,
653655
movability: Some(hir::Movability::Static),
656+
constness: hir::Constness::NotConst,
654657
});
655658

656659
hir::ExprKind::Closure(c)
@@ -689,8 +692,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
689692
// call (like the identity function), as otherwise type and lifetime
690693
// inference have a hard time figuring things out.
691694
// Without this, we would get:
692-
// E0720 in src/test/ui/impl-trait/in-trait/default-body-with-rpit.rs
693-
// E0700 in src/test/ui/self/self_lifetime-async.rs
695+
// E0720 in tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
696+
// E0700 in tests/ui/self/self_lifetime-async.rs
694697

695698
// `future::identity_future`:
696699
let identity_future =
@@ -890,6 +893,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
890893
binder: &ClosureBinder,
891894
capture_clause: CaptureBy,
892895
closure_id: NodeId,
896+
constness: Const,
893897
movability: Movability,
894898
decl: &FnDecl,
895899
body: &Expr,
@@ -927,6 +931,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
927931
fn_decl_span: self.lower_span(fn_decl_span),
928932
fn_arg_span: Some(self.lower_span(fn_arg_span)),
929933
movability: generator_option,
934+
constness: self.lower_constness(constness),
930935
});
931936

932937
hir::ExprKind::Closure(c)
@@ -1041,6 +1046,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10411046
fn_decl_span: self.lower_span(fn_decl_span),
10421047
fn_arg_span: Some(self.lower_span(fn_arg_span)),
10431048
movability: None,
1049+
constness: hir::Constness::NotConst,
10441050
});
10451051
hir::ExprKind::Closure(c)
10461052
}

compiler/rustc_ast_lowering/src/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub(super) fn index_hir<'hir>(
3838
) -> (IndexVec<ItemLocalId, Option<ParentedNode<'hir>>>, FxHashMap<LocalDefId, ItemLocalId>) {
3939
let mut nodes = IndexVec::new();
4040
// This node's parent should never be accessed: the owner's parent is computed by the
41-
// hir_owner_parent query. Make it invalid (= ItemLocalId::MAX) to force an ICE whenever it is
41+
// hir_owner_parent query. Make it invalid (= ItemLocalId::MAX) to force an ICE whenever it is
4242
// used.
4343
nodes.push(Some(ParentedNode { parent: ItemLocalId::INVALID, node: item.into() }));
4444
let mut collector = NodeCollector {

compiler/rustc_ast_lowering/src/item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
523523
//
524524
// The first two are produced by recursively invoking
525525
// `lower_use_tree` (and indeed there may be things
526-
// like `use foo::{a::{b, c}}` and so forth). They
526+
// like `use foo::{a::{b, c}}` and so forth). They
527527
// wind up being directly added to
528528
// `self.items`. However, the structure of this
529529
// function also requires us to return one item, and
@@ -1239,7 +1239,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12391239
}
12401240
}
12411241

1242-
fn lower_constness(&mut self, c: Const) -> hir::Constness {
1242+
pub(super) fn lower_constness(&mut self, c: Const) -> hir::Constness {
12431243
match c {
12441244
Const::Yes(_) => hir::Constness::Const,
12451245
Const::No => hir::Constness::NotConst,

compiler/rustc_ast_lowering/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
663663
self.arena.alloc(hir::OwnerInfo { nodes, parenting, attrs, trait_map })
664664
}
665665

666-
/// Hash the HIR node twice, one deep and one shallow hash. This allows to differentiate
666+
/// Hash the HIR node twice, one deep and one shallow hash. This allows to differentiate
667667
/// queries which depend on the full HIR tree and those which only depend on the item signature.
668668
fn hash_owner(
669669
&mut self,
@@ -1194,7 +1194,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11941194
itctx: &ImplTraitContext,
11951195
) -> hir::Ty<'hir> {
11961196
// Check whether we should interpret this as a bare trait object.
1197-
// This check mirrors the one in late resolution. We only introduce this special case in
1197+
// This check mirrors the one in late resolution. We only introduce this special case in
11981198
// the rare occurrence we need to lower `Fresh` anonymous lifetimes.
11991199
// The other cases when a qpath should be opportunistically made a trait object are handled
12001200
// by `ty_path`.
@@ -1919,7 +1919,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19191919
this.with_remapping(new_remapping, |this| {
19201920
// We have to be careful to get elision right here. The
19211921
// idea is that we create a lifetime parameter for each
1922-
// lifetime in the return type. So, given a return type
1922+
// lifetime in the return type. So, given a return type
19231923
// like `async fn foo(..) -> &[&u32]`, we lower to `impl
19241924
// Future<Output = &'1 [ &'2 u32 ]>`.
19251925
//
@@ -2013,7 +2013,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20132013

20142014
// Create the `Foo<...>` reference itself. Note that the `type
20152015
// Foo = impl Trait` is, internally, created as a child of the
2016-
// async fn, so the *type parameters* are inherited. It's
2016+
// async fn, so the *type parameters* are inherited. It's
20172017
// only the lifetime parameters that we must supply.
20182018
let opaque_ty_ref = hir::TyKind::OpaqueDef(
20192019
hir::ItemId { owner_id: hir::OwnerId { def_id: opaque_ty_def_id } },

0 commit comments

Comments
 (0)