slighty simplify a few boolean expressions (clippy::nonminimal_bool)
This commit is contained in:
parent
5a07e33d2c
commit
73bd953dea
4 changed files with 4 additions and 5 deletions
|
@ -677,8 +677,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if let Rvalue::CopyForDeref(place) = rvalue {
|
if let Rvalue::CopyForDeref(place) = rvalue {
|
||||||
if !place.ty(&self.body.local_decls, self.tcx).ty.builtin_deref(true).is_some()
|
if place.ty(&self.body.local_decls, self.tcx).ty.builtin_deref(true).is_none() {
|
||||||
{
|
|
||||||
self.fail(
|
self.fail(
|
||||||
location,
|
location,
|
||||||
"`CopyForDeref` should only be used for dereferenceable types",
|
"`CopyForDeref` should only be used for dereferenceable types",
|
||||||
|
|
|
@ -559,7 +559,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
|
||||||
// struct; however, when EUV is run during typeck, it
|
// struct; however, when EUV is run during typeck, it
|
||||||
// may not. This will generate an error earlier in typeck,
|
// may not. This will generate an error earlier in typeck,
|
||||||
// so we can just ignore it.
|
// so we can just ignore it.
|
||||||
if !self.tcx().sess.has_errors().is_some() {
|
if self.tcx().sess.has_errors().is_none() {
|
||||||
span_bug!(with_expr.span, "with expression doesn't evaluate to a struct");
|
span_bug!(with_expr.span, "with expression doesn't evaluate to a struct");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ fn no_main_err(tcx: TyCtxt<'_>, visitor: &EntryContext<'_>) {
|
||||||
// The file may be empty, which leads to the diagnostic machinery not emitting this
|
// The file may be empty, which leads to the diagnostic machinery not emitting this
|
||||||
// note. This is a relatively simple way to detect that case and emit a span-less
|
// note. This is a relatively simple way to detect that case and emit a span-less
|
||||||
// note instead.
|
// note instead.
|
||||||
let file_empty = !tcx.sess.source_map().lookup_line(sp.hi()).is_ok();
|
let file_empty = tcx.sess.source_map().lookup_line(sp.hi()).is_err();
|
||||||
|
|
||||||
tcx.sess.emit_err(NoMainErr {
|
tcx.sess.emit_err(NoMainErr {
|
||||||
sp,
|
sp,
|
||||||
|
|
|
@ -389,7 +389,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert!(force || !finalize.is_some()); // `finalize` implies `force`
|
assert!(force || finalize.is_none()); // `finalize` implies `force`
|
||||||
|
|
||||||
// Make sure `self`, `super` etc produce an error when passed to here.
|
// Make sure `self`, `super` etc produce an error when passed to here.
|
||||||
if orig_ident.is_path_segment_keyword() {
|
if orig_ident.is_path_segment_keyword() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue