Revert "Merge pull request #4144 from luqmana/deprecated-attribute"
This reverts commitf675b97ddc, reversing changes made toe7dd3af970.
This commit is contained in:
@@ -60,7 +60,6 @@ enum lint {
|
|||||||
unrecognized_lint,
|
unrecognized_lint,
|
||||||
non_implicitly_copyable_typarams,
|
non_implicitly_copyable_typarams,
|
||||||
vecs_implicitly_copyable,
|
vecs_implicitly_copyable,
|
||||||
deprecated_item,
|
|
||||||
deprecated_mode,
|
deprecated_mode,
|
||||||
deprecated_pattern,
|
deprecated_pattern,
|
||||||
non_camel_case_types,
|
non_camel_case_types,
|
||||||
@@ -158,11 +157,6 @@ fn get_lint_dict() -> lint_dict {
|
|||||||
desc: ~"implicit copies of non implicitly copyable data",
|
desc: ~"implicit copies of non implicitly copyable data",
|
||||||
default: warn}),
|
default: warn}),
|
||||||
|
|
||||||
(~"deprecated_item",
|
|
||||||
@{lint: deprecated_item,
|
|
||||||
desc: ~"warn about items marked deprecated",
|
|
||||||
default: warn}),
|
|
||||||
|
|
||||||
(~"deprecated_mode",
|
(~"deprecated_mode",
|
||||||
@{lint: deprecated_mode,
|
@{lint: deprecated_mode,
|
||||||
desc: ~"warn about deprecated uses of modes",
|
desc: ~"warn about deprecated uses of modes",
|
||||||
@@ -418,7 +412,6 @@ fn check_item(i: @ast::item, cx: ty::ctxt) {
|
|||||||
check_item_non_camel_case_types(cx, i);
|
check_item_non_camel_case_types(cx, i);
|
||||||
check_item_heap(cx, i);
|
check_item_heap(cx, i);
|
||||||
check_item_structural_records(cx, i);
|
check_item_structural_records(cx, i);
|
||||||
check_item_deprecated(cx, i);
|
|
||||||
check_item_deprecated_modes(cx, i);
|
check_item_deprecated_modes(cx, i);
|
||||||
check_item_type_limits(cx, i);
|
check_item_type_limits(cx, i);
|
||||||
}
|
}
|
||||||
@@ -774,26 +767,6 @@ fn check_item_non_camel_case_types(cx: ty::ctxt, it: @ast::item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_item_deprecated(tcx: ty::ctxt, it: @ast::item) {
|
|
||||||
let at = attr::find_attrs_by_name(it.attrs, ~"deprecated");
|
|
||||||
|
|
||||||
if at.is_not_empty() {
|
|
||||||
for at.each |attr| {
|
|
||||||
let fmt = match attr.node.value.node {
|
|
||||||
ast::meta_name_value(_, ref l) =>
|
|
||||||
match l.node {
|
|
||||||
ast::lit_str(ref reason) =>
|
|
||||||
fmt!("deprecated: %s", **reason),
|
|
||||||
_ => ~"item is deprecated"
|
|
||||||
},
|
|
||||||
_ => ~"item is deprecated"
|
|
||||||
};
|
|
||||||
tcx.sess.span_lint(deprecated_item, it.id, it.id, it.span,
|
|
||||||
fmt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
|
fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
|
||||||
_body: ast::blk, span: span, id: ast::node_id) {
|
_body: ast::blk, span: span, id: ast::node_id) {
|
||||||
debug!("lint check_fn fk=%? id=%?", fk, id);
|
debug!("lint check_fn fk=%? id=%?", fk, id);
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
#[forbid(deprecated_item)];
|
|
||||||
|
|
||||||
type Bar = uint;
|
|
||||||
|
|
||||||
#[deprecated = "use Bar instead"]
|
|
||||||
type Foo = int;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let _x: Foo = 21;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user