Skip to content

Commit cf6b862

Browse files
committed
Auto merge of rust-lang#2842 - RalfJung:rustup, r=RalfJung
Rustup Also add a test for rust-lang#110233
2 parents ffb0dd9 + 8a9e03a commit cf6b862

File tree

1,058 files changed

+13460
-7975
lines changed

Some content is hidden

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

1,058 files changed

+13460
-7975
lines changed

Cargo.lock

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ dependencies = [
830830
name = "clippy_lints"
831831
version = "0.1.70"
832832
dependencies = [
833+
"arrayvec 0.7.0",
833834
"cargo_metadata 0.15.3",
834835
"clippy_utils",
835836
"declare_clippy_lint",
@@ -1685,9 +1686,9 @@ dependencies = [
16851686

16861687
[[package]]
16871688
name = "futures"
1688-
version = "0.3.19"
1689+
version = "0.3.28"
16891690
source = "registry+https://github.com/rust-lang/crates.io-index"
1690-
checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4"
1691+
checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40"
16911692
dependencies = [
16921693
"futures-channel",
16931694
"futures-core",
@@ -1700,25 +1701,25 @@ dependencies = [
17001701

17011702
[[package]]
17021703
name = "futures-channel"
1703-
version = "0.3.19"
1704+
version = "0.3.28"
17041705
source = "registry+https://github.com/rust-lang/crates.io-index"
1705-
checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b"
1706+
checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2"
17061707
dependencies = [
17071708
"futures-core",
17081709
"futures-sink",
17091710
]
17101711

17111712
[[package]]
17121713
name = "futures-core"
1713-
version = "0.3.19"
1714+
version = "0.3.28"
17141715
source = "registry+https://github.com/rust-lang/crates.io-index"
1715-
checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7"
1716+
checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
17161717

17171718
[[package]]
17181719
name = "futures-executor"
1719-
version = "0.3.19"
1720+
version = "0.3.28"
17201721
source = "registry+https://github.com/rust-lang/crates.io-index"
1721-
checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a"
1722+
checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0"
17221723
dependencies = [
17231724
"futures-core",
17241725
"futures-task",
@@ -1727,38 +1728,38 @@ dependencies = [
17271728

17281729
[[package]]
17291730
name = "futures-io"
1730-
version = "0.3.19"
1731+
version = "0.3.28"
17311732
source = "registry+https://github.com/rust-lang/crates.io-index"
1732-
checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2"
1733+
checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964"
17331734

17341735
[[package]]
17351736
name = "futures-macro"
1736-
version = "0.3.19"
1737+
version = "0.3.28"
17371738
source = "registry+https://github.com/rust-lang/crates.io-index"
1738-
checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c"
1739+
checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
17391740
dependencies = [
17401741
"proc-macro2",
17411742
"quote",
1742-
"syn 1.0.102",
1743+
"syn 2.0.8",
17431744
]
17441745

17451746
[[package]]
17461747
name = "futures-sink"
1747-
version = "0.3.19"
1748+
version = "0.3.28"
17481749
source = "registry+https://github.com/rust-lang/crates.io-index"
1749-
checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508"
1750+
checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e"
17501751

17511752
[[package]]
17521753
name = "futures-task"
1753-
version = "0.3.19"
1754+
version = "0.3.28"
17541755
source = "registry+https://github.com/rust-lang/crates.io-index"
1755-
checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72"
1756+
checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65"
17561757

17571758
[[package]]
17581759
name = "futures-util"
1759-
version = "0.3.19"
1760+
version = "0.3.28"
17601761
source = "registry+https://github.com/rust-lang/crates.io-index"
1761-
checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164"
1762+
checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
17621763
dependencies = [
17631764
"futures-channel",
17641765
"futures-core",
@@ -1841,9 +1842,9 @@ dependencies = [
18411842

18421843
[[package]]
18431844
name = "git2"
1844-
version = "0.16.0"
1845+
version = "0.17.0"
18451846
source = "registry+https://github.com/rust-lang/crates.io-index"
1846-
checksum = "be36bc9e0546df253c0cc41fd0af34f5e92845ad8509462ec76672fac6997f5b"
1847+
checksum = "89511277159354bea13ae1e53e0c9ab85ba1b20d7e91618fa30e6bc5566857fb"
18471848
dependencies = [
18481849
"bitflags",
18491850
"libc",
@@ -1856,9 +1857,9 @@ dependencies = [
18561857

18571858
[[package]]
18581859
name = "git2-curl"
1859-
version = "0.17.0"
1860+
version = "0.18.0"
18601861
source = "registry+https://github.com/rust-lang/crates.io-index"
1861-
checksum = "7577f4e6341ba7c90d883511130a45b956c274ba5f4d205d9f9da990f654cd33"
1862+
checksum = "f8f8b7432b72928cff76f69e59ed5327f94a52763731e71274960dee72fe5f8c"
18621863
dependencies = [
18631864
"curl",
18641865
"git2",
@@ -2768,13 +2769,11 @@ dependencies = [
27682769
"anyhow",
27692770
"clap 3.2.20",
27702771
"flate2",
2771-
"lazy_static",
27722772
"num_cpus",
27732773
"rayon",
27742774
"remove_dir_all",
27752775
"tar",
27762776
"walkdir",
2777-
"winapi",
27782777
"xz2",
27792778
]
27802779

@@ -2962,9 +2961,9 @@ dependencies = [
29622961

29632962
[[package]]
29642963
name = "libgit2-sys"
2965-
version = "0.14.1+1.5.0"
2964+
version = "0.15.0+1.6.3"
29662965
source = "registry+https://github.com/rust-lang/crates.io-index"
2967-
checksum = "4a07fb2692bc3593bda59de45a502bb3071659f2c515e28c71e728306b038e17"
2966+
checksum = "032e537ae4dd4e50c877f258dc55fcd0657b5021f454094a425bb6bcc9edea4c"
29682967
dependencies = [
29692968
"cc",
29702969
"libc",
@@ -3002,9 +3001,9 @@ dependencies = [
30023001

30033002
[[package]]
30043003
name = "libssh2-sys"
3005-
version = "0.2.23"
3004+
version = "0.3.0"
30063005
source = "registry+https://github.com/rust-lang/crates.io-index"
3007-
checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca"
3006+
checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
30083007
dependencies = [
30093008
"cc",
30103009
"libc",
@@ -4575,6 +4574,7 @@ dependencies = [
45754574
"elsa",
45764575
"ena",
45774576
"indexmap",
4577+
"itertools",
45784578
"jobserver",
45794579
"libc",
45804580
"measureme",
@@ -5723,9 +5723,9 @@ dependencies = [
57235723

57245724
[[package]]
57255725
name = "serde"
5726-
version = "1.0.147"
5726+
version = "1.0.159"
57275727
source = "registry+https://github.com/rust-lang/crates.io-index"
5728-
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
5728+
checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065"
57295729
dependencies = [
57305730
"serde_derive",
57315731
]
@@ -5742,13 +5742,13 @@ dependencies = [
57425742

57435743
[[package]]
57445744
name = "serde_derive"
5745-
version = "1.0.147"
5745+
version = "1.0.159"
57465746
source = "registry+https://github.com/rust-lang/crates.io-index"
5747-
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
5747+
checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585"
57485748
dependencies = [
57495749
"proc-macro2",
57505750
"quote",
5751-
"syn 1.0.102",
5751+
"syn 2.0.8",
57525752
]
57535753

57545754
[[package]]

compiler/rustc_ast/src/ast.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ pub enum GenericArgs {
167167
AngleBracketed(AngleBracketedArgs),
168168
/// The `(A, B)` and `C` in `Foo(A, B) -> C`.
169169
Parenthesized(ParenthesizedArgs),
170-
/// Associated return type bounds, like `T: Trait<method(..): Send>`
171-
/// which applies the `Send` bound to the return-type of `method`.
172-
ReturnTypeNotation(Span),
173170
}
174171

175172
impl GenericArgs {
@@ -181,7 +178,6 @@ impl GenericArgs {
181178
match self {
182179
AngleBracketed(data) => data.span,
183180
Parenthesized(data) => data.span,
184-
ReturnTypeNotation(span) => *span,
185181
}
186182
}
187183
}

compiler/rustc_ast/src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl FormatArguments {
9494
}
9595
if !matches!(arg.kind, FormatArgumentKind::Captured(..)) {
9696
// This is an explicit argument.
97-
// Make sure that all arguments so far are explcit.
97+
// Make sure that all arguments so far are explicit.
9898
assert_eq!(
9999
self.num_explicit_args,
100100
self.arguments.len(),

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ pub fn noop_visit_generic_args<T: MutVisitor>(generic_args: &mut GenericArgs, vi
561561
match generic_args {
562562
GenericArgs::AngleBracketed(data) => vis.visit_angle_bracketed_parameter_data(data),
563563
GenericArgs::Parenthesized(data) => vis.visit_parenthesized_parameter_data(data),
564-
GenericArgs::ReturnTypeNotation(_span) => {}
565564
}
566565
}
567566

compiler/rustc_ast/src/visit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ where
482482
walk_list!(visitor, visit_ty, &data.inputs);
483483
walk_fn_ret_ty(visitor, &data.output);
484484
}
485-
GenericArgs::ReturnTypeNotation(_span) => {}
486485
}
487486
}
488487

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub struct AsyncNonMoveClosureNotSupported {
137137

138138
#[derive(Diagnostic, Clone, Copy)]
139139
#[diag(ast_lowering_functional_record_update_destructuring_assignment)]
140-
pub struct FunctionalRecordUpdateDestructuringAssignemnt {
140+
pub struct FunctionalRecordUpdateDestructuringAssignment {
141141
#[primary_span]
142142
#[suggestion(code = "", applicability = "machine-applicable")]
143143
pub span: Span,
@@ -353,13 +353,7 @@ pub enum BadReturnTypeNotation {
353353
#[diag(ast_lowering_bad_return_type_notation_inputs)]
354354
Inputs {
355355
#[primary_span]
356-
#[suggestion(code = "(..)", applicability = "maybe-incorrect")]
357-
span: Span,
358-
},
359-
#[diag(ast_lowering_bad_return_type_notation_needs_dots)]
360-
NeedsDots {
361-
#[primary_span]
362-
#[suggestion(code = "(..)", applicability = "maybe-incorrect")]
356+
#[suggestion(code = "()", applicability = "maybe-incorrect")]
363357
span: Span,
364358
},
365359
#[diag(ast_lowering_bad_return_type_notation_output)]

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::errors::{
22
AsyncGeneratorsNotSupported, AsyncNonMoveClosureNotSupported, AwaitOnlyInAsyncFnAndBlocks,
3-
BaseExpressionDoubleDot, ClosureCannotBeStatic, FunctionalRecordUpdateDestructuringAssignemnt,
3+
BaseExpressionDoubleDot, ClosureCannotBeStatic, FunctionalRecordUpdateDestructuringAssignment,
44
GeneratorTooManyParameters, InclusiveRangeWithNoEnd, NotSupportedForLifetimeBinderAsyncClosure,
55
UnderscoreExprLhsAssign,
66
};
@@ -434,7 +434,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
434434
// `if let pat = val` or `if foo && let pat = val`, as we _do_ want `val` to live beyond the
435435
// condition in this case.
436436
//
437-
// In order to mantain the drop behavior for the non `let` parts of the condition,
437+
// In order to maintain the drop behavior for the non `let` parts of the condition,
438438
// we still wrap them in terminating scopes, e.g. `if foo && let pat = val` essentially
439439
// gets transformed into `if { let _t = foo; _t } && let pat = val`
440440
match &cond.kind {
@@ -1232,7 +1232,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12321232
);
12331233
let fields_omitted = match &se.rest {
12341234
StructRest::Base(e) => {
1235-
self.tcx.sess.emit_err(FunctionalRecordUpdateDestructuringAssignemnt {
1235+
self.tcx.sess.emit_err(FunctionalRecordUpdateDestructuringAssignment {
12361236
span: e.span,
12371237
});
12381238
true

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -987,15 +987,22 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
987987
GenericArgs::AngleBracketed(data) => {
988988
self.lower_angle_bracketed_parameter_data(data, ParamMode::Explicit, itctx).0
989989
}
990-
&GenericArgs::ReturnTypeNotation(span) => GenericArgsCtor {
991-
args: Default::default(),
992-
bindings: &[],
993-
parenthesized: hir::GenericArgsParentheses::ReturnTypeNotation,
994-
span,
995-
},
996990
GenericArgs::Parenthesized(data) => {
997-
if let Some(start_char) = constraint.ident.as_str().chars().next()
998-
&& start_char.is_ascii_lowercase()
991+
if data.inputs.is_empty() && matches!(data.output, FnRetTy::Default(..)) {
992+
let parenthesized = if self.tcx.features().return_type_notation {
993+
hir::GenericArgsParentheses::ReturnTypeNotation
994+
} else {
995+
self.emit_bad_parenthesized_trait_in_assoc_ty(data);
996+
hir::GenericArgsParentheses::No
997+
};
998+
GenericArgsCtor {
999+
args: Default::default(),
1000+
bindings: &[],
1001+
parenthesized,
1002+
span: data.inputs_span,
1003+
}
1004+
} else if let Some(first_char) = constraint.ident.as_str().chars().next()
1005+
&& first_char.is_ascii_lowercase()
9991006
{
10001007
let mut err = if !data.inputs.is_empty() {
10011008
self.tcx.sess.create_err(errors::BadReturnTypeNotation::Inputs {
@@ -1006,9 +1013,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
10061013
span: data.inputs_span.shrink_to_hi().to(ty.span),
10071014
})
10081015
} else {
1009-
self.tcx.sess.create_err(errors::BadReturnTypeNotation::NeedsDots {
1010-
span: data.inputs_span,
1011-
})
1016+
unreachable!("inputs are empty and return type is not provided")
10121017
};
10131018
if !self.tcx.features().return_type_notation
10141019
&& self.tcx.sess.is_nightly_build()

compiler/rustc_ast_lowering/src/path.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use rustc_span::symbol::{kw, sym, Ident};
1313
use rustc_span::{BytePos, Span, DUMMY_SP};
1414

1515
use smallvec::{smallvec, SmallVec};
16-
use thin_vec::ThinVec;
1716

1817
impl<'a, 'hir> LoweringContext<'a, 'hir> {
1918
#[instrument(level = "trace", skip(self))]
@@ -219,18 +218,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
219218
)
220219
}
221220
},
222-
&GenericArgs::ReturnTypeNotation(span) => {
223-
self.tcx.sess.emit_err(GenericTypeWithParentheses { span, sub: None });
224-
(
225-
self.lower_angle_bracketed_parameter_data(
226-
&AngleBracketedArgs { span, args: ThinVec::default() },
227-
param_mode,
228-
itctx,
229-
)
230-
.0,
231-
false,
232-
)
233-
}
234221
}
235222
} else {
236223
(

compiler/rustc_ast_passes/messages.ftl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ ast_passes_keyword_lifetime =
1717
ast_passes_invalid_label =
1818
invalid label name `{$name}`
1919
20-
ast_passes_invalid_visibility =
21-
unnecessary visibility qualifier
22-
.implied = `pub` not permitted here because it's implied
20+
ast_passes_visibility_not_permitted =
21+
visibility qualifiers are not permitted here
22+
.enum_variant = enum variants and their fields always share the visibility of the enum they are in
23+
.trait_impl = trait items always share the visibility of their trait
2324
.individual_impl_items = place qualifiers on individual impl items instead
2425
.individual_foreign_items = place qualifiers on individual foreign items instead
2526

0 commit comments

Comments
 (0)