Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #87595

Closed
wants to merge 26 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2953a2f
Mir borrowck does not generate lifetime variables for 'static lifetim…
oli-obk Jul 26, 2021
624df18
Track caller of Vec::remove()
kornelski Jul 26, 2021
886dea2
Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by default
Aaron1011 Jul 22, 2021
cf167c9
Only emit lint for local macros
Aaron1011 Jul 24, 2021
b8eb1f1
Fix assert in diy_float
frogtd Jul 27, 2021
6954f9d
Update stderr
Aaron1011 Jul 27, 2021
cd6c0e4
Fix typo in rustc_driver::version
bjorn3 Jul 28, 2021
9829efb
Range PatKind implies discr should be read
roxelo Jul 28, 2021
d380ed1
fix nit
roxelo Jul 28, 2021
cf5e48d
min_type_alias_impl_trait is going to be removed in 1.56
spastorino Jul 28, 2021
2f6662d
Use strip_prefix
bjorn3 Jul 29, 2021
a2f3e4a
Change span for intra-doc links errors
GuillaumeGomez Jul 19, 2021
cbba940
BufWriter: actually export WriterPanicked error
ijackson Jun 1, 2021
66f3807
BufWriter: rename `into_parts` from `into_raw_parts`
ijackson Jun 1, 2021
bf30c51
Rename feature gate bufwriter_into_parts from bufwriter_into_raw_parts
ijackson Jul 19, 2021
e70ce57
Remove unnecessary trailing semicolons from clippy tests
Aaron1011 Jul 29, 2021
0f7f85e
Update rustdoc-ui tests for intra-doc links errors
GuillaumeGomez Jul 19, 2021
a5a44ad
Rollup merge of #85901 - ijackson:bufwriter-tweaks, r=joshtriplett
fee1-dead Jul 29, 2021
c46c25b
Rollup merge of #87285 - GuillaumeGomez:intra-doc-span, r=estebank
fee1-dead Jul 29, 2021
6b0321f
Rollup merge of #87385 - Aaron1011:final-enable-semi, r=petrochenkov
fee1-dead Jul 29, 2021
71d00b7
Rollup merge of #87483 - oli-obk:tait_ice, r=lqd
fee1-dead Jul 29, 2021
9b0310b
Rollup merge of #87488 - kornelski:track-remove, r=dtolnay
fee1-dead Jul 29, 2021
59b3d38
Rollup merge of #87522 - frogtd:patch-1, r=yaahc
fee1-dead Jul 29, 2021
433e5a1
Rollup merge of #87553 - bjorn3:fix_hotplug_codegen_version, r=wesley…
fee1-dead Jul 29, 2021
cee4f91
Rollup merge of #87554 - sexxi-goose:fix-issue-87426, r=nikomatsakis
fee1-dead Jul 29, 2021
afd3066
Rollup merge of #87564 - spastorino:adjust-min-tait-removed-version, …
fee1-dead Jul 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions compiler/rustc_typeck/src/expr_use_visitor.rs
Original file line number Diff line number Diff line change
@@ -267,12 +267,21 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
}
}
}
PatKind::Lit(_) => {
// If the PatKind is a Lit then we want
PatKind::Lit(_) | PatKind::Range(..) => {
// If the PatKind is a Lit or a Range then we want
// to borrow discr.
needs_to_be_read = true;
}
_ => {}
PatKind::Or(_)
| PatKind::Box(_)
| PatKind::Slice(..)
| PatKind::Ref(..)
| PatKind::Wild => {
// If the PatKind is Or, Box, Slice or Ref, the decision is made later
// as these patterns contains subpatterns
// If the PatKind is Wild, the decision is made based on the other patterns being
// examined
}
}
}));
}
14 changes: 14 additions & 0 deletions src/test/ui/closures/2229_closure_analysis/issue-87426.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// run-pass
// edition:2021

pub fn foo() {
let ref_x_ck = 123;
let _y = || match ref_x_ck {
2_000_000..=3_999_999 => { println!("A")}
_ => { println!("B")}
};
}

fn main() {
foo();
}