Update to rustc 2d0cbf3e3e25e092bd9e4c94d08e446b680869f0.

This commit is contained in:
Ms2ger 2015-06-25 09:45:09 +02:00
parent 57cc84b293
commit 73a7e92bfd
22 changed files with 232 additions and 132 deletions

View file

@ -6,7 +6,6 @@ use syntax::ast;
use syntax::attr::AttrMetaMethods;
use rustc::lint::{Context, LintPass, LintArray};
use rustc::middle::ty::expr_ty;
use rustc::util::ppaux::Repr;
declare_lint!(TRANSMUTE_TYPE_LINT, Allow,
"Warn and report types being transmuted");
@ -32,9 +31,9 @@ impl LintPass for TransmutePass {
&& args.len() == 1 {
let tcx = cx.tcx;
cx.span_lint(TRANSMUTE_TYPE_LINT, ex.span,
&format!("Transmute to {} from {} detected",
expr_ty(tcx, ex).repr(tcx),
expr_ty(tcx, &**args.get(0).unwrap()).repr(tcx)
&format!("Transmute to {:?} from {:?} detected",
expr_ty(tcx, ex),
expr_ty(tcx, &**args.get(0).unwrap())
));
}
}

View file

@ -8,7 +8,6 @@ use rustc::ast_map;
use rustc::lint::{Context, LintPass, LintArray};
use rustc::middle::ty::expr_ty;
use rustc::middle::{ty, def};
use rustc::util::ppaux::Repr;
use utils::unsafe_context;
declare_lint!(UNROOTED_MUST_ROOT, Deny,
@ -163,7 +162,7 @@ impl LintPass for UnrootedPass {
ty::TyEnum(did, _) => {
if ty::has_attr(cx.tcx, did, "must_root") {
cx.span_lint(UNROOTED_MUST_ROOT, expr.span,
&format!("Expression of type {} must be rooted", t.repr(cx.tcx)));
&format!("Expression of type {:?} must be rooted", t));
}
}
_ => {}