Skip to content

Commit f19087d

Browse files
committed
drift leftward
1 parent 689c210 commit f19087d

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/librustc_lint/builtin.rs

+12-14
Original file line numberDiff line numberDiff line change
@@ -1912,23 +1912,21 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
19121912

19131913
if let hir::ExprKind::Call(ref path_expr, ref args) = expr.node {
19141914
if let hir::ExprKind::Path(ref qpath) = path_expr.node {
1915-
if let Some(def_id) = cx.tables.qpath_res(qpath, path_expr.hir_id)
1916-
.opt_def_id()
1917-
{
1918-
if cx.match_def_path(def_id, &ZEROED_PATH) {
1915+
let def_id = cx.tables.qpath_res(qpath, path_expr.hir_id).opt_def_id()?;
1916+
1917+
if cx.match_def_path(def_id, &ZEROED_PATH) {
1918+
return Some(InitKind::Zeroed);
1919+
}
1920+
if cx.match_def_path(def_id, &UININIT_PATH) {
1921+
return Some(InitKind::Uninit);
1922+
}
1923+
if cx.match_def_path(def_id, &TRANSMUTE_PATH) {
1924+
if is_zero(&args[0]) {
19191925
return Some(InitKind::Zeroed);
19201926
}
1921-
if cx.match_def_path(def_id, &UININIT_PATH) {
1922-
return Some(InitKind::Uninit);
1923-
}
1924-
if cx.match_def_path(def_id, &TRANSMUTE_PATH) {
1925-
if is_zero(&args[0]) {
1926-
return Some(InitKind::Zeroed);
1927-
}
1928-
}
1929-
// FIXME: Also detect `MaybeUninit::zeroed().assume_init()` and
1930-
// `MaybeUninit::uninit().assume_init()`.
19311927
}
1928+
// FIXME: Also detect `MaybeUninit::zeroed().assume_init()` and
1929+
// `MaybeUninit::uninit().assume_init()`.
19321930
}
19331931
}
19341932

0 commit comments

Comments
 (0)