Skip to content

Commit 10706d6

Browse files
committedSep 1, 2022
Auto merge of #101295 - matthiaskrgr:rollup-046o38p, r=matthiaskrgr
Rollup of 14 pull requests Successful merges: - #94467 (Add `special_module_name` lint) - #100852 (Use `getuid` to check instead of `USER` env var in rustbuild) - #101072 (bootstrap: Add llvm-has-rust-patches target option) - #101190 (Make docs formulation more consistent for NonZero{int}) - #101245 (Remove unneeded where whitespace) - #101251 (Fix bad target name in Walkthrough) - #101254 (rustdoc: remove unused `.docblock .impl-items` CSS) - #101256 (Fixes/adjustments to Fuchsia doc walkthrough) - #101270 (Update outdated comment about output capturing in print_to.) - #101271 (Fix filename of armv4t-none-eabi.md) - #101274 (Fix typo in comment) - #101279 (Fix doc_auto_cfg for impl blocks in different modules with different `cfg`) - #101285 (Do not suggest adding `move` to closure when `move` is already used) - #101292 (rustdoc: remove unneeded CSS `.content table td:first-child > a`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2e35f95 + 1c12ded commit 10706d6

Some content is hidden

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

50 files changed

+412
-136
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ no_llvm_build
4646
/dist/
4747
/unicode-downloads
4848
/target
49+
/src/bootstrap/target
4950
/src/tools/x/target
5051
# Created by default with `src/ci/docker/run.sh`
5152
/obj/

‎compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,11 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
902902
hir::ExprKind::MethodCall(.., args, _) => {
903903
// only the first closre parameter of the method. args[0] is MethodCall PathSegment
904904
for i in 1..args.len() {
905-
if let hir::ExprKind::Closure(..) = args[i].kind {
905+
if let hir::ExprKind::Closure(hir::Closure {
906+
capture_clause: hir::CaptureBy::Ref,
907+
..
908+
}) = args[i].kind
909+
{
906910
closure_span = Some(args[i].span.shrink_to_lo());
907911
break;
908912
}
@@ -911,7 +915,11 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
911915
hir::ExprKind::Block(blk, _) => {
912916
if let Some(ref expr) = blk.expr {
913917
// only when the block is a closure
914-
if let hir::ExprKind::Closure(..) = expr.kind {
918+
if let hir::ExprKind::Closure(hir::Closure {
919+
capture_clause: hir::CaptureBy::Ref,
920+
..
921+
}) = expr.kind
922+
{
915923
closure_span = Some(expr.span.shrink_to_lo());
916924
}
917925
}
@@ -921,7 +929,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
921929
if let Some(closure_span) = closure_span {
922930
diag.span_suggestion_verbose(
923931
closure_span,
924-
format!("consider adding 'move' keyword before the nested closure"),
932+
"consider adding 'move' keyword before the nested closure",
925933
"move ",
926934
Applicability::MaybeIncorrect,
927935
);

0 commit comments

Comments
 (0)
Please sign in to comment.