mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 18:12:51 +00:00
Merge #7135
7135: Fix warnings on nightly r=lnicola a=cynecx Co-authored-by: cynecx <me@cynecx.net>
This commit is contained in:
commit
895d97cfa0
@ -94,7 +94,7 @@ pub fn filter_assoc_items(
|
||||
ast::AssocItem::MacroCall(_) => None,
|
||||
}
|
||||
.is_some()
|
||||
};
|
||||
}
|
||||
|
||||
items
|
||||
.iter()
|
||||
|
@ -260,14 +260,13 @@ impl Attrs {
|
||||
}
|
||||
|
||||
pub fn docs(&self) -> Option<Documentation> {
|
||||
let docs = self
|
||||
.by_key("doc")
|
||||
.attrs()
|
||||
.flat_map(|attr| match attr.input.as_ref()? {
|
||||
AttrInput::Literal(s) => Some(s),
|
||||
AttrInput::TokenTree(_) => None,
|
||||
})
|
||||
.intersperse(&SmolStr::new_inline("\n"))
|
||||
let docs = self.by_key("doc").attrs().flat_map(|attr| match attr.input.as_ref()? {
|
||||
AttrInput::Literal(s) => Some(s),
|
||||
AttrInput::TokenTree(_) => None,
|
||||
});
|
||||
// FIXME: Replace `Itertools::intersperse` with `Iterator::intersperse[_with]` until the
|
||||
// libstd api gets stabilized (https://github.com/rust-lang/rust/issues/79524).
|
||||
let docs = Itertools::intersperse(docs, &SmolStr::new_inline("\n"))
|
||||
.map(|it| it.as_str())
|
||||
.collect::<String>();
|
||||
if docs.is_empty() {
|
||||
|
@ -679,7 +679,7 @@ fn schema(fields: &[(&'static str, &'static str, &[&str], &str)]) -> serde_json:
|
||||
for ((f1, ..), (f2, ..)) in fields.iter().zip(&fields[1..]) {
|
||||
fn key(f: &str) -> &str {
|
||||
f.splitn(2, "_").next().unwrap()
|
||||
};
|
||||
}
|
||||
assert!(key(f1) <= key(f2), "wrong field order: {:?} {:?}", f1, f2);
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ impl ast::RecordExprFieldList {
|
||||
InsertPosition::After($anchor.syntax().clone().into())
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
let position = match position {
|
||||
InsertPosition::First => after_l_curly!(),
|
||||
@ -533,7 +533,7 @@ impl ast::GenericParamList {
|
||||
InsertPosition::After($anchor.syntax().clone().into())
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
let position = match self.generic_params().last() {
|
||||
Some(it) => after_field!(it),
|
||||
|
Loading…
Reference in New Issue
Block a user