Skip to content

Commit a01e81f

Browse files
bors-ferrocene[bot]BenWiederhakeSabrinaJewsonJ-ZhengLikoka831
authored
Merge #84
84: Automated pull from upstream `master` r=Dajamante a=github-actions[bot] This PR pulls the following changes from the upstream repository: * rust-lang/rust#117585 * rust-lang/rust#117576 * rust-lang/rust#96979 * rust-lang/rust#117191 * rust-lang/rust#117179 * rust-lang/rust#117574 * rust-lang/rust#117537 * rust-lang/rust#117608 * rust-lang/rust#117596 * rust-lang/rust#117588 * rust-lang/rust#117524 * rust-lang/rust#116017 * rust-lang/rust#117504 * rust-lang/rust#117469 * rust-lang/rust#116218 * rust-lang/rust#117589 * rust-lang/rust#117581 * rust-lang/rust#117503 * rust-lang/rust#117590 * rust-lang/rust#117583 * rust-lang/rust#117570 * rust-lang/rust#117562 * rust-lang/rust#117534 * rust-lang/rust#116894 * rust-lang/rust#110340 * rust-lang/rust#113343 * rust-lang/rust#117579 * rust-lang/rust#117094 * rust-lang/rust#117566 * rust-lang/rust#117564 * rust-lang/rust#117554 * rust-lang/rust#117550 * rust-lang/rust#117343 * rust-lang/rust#115274 * rust-lang/rust#117540 * rust-lang/rust#116412 * rust-lang/rust#115333 * rust-lang/rust#117507 * rust-lang/rust#117538 * rust-lang/rust#117533 * rust-lang/rust#117523 * rust-lang/rust#117520 * rust-lang/rust#117505 * rust-lang/rust#117434 * rust-lang/rust#117535 * rust-lang/rust#117510 * rust-lang/rust#116439 * rust-lang/rust#117508 Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de> Co-authored-by: SabrinaJewson <sejewson@gmail.com> Co-authored-by: J-ZhengLi <lizheng135@huawei.com> Co-authored-by: koka <koka.code@gmail.com> Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> Co-authored-by: Joshua Liebow-Feeser <joshlf@users.noreply.github.com> Co-authored-by: lengyijun <sjtu5140809011@gmail.com> Co-authored-by: Zalathar <Zalathar@users.noreply.github.com> Co-authored-by: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> Co-authored-by: Philipp Krones <hello@philkrones.com> Co-authored-by: y21 <30553356+y21@users.noreply.github.com> Co-authored-by: bors <bors@rust-lang.org> Co-authored-by: bohan <bohan-zhang@foxmail.com>
2 parents 6f5b979 + f83c435 commit a01e81f

File tree

895 files changed

+8357
-7312
lines changed

Some content is hidden

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

895 files changed

+8357
-7312
lines changed

Cargo.lock

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,7 @@ name = "clippy"
977977
version = "0.1.75"
978978
dependencies = [
979979
"anstream",
980+
"clippy_config",
980981
"clippy_lints",
981982
"clippy_utils",
982983
"color-print",
@@ -999,6 +1000,16 @@ dependencies = [
9991000
"walkdir",
10001001
]
10011002

1003+
[[package]]
1004+
name = "clippy_config"
1005+
version = "0.1.75"
1006+
dependencies = [
1007+
"rustc-semver",
1008+
"serde",
1009+
"toml 0.7.5",
1010+
"walkdir",
1011+
]
1012+
10021013
[[package]]
10031014
name = "clippy_dev"
10041015
version = "0.0.1"
@@ -1018,6 +1029,7 @@ version = "0.1.75"
10181029
dependencies = [
10191030
"arrayvec",
10201031
"cargo_metadata 0.15.4",
1032+
"clippy_config",
10211033
"clippy_utils",
10221034
"declare_clippy_lint",
10231035
"if_chain",
@@ -1042,10 +1054,10 @@ name = "clippy_utils"
10421054
version = "0.1.75"
10431055
dependencies = [
10441056
"arrayvec",
1057+
"clippy_config",
10451058
"if_chain",
10461059
"itertools",
10471060
"rustc-semver",
1048-
"serde",
10491061
]
10501062

10511063
[[package]]
@@ -1131,9 +1143,9 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
11311143

11321144
[[package]]
11331145
name = "compiler_builtins"
1134-
version = "0.1.101"
1146+
version = "0.1.103"
11351147
source = "registry+https://github.com/rust-lang/crates.io-index"
1136-
checksum = "01a6d58e9c3408138099a396a98fd0d0e6cfb25d723594d2ae48b5004513fd5b"
1148+
checksum = "a3b73c3443a5fd2438d7ba4853c64e4c8efc2404a9e28a9234cc2d5eebc6c242"
11371149
dependencies = [
11381150
"cc",
11391151
"rustc-std-workspace-core",
@@ -4537,7 +4549,6 @@ dependencies = [
45374549
"rustc_monomorphize",
45384550
"rustc_parse",
45394551
"rustc_passes",
4540-
"rustc_plugin_impl",
45414552
"rustc_privacy",
45424553
"rustc_query_system",
45434554
"rustc_resolve",
@@ -4826,7 +4837,6 @@ dependencies = [
48264837
"rustc_monomorphize",
48274838
"rustc_parse",
48284839
"rustc_passes",
4829-
"rustc_plugin_impl",
48304840
"rustc_privacy",
48314841
"rustc_query_impl",
48324842
"rustc_query_system",
@@ -5136,21 +5146,6 @@ dependencies = [
51365146
"tracing",
51375147
]
51385148

5139-
[[package]]
5140-
name = "rustc_plugin_impl"
5141-
version = "0.0.0"
5142-
dependencies = [
5143-
"libloading 0.7.4",
5144-
"rustc_ast",
5145-
"rustc_errors",
5146-
"rustc_fluent_macro",
5147-
"rustc_lint",
5148-
"rustc_macros",
5149-
"rustc_metadata",
5150-
"rustc_session",
5151-
"rustc_span",
5152-
]
5153-
51545149
[[package]]
51555150
name = "rustc_privacy"
51565151
version = "0.0.0"
@@ -6856,7 +6851,6 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
68566851
name = "unwind"
68576852
version = "0.0.0"
68586853
dependencies = [
6859-
"cc",
68606854
"cfg-if",
68616855
"compiler_builtins",
68626856
"core",

compiler/rustc_ast/src/ast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,10 @@ pub struct QSelf {
15481548
#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
15491549
pub enum CaptureBy {
15501550
/// `move |x| y + x`.
1551-
Value,
1551+
Value {
1552+
/// The span of the `move` keyword.
1553+
move_kw: Span,
1554+
},
15521555
/// `move` keyword was not specified.
15531556
Ref,
15541557
}

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ pub trait MutVisitor: Sized {
302302
fn visit_format_args(&mut self, fmt: &mut FormatArgs) {
303303
noop_visit_format_args(fmt, self)
304304
}
305+
306+
fn visit_capture_by(&mut self, capture_by: &mut CaptureBy) {
307+
noop_visit_capture_by(capture_by, self)
308+
}
305309
}
306310

307311
/// Use a map-style function (`FnOnce(T) -> T`) to overwrite a `&mut T`. Useful
@@ -1397,7 +1401,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
13971401
}
13981402
ExprKind::Closure(box Closure {
13991403
binder,
1400-
capture_clause: _,
1404+
capture_clause,
14011405
constness,
14021406
asyncness,
14031407
movability: _,
@@ -1409,6 +1413,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
14091413
vis.visit_closure_binder(binder);
14101414
visit_constness(constness, vis);
14111415
vis.visit_asyncness(asyncness);
1416+
vis.visit_capture_by(capture_clause);
14121417
vis.visit_fn_decl(fn_decl);
14131418
vis.visit_expr(body);
14141419
vis.visit_span(fn_decl_span);
@@ -1562,6 +1567,15 @@ pub fn noop_visit_vis<T: MutVisitor>(visibility: &mut Visibility, vis: &mut T) {
15621567
vis.visit_span(&mut visibility.span);
15631568
}
15641569

1570+
pub fn noop_visit_capture_by<T: MutVisitor>(capture_by: &mut CaptureBy, vis: &mut T) {
1571+
match capture_by {
1572+
CaptureBy::Ref => {}
1573+
CaptureBy::Value { move_kw } => {
1574+
vis.visit_span(move_kw);
1575+
}
1576+
}
1577+
}
1578+
15651579
/// Some value for the AST node that is valid but possibly meaningless.
15661580
pub trait DummyAstNode {
15671581
fn dummy() -> Self;

compiler/rustc_ast/src/visit.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ pub trait Visitor<'ast>: Sized {
251251
fn visit_inline_asm_sym(&mut self, sym: &'ast InlineAsmSym) {
252252
walk_inline_asm_sym(self, sym)
253253
}
254+
fn visit_capture_by(&mut self, _capture_by: &'ast CaptureBy) {
255+
// Nothing to do
256+
}
254257
}
255258

256259
#[macro_export]
@@ -857,7 +860,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
857860
}
858861
ExprKind::Closure(box Closure {
859862
binder,
860-
capture_clause: _,
863+
capture_clause,
861864
asyncness: _,
862865
constness: _,
863866
movability: _,
@@ -866,6 +869,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
866869
fn_decl_span: _,
867870
fn_arg_span: _,
868871
}) => {
872+
visitor.visit_capture_by(capture_clause);
869873
visitor.visit_fn(FnKind::Closure(binder, fn_decl, body), expression.span, expression.id)
870874
}
871875
ExprKind::Block(block, opt_label) => {

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ use rustc_hir as hir;
1515
use rustc_hir::def::Res;
1616
use rustc_hir::definitions::DefPathData;
1717
use rustc_session::errors::report_lit_error;
18-
use rustc_span::source_map::{respan, DesugaringKind, Span, Spanned};
18+
use rustc_span::source_map::{respan, Spanned};
1919
use rustc_span::symbol::{sym, Ident, Symbol};
2020
use rustc_span::DUMMY_SP;
21+
use rustc_span::{DesugaringKind, Span};
2122
use thin_vec::{thin_vec, ThinVec};
2223

2324
impl<'hir> LoweringContext<'_, 'hir> {

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ use rustc_hir::PredicateOrigin;
1616
use rustc_index::{Idx, IndexSlice, IndexVec};
1717
use rustc_middle::ty::{ResolverAstLowering, TyCtxt};
1818
use rustc_span::edit_distance::find_best_match_for_name;
19-
use rustc_span::source_map::DesugaringKind;
2019
use rustc_span::symbol::{kw, sym, Ident};
21-
use rustc_span::{Span, Symbol};
20+
use rustc_span::{DesugaringKind, Span, Symbol};
2221
use rustc_target::spec::abi;
2322
use smallvec::{smallvec, SmallVec};
2423
use thin_vec::ThinVec;
@@ -1202,7 +1201,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12021201
}
12031202

12041203
let async_expr = this.make_async_expr(
1205-
CaptureBy::Value,
1204+
CaptureBy::Value { move_kw: rustc_span::DUMMY_SP },
12061205
closure_id,
12071206
None,
12081207
body.span,

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ use rustc_middle::{
7171
};
7272
use rustc_session::parse::{add_feature_diagnostics, feature_err};
7373
use rustc_span::hygiene::MacroKind;
74-
use rustc_span::source_map::DesugaringKind;
7574
use rustc_span::symbol::{kw, sym, Ident, Symbol};
76-
use rustc_span::{Span, DUMMY_SP};
75+
use rustc_span::{DesugaringKind, Span, DUMMY_SP};
7776
use smallvec::SmallVec;
7877
use std::collections::hash_map::Entry;
7978
use thin_vec::ThinVec;

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ impl<'a> State<'a> {
673673

674674
fn print_capture_clause(&mut self, capture_clause: ast::CaptureBy) {
675675
match capture_clause {
676-
ast::CaptureBy::Value => self.word_space("move"),
676+
ast::CaptureBy::Value { .. } => self.word_space("move"),
677677
ast::CaptureBy::Ref => {}
678678
}
679679
}

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ use rustc_middle::{
99
hir::place::PlaceBase,
1010
mir::{self, BindingForm, Local, LocalDecl, LocalInfo, LocalKind, Location},
1111
};
12-
use rustc_span::source_map::DesugaringKind;
1312
use rustc_span::symbol::{kw, Symbol};
14-
use rustc_span::{sym, BytePos, Span};
13+
use rustc_span::{sym, BytePos, DesugaringKind, Span};
1514
use rustc_target::abi::FieldIdx;
1615

1716
use crate::diagnostics::BorrowedContentSource;

compiler/rustc_borrowck/src/diagnostics/var_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::Upvar;
66
use rustc_index::IndexSlice;
77
use rustc_middle::mir::{Body, Local};
88
use rustc_middle::ty::{RegionVid, TyCtxt};
9-
use rustc_span::source_map::Span;
109
use rustc_span::symbol::Symbol;
10+
use rustc_span::Span;
1111

1212
impl<'tcx> RegionInferenceContext<'tcx> {
1313
pub(crate) fn get_var_name_and_span_for_region(

0 commit comments

Comments
 (0)