mirror of
https://github.com/servo/servo.git
synced 2025-06-12 10:24:43 +00:00
Update to Rust 1.10.0-nightly (2b79e05a0 2016-05-13)
This commit is contained in:
parent
d6509dc4c6
commit
78e3b1a326
6 changed files with 28 additions and 36 deletions
|
@ -106,15 +106,13 @@ impl LateLintPass for UnrootedPass {
|
||||||
let ref map = cx.tcx.map;
|
let ref map = cx.tcx.map;
|
||||||
if map.expect_item(map.get_parent(var.node.data.id())).attrs.iter().all(|a| !a.check_name("must_root")) {
|
if map.expect_item(map.get_parent(var.node.data.id())).attrs.iter().all(|a| !a.check_name("must_root")) {
|
||||||
match var.node.data {
|
match var.node.data {
|
||||||
hir::VariantData::Tuple(ref vec, _) => {
|
hir::VariantData::Tuple(ref fields, _) => {
|
||||||
for ty in vec {
|
for ref field in fields {
|
||||||
cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty.id).map(|t| {
|
if is_unrooted_ty(cx, cx.tcx.node_id_to_type(field.id), false) {
|
||||||
if is_unrooted_ty(cx, t, false) {
|
cx.span_lint(UNROOTED_MUST_ROOT, field.ty.span,
|
||||||
cx.span_lint(UNROOTED_MUST_ROOT, ty.ty.span,
|
"Type must be rooted, use #[must_root] on \
|
||||||
"Type must be rooted, use #[must_root] on \
|
the enum definition to propagate")
|
||||||
the enum definition to propagate")
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => () // Struct variants already caught by check_struct_def
|
_ => () // Struct variants already caught by check_struct_def
|
||||||
|
@ -123,7 +121,7 @@ impl LateLintPass for UnrootedPass {
|
||||||
}
|
}
|
||||||
/// Function arguments that are #[must_root] types are not allowed
|
/// Function arguments that are #[must_root] types are not allowed
|
||||||
fn check_fn(&mut self, cx: &LateContext, kind: visit::FnKind, decl: &hir::FnDecl,
|
fn check_fn(&mut self, cx: &LateContext, kind: visit::FnKind, decl: &hir::FnDecl,
|
||||||
block: &hir::Block, span: codemap::Span, _id: ast::NodeId) {
|
block: &hir::Block, span: codemap::Span, id: ast::NodeId) {
|
||||||
let in_new_function = match kind {
|
let in_new_function = match kind {
|
||||||
visit::FnKind::ItemFn(n, _, _, _, _, _, _) |
|
visit::FnKind::ItemFn(n, _, _, _, _, _, _) |
|
||||||
visit::FnKind::Method(n, _, _, _) => {
|
visit::FnKind::Method(n, _, _, _) => {
|
||||||
|
@ -132,27 +130,21 @@ impl LateLintPass for UnrootedPass {
|
||||||
visit::FnKind::Closure(_) => return,
|
visit::FnKind::Closure(_) => return,
|
||||||
};
|
};
|
||||||
|
|
||||||
for arg in &decl.inputs {
|
if !in_derive_expn(cx, span) {
|
||||||
cx.tcx.ast_ty_to_ty_cache.borrow().get(&arg.ty.id).map(|t| {
|
let ty = cx.tcx.node_id_to_type(id);
|
||||||
if is_unrooted_ty(cx, t, false) {
|
|
||||||
if in_derive_expn(cx, span) {
|
for (arg, ty) in decl.inputs.iter().zip(ty.fn_args().0.iter()) {
|
||||||
return;
|
if is_unrooted_ty(cx, ty, false) {
|
||||||
}
|
|
||||||
cx.span_lint(UNROOTED_MUST_ROOT, arg.ty.span, "Type must be rooted")
|
cx.span_lint(UNROOTED_MUST_ROOT, arg.ty.span, "Type must be rooted")
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if !in_new_function {
|
if !in_new_function {
|
||||||
if let hir::Return(ref ty) = decl.output {
|
if let ty::FnOutput::FnConverging(ret) = ty.fn_ret().0 {
|
||||||
cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty.id).map(|t| {
|
if is_unrooted_ty(cx, ret, false) {
|
||||||
if is_unrooted_ty(cx, t, false) {
|
cx.span_lint(UNROOTED_MUST_ROOT, decl.output.span(), "Type must be rooted")
|
||||||
if in_derive_expn(cx, span) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cx.span_lint(UNROOTED_MUST_ROOT, ty.span, "Type must be rooted")
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
components/servo/Cargo.lock
generated
4
components/servo/Cargo.lock
generated
|
@ -1661,7 +1661,7 @@ dependencies = [
|
||||||
name = "plugins"
|
name = "plugins"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tenacious 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tenacious 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2199,7 +2199,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tenacious"
|
name = "tenacious"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
4
ports/cef/Cargo.lock
generated
4
ports/cef/Cargo.lock
generated
|
@ -1532,7 +1532,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
name = "plugins"
|
name = "plugins"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tenacious 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tenacious 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2068,7 +2068,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tenacious"
|
name = "tenacious"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
4
ports/geckolib/Cargo.lock
generated
4
ports/geckolib/Cargo.lock
generated
|
@ -403,7 +403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
name = "plugins"
|
name = "plugins"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tenacious 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tenacious 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -571,7 +571,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tenacious"
|
name = "tenacious"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
4
ports/gonk/Cargo.lock
generated
4
ports/gonk/Cargo.lock
generated
|
@ -1524,7 +1524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
name = "plugins"
|
name = "plugins"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tenacious 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tenacious 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2058,7 +2058,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tenacious"
|
name = "tenacious"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2016-05-07
|
2016-05-14
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue