about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-24 20:10:16 +0100
committerGitHub <noreply@github.com>2020-02-24 20:10:16 +0100
commiteda4489121d13d7483161eb47a1aaabd08f356dc (patch)
tree289c0df9f7ea53427ffd838c273103ce4c5f8612
parentcfed378da225b3cced2b1b1d190e4bf77096ff54 (diff)
parentaddd7426bef5342fb7a46756dcf2cb03eb39c739 (diff)
downloadrust-eda4489121d13d7483161eb47a1aaabd08f356dc.tar.gz
rust-eda4489121d13d7483161eb47a1aaabd08f356dc.zip
Rollup merge of #69433 - matthiaskrgr:bool_cmp, r=eddyb
don't explicitly compare against true or false
-rw-r--r--src/librustc/mir/interpret/allocation.rs2
-rw-r--r--src/librustc_mir/dataflow/generic/engine.rs2
-rw-r--r--src/librustc_mir/dataflow/mod.rs2
-rw-r--r--src/librustc_parse/parser/item.rs4
-rw-r--r--src/librustc_resolve/late/diagnostics.rs2
-rw-r--r--src/librustc_typeck/check/op.rs4
-rw-r--r--src/librustdoc/html/markdown.rs4
-rw-r--r--src/librustdoc/html/render.rs2
-rw-r--r--src/librustdoc/passes/mod.rs4
-rw-r--r--src/librustdoc/theme.rs4
10 files changed, 15 insertions, 15 deletions
diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs
index a06b23367e6..052603f6e5e 100644
--- a/src/librustc/mir/interpret/allocation.rs
+++ b/src/librustc/mir/interpret/allocation.rs
@@ -598,7 +598,7 @@ impl AllocationDefinedness {
     pub fn all_bytes_undef(&self) -> bool {
         // The `ranges` are run-length encoded and of alternating definedness.
         // So if `ranges.len() > 1` then the second block is a range of defined.
-        self.initial == false && self.ranges.len() == 1
+        !self.initial && self.ranges.len() == 1
     }
 }
 
diff --git a/src/librustc_mir/dataflow/generic/engine.rs b/src/librustc_mir/dataflow/generic/engine.rs
index b81f0adc201..0eb567da103 100644
--- a/src/librustc_mir/dataflow/generic/engine.rs
+++ b/src/librustc_mir/dataflow/generic/engine.rs
@@ -104,7 +104,7 @@ where
     ) -> Self {
         let bits_per_block = analysis.bits_per_block(body);
 
-        let bottom_value_set = if A::BOTTOM_VALUE == true {
+        let bottom_value_set = if A::BOTTOM_VALUE {
             BitSet::new_filled(bits_per_block)
         } else {
             BitSet::new_empty(bits_per_block)
diff --git a/src/librustc_mir/dataflow/mod.rs b/src/librustc_mir/dataflow/mod.rs
index 41bac894e48..eccdac2fb99 100644
--- a/src/librustc_mir/dataflow/mod.rs
+++ b/src/librustc_mir/dataflow/mod.rs
@@ -821,7 +821,7 @@ where
         let bits_per_block = denotation.bits_per_block();
         let num_blocks = body.basic_blocks().len();
 
-        let on_entry = if D::BOTTOM_VALUE == true {
+        let on_entry = if D::BOTTOM_VALUE {
             vec![BitSet::new_filled(bits_per_block); num_blocks]
         } else {
             vec![BitSet::new_empty(bits_per_block); num_blocks]
diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs
index d6da6270541..5b2e5a9e454 100644
--- a/src/librustc_parse/parser/item.rs
+++ b/src/librustc_parse/parser/item.rs
@@ -1171,13 +1171,13 @@ impl<'a> Parser<'a> {
                 let comma_after_doc_seen = self.eat(&token::Comma);
                 // `seen_comma` is always false, because we are inside doc block
                 // condition is here to make code more readable
-                if seen_comma == false && comma_after_doc_seen == true {
+                if !seen_comma && comma_after_doc_seen {
                     seen_comma = true;
                 }
                 if comma_after_doc_seen || self.token == token::CloseDelim(token::Brace) {
                     err.emit();
                 } else {
-                    if seen_comma == false {
+                    if !seen_comma {
                         let sp = self.sess.source_map().next_point(previous_span);
                         err.span_suggestion(
                             sp,
diff --git a/src/librustc_resolve/late/diagnostics.rs b/src/librustc_resolve/late/diagnostics.rs
index 6a6fba8270b..fa1dc3f450a 100644
--- a/src/librustc_resolve/late/diagnostics.rs
+++ b/src/librustc_resolve/late/diagnostics.rs
@@ -444,7 +444,7 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> {
                 PathSource::Expr(Some(parent)) => {
                     suggested = path_sep(err, &parent);
                 }
-                PathSource::Expr(None) if followed_by_brace == true => {
+                PathSource::Expr(None) if followed_by_brace => {
                     if let Some((sp, snippet)) = closing_brace {
                         err.span_suggestion(
                             sp,
diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs
index bb31e979b73..cb6e028ab86 100644
--- a/src/librustc_typeck/check/op.rs
+++ b/src/librustc_typeck/check/op.rs
@@ -495,7 +495,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 Some(hir_id) => hir_id,
                 None => return false,
             };
-            if self.tcx.has_typeck_tables(def_id) == false {
+            if !self.tcx.has_typeck_tables(def_id) {
                 return false;
             }
             let fn_sig = {
@@ -512,7 +512,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     Some(hir_id) => hir_id,
                     None => return false,
                 };
-                if self.tcx.has_typeck_tables(def_id) == false {
+                if !self.tcx.has_typeck_tables(def_id) {
                     return false;
                 }
                 match self.tcx.typeck_tables_of(def_id).liberated_fn_sigs().get(hir_id) {
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index 07c092a511c..56f7b07cfc8 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -465,7 +465,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for SummaryLine<'a, I> {
                 }
                 _ => true,
             };
-            return if is_allowed_tag == false {
+            return if !is_allowed_tag {
                 if is_start {
                     Some(Event::Start(Tag::Paragraph))
                 } else {
@@ -671,7 +671,7 @@ impl LangString {
                 "" => {}
                 "should_panic" => {
                     data.should_panic = true;
-                    seen_rust_tags = seen_other_tags == false;
+                    seen_rust_tags = !seen_other_tags;
                 }
                 "no_run" => {
                     data.no_run = true;
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 6a23b230e12..bda220d8806 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -4049,7 +4049,7 @@ fn get_next_url(used_links: &mut FxHashSet<String>, url: String) -> String {
         return url;
     }
     let mut add = 1;
-    while used_links.insert(format!("{}-{}", url, add)) == false {
+    while !used_links.insert(format!("{}-{}", url, add)) {
         add += 1;
     }
     format!("{}-{}", url, add)
diff --git a/src/librustdoc/passes/mod.rs b/src/librustdoc/passes/mod.rs
index 9e48904a47d..71cff637c12 100644
--- a/src/librustdoc/passes/mod.rs
+++ b/src/librustdoc/passes/mod.rs
@@ -340,12 +340,12 @@ pub fn look_for_tests<'tcx>(
 
     find_testable_code(&dox, &mut tests, ErrorCodes::No, false);
 
-    if check_missing_code == true && tests.found_tests == 0 {
+    if check_missing_code && tests.found_tests == 0 {
         let sp = span_of_attrs(&item.attrs).unwrap_or(item.source.span());
         cx.tcx.struct_span_lint_hir(lint::builtin::MISSING_DOC_CODE_EXAMPLES, hir_id, sp, |lint| {
             lint.build("missing code example in this documentation").emit()
         });
-    } else if check_missing_code == false
+    } else if !check_missing_code
         && tests.found_tests > 0
         && !cx.renderinfo.borrow().access_levels.is_public(item.def_id)
     {
diff --git a/src/librustdoc/theme.rs b/src/librustdoc/theme.rs
index eb8eabe1c03..620f9f56a6a 100644
--- a/src/librustdoc/theme.rs
+++ b/src/librustdoc/theme.rs
@@ -253,9 +253,9 @@ pub fn get_differences(against: &CssPath, other: &CssPath, v: &mut Vec<String>)
                     break;
                 }
             }
-            if found == false {
+            if !found {
                 v.push(format!("  Missing \"{}\" rule", child.name));
-            } else if found_working == false {
+            } else if !found_working {
                 v.extend(tmp.iter().cloned());
             }
         }