Auto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #69477 (docs: add mention of async blocks in move keyword docs)
 - #69504 (Use assert_ne in hash tests)
 - #69546 (use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.)
 - #69551 (use is_empty() instead of len() == x  to determine if structs are empty.)
 - #69563 (Fix no_std detection for target triples)
 - #69567 (use .to_string() instead of format!() macro to create strings)

Failed merges:

r? @ghost
This commit is contained in:
bors 2020-02-29 10:43:32 +00:00
commit 3f9bddc7fe
70 changed files with 152 additions and 141 deletions

View file

@ -141,7 +141,7 @@ impl<'a> TokenTreesReader<'a> {
self.last_delim_empty_block_spans.insert(delim, empty_block_span);
}
if self.open_braces.len() == 0 {
if self.open_braces.is_empty() {
// Clear up these spans to avoid suggesting them as we've found
// properly matched delimiters so far for an entire block.
self.matching_delim_spans.clear();

View file

@ -371,7 +371,7 @@ fn prepend_attrs(
span: rustc_span::Span,
) -> Option<tokenstream::TokenStream> {
let tokens = tokens?;
if attrs.len() == 0 {
if attrs.is_empty() {
return Some(tokens.clone());
}
let mut builder = tokenstream::TokenStreamBuilder::new();

View file

@ -216,7 +216,7 @@ impl<'a> Parser<'a> {
.span_suggestion(
seq_span,
"...or a vertical bar to match on multiple alternatives",
format!("{}", seq_snippet.replace(",", " |")),
seq_snippet.replace(",", " |"),
Applicability::MachineApplicable,
);
}

View file

@ -469,7 +469,7 @@ impl<'a> Parser<'a> {
// FIXME: we would like to report this in ast_validation instead, but we currently do not
// preserve ordering of generic parameters with respect to associated type binding, so we
// lose that information after parsing.
if misplaced_assoc_ty_constraints.len() > 0 {
if !misplaced_assoc_ty_constraints.is_empty() {
let mut err = self.struct_span_err(
args_lo.to(self.prev_span),
"associated type bindings must be declared after generic parameters",