mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.
This commit is contained in:
parent
65d4b12bf2
commit
5f15eb5fbf
140 changed files with 1420 additions and 1222 deletions
|
@ -41,8 +41,9 @@ impl LintPass for InheritancePass {
|
|||
.map(|(_, f)| f.span);
|
||||
// Find all #[dom_struct] fields
|
||||
let dom_spans: Vec<_> = def.fields.iter().enumerate().filter_map(|(ctr, f)| {
|
||||
if let ast::TyPath(_, ty_id) = f.node.ty.node {
|
||||
if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().get(&ty_id).cloned() {
|
||||
if let ast::TyPath(..) = f.node.ty.node {
|
||||
if let Some(&def::PathResolution { base_def: def::DefTy(def_id, _), .. }) =
|
||||
cx.tcx.def_map.borrow().get(&f.node.ty.id) {
|
||||
if ty::has_attr(cx.tcx, def_id, "_dom_struct_marker") {
|
||||
// If the field is not the first, it's probably
|
||||
// being misused (a)
|
||||
|
|
|
@ -26,7 +26,7 @@ impl LintPass for TransmutePass {
|
|||
match ex.node {
|
||||
ast::ExprCall(ref expr, ref args) => {
|
||||
match expr.node {
|
||||
ast::ExprPath(ref path) => {
|
||||
ast::ExprPath(_, ref path) => {
|
||||
if path.segments.last()
|
||||
.map_or(false, |ref segment| segment.identifier.name.as_str() == "transmute")
|
||||
&& args.len() == 1 {
|
||||
|
|
|
@ -33,9 +33,9 @@ fn lint_unrooted_ty(cx: &Context, ty: &ast::Ty, warning: &str) {
|
|||
match ty.node {
|
||||
ast::TyVec(ref t) | ast::TyFixedLengthVec(ref t, _) |
|
||||
ast::TyPtr(ast::MutTy { ty: ref t, ..}) | ast::TyRptr(_, ast::MutTy { ty: ref t, ..}) => lint_unrooted_ty(cx, &**t, warning),
|
||||
ast::TyPath(_, id) => {
|
||||
match cx.tcx.def_map.borrow()[id].clone() {
|
||||
def::DefTy(def_id, _) => {
|
||||
ast::TyPath(..) => {
|
||||
match cx.tcx.def_map.borrow()[ty.id] {
|
||||
def::PathResolution{ base_def: def::DefTy(def_id, _), .. } => {
|
||||
if ty::has_attr(cx.tcx, def_id, "must_root") {
|
||||
cx.span_lint(UNROOTED_MUST_ROOT, ty.span, warning);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue