mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
add note about update-all-refs script, revert redundant pat to master
This commit is contained in:
parent
51c2325dd7
commit
fca3537fa3
@ -64,14 +64,10 @@ impl LateLintPass<'_, '_> for IfLetMutex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn matching_arm(arm: &Arm<'_>, op: &Expr<'_>, ex: &Expr<'_>, cx: &LateContext<'_, '_>) -> bool {
|
fn matching_arm(arm: &Arm<'_>, op: &Expr<'_>, ex: &Expr<'_>, cx: &LateContext<'_, '_>) -> bool {
|
||||||
if_chain! {
|
if let ExprKind::Block(ref block, _l) = arm.body.kind {
|
||||||
if let ExprKind::Block(ref block, _l) = arm.body.kind;
|
block.stmts.iter().any(|stmt| matching_stmt(stmt, op, ex, cx))
|
||||||
if block.stmts.iter().any(|stmt| matching_stmt(stmt, op, ex, cx));
|
} else {
|
||||||
then {
|
false
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,9 @@ Once we are satisfied with the output, we need to run
|
|||||||
Please note that, we should run `TESTNAME=foo_functions cargo uitest`
|
Please note that, we should run `TESTNAME=foo_functions cargo uitest`
|
||||||
every time before running `tests/ui/update-all-references.sh`.
|
every time before running `tests/ui/update-all-references.sh`.
|
||||||
Running `TESTNAME=foo_functions cargo uitest` should pass then. When we commit
|
Running `TESTNAME=foo_functions cargo uitest` should pass then. When we commit
|
||||||
our lint, we need to commit the generated `.stderr` files, too.
|
our lint, we need to commit the generated `.stderr` files, too. In general you
|
||||||
|
should only run `tests/ui/update-all-references.sh` for the specific lint you are
|
||||||
|
creating/editing.
|
||||||
|
|
||||||
## Rustfix tests
|
## Rustfix tests
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ fn main() {
|
|||||||
|
|
||||||
let _ = does_something();
|
let _ = does_something();
|
||||||
let _ = returns_unit();
|
let _ = returns_unit();
|
||||||
let _ = issue_5271();
|
|
||||||
|
|
||||||
let opt = Some(false);
|
let opt = Some(false);
|
||||||
let x = if let Some(_) = opt { true } else { false };
|
let x = if let Some(_) = opt { true } else { false };
|
||||||
|
Loading…
Reference in New Issue
Block a user