Upgrade to rustc 1.38.0-nightly (4b65a86eb 2019-07-15)

This commit is contained in:
Simon Sapin 2019-07-06 13:45:21 +02:00
parent b6bd2d7302
commit d3718823ba
5 changed files with 12 additions and 8 deletions

View file

@ -22,6 +22,10 @@
#[macro_use]
extern crate rustc;
// Work around TLS failure: https://github.com/rust-lang/rust/issues/62717#issuecomment-511876555
#[allow(unused)]
extern crate rustc_driver;
extern crate rustc_plugin;
extern crate syntax;

View file

@ -161,7 +161,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
.all(|a| !a.check_name(self.symbols.must_root))
{
for ref field in def.fields() {
let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id);
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) {
cx.span_lint(UNROOTED_MUST_ROOT, field.span,
"Type must be rooted, use #[must_root] on the struct definition to propagate")
@ -182,7 +182,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
match var.node.data {
hir::VariantData::Tuple(ref fields, ..) => {
for ref field in fields {
let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id);
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) {
cx.span_lint(
UNROOTED_MUST_ROOT,
@ -215,7 +215,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
};
if !in_derive_expn(span) {
let def_id = cx.tcx.hir().local_def_id_from_hir_id(id);
let def_id = cx.tcx.hir().local_def_id(id);
let sig = cx.tcx.type_of(def_id).fn_sig(cx.tcx);
for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {

View file

@ -4,7 +4,7 @@
use rustc::hir::def_id::DefId;
use rustc::lint::LateContext;
use syntax::source_map::{ExpnFormat, Span};
use syntax::source_map::{ExpnKind, MacroKind, Span};
use syntax::symbol::Symbol;
/// check if a DefId's path matches the given absolute type path
@ -31,7 +31,7 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool
pub fn in_derive_expn(span: Span) -> bool {
if let Some(i) = span.ctxt().outer().expn_info() {
if let ExpnFormat::MacroAttribute(n) = i.format {
if let ExpnKind::Macro(MacroKind::Attr, n) = i.kind {
n.as_str().contains("derive")
} else {
false

View file

@ -185,7 +185,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for WebIdlPass {
_gen: &'tcx hir::Generics,
id: HirId,
) {
let def_id = cx.tcx.hir().local_def_id_from_hir_id(id);
let def_id = cx.tcx.hir().local_def_id(id);
if !is_webidl_ty(&self.symbols, cx, cx.tcx.type_of(def_id)) {
return;
}
@ -196,7 +196,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for WebIdlPass {
};
let parent_name = def.fields().iter().next().map(|field| {
let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id);
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
let ty = cx.tcx.type_of(def_id).to_string();
get_ty_name(&ty).to_string()
});