Merge pull request #2713 from alexreg/nightly-fix

Fixed build for latest rust master
This commit is contained in:
Oliver Schneider
2018-05-04 15:06:59 +02:00
committed by GitHub
16 changed files with 82 additions and 94 deletions

View File

@@ -9,7 +9,7 @@ use rustc::lint::{LateContext, Level, Lint, LintContext};
use rustc::session::Session;
use rustc::traits;
use rustc::ty::{self, Ty, TyCtxt, layout::{self, IntegerExt}};
use rustc_errors;
use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart};
use std::borrow::Cow;
use std::env;
use std::mem;
@@ -643,12 +643,12 @@ pub fn multispan_sugg<I>(db: &mut DiagnosticBuilder, help_msg: String, sugg: I)
where
I: IntoIterator<Item = (Span, String)>,
{
let sugg = rustc_errors::CodeSuggestion {
let sugg = CodeSuggestion {
substitutions: vec![
rustc_errors::Substitution {
Substitution {
parts: sugg.into_iter()
.map(|(span, snippet)| {
rustc_errors::SubstitutionPart {
SubstitutionPart {
snippet,
span,
}
@@ -658,7 +658,7 @@ where
],
msg: help_msg,
show_code_when_inline: true,
approximate: false,
applicability: Applicability::Unspecified,
};
db.suggestions.push(sugg);
}
@@ -741,7 +741,7 @@ fn parse_attrs<F: FnMut(u64)>(sess: &Session, attrs: &[ast::Attribute], name: &'
continue;
}
if let Some(ref value) = attr.value_str() {
if attr.name().map_or(false, |n| n == name) {
if attr.name() == name {
if let Ok(value) = FromStr::from_str(&value.as_str()) {
attr::mark_used(attr);
f(value)