Use dyn with all trait objects

Fixes new warnings showing up on nightly nowadays.
This commit is contained in:
Alex Crichton
2019-06-03 08:26:14 -07:00
parent f3adee7056
commit 82467f9793
15 changed files with 144 additions and 144 deletions

View File

@ -52,7 +52,7 @@ impl Diagnostic {
}
}
pub fn spanned_error<T: Into<String>>(node: &ToTokens, text: T) -> Diagnostic {
pub fn spanned_error<T: Into<String>>(node: &dyn ToTokens, text: T) -> Diagnostic {
Diagnostic {
inner: Repr::Single {
text: text.into(),
@ -89,7 +89,7 @@ impl From<Error> for Diagnostic {
}
}
fn extract_spans(node: &ToTokens) -> Option<(Span, Span)> {
fn extract_spans(node: &dyn ToTokens) -> Option<(Span, Span)> {
let mut t = TokenStream::new();
node.to_tokens(&mut t);
let mut tokens = t.into_iter();