Skip to content

Commit

Permalink
Revert "librustc: Implement a lint mode for default methods"
Browse files Browse the repository at this point in the history
This reverts commit 53b181d.
  • Loading branch information
pcwalton committed Dec 15, 2012
1 parent 593f414 commit 99fa9c3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
30 changes: 1 addition & 29 deletions src/librustc/middle/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ enum lint {
non_camel_case_types,
structural_records,
type_limits,
default_methods,

managed_heap_memory,
owned_heap_memory,
Expand Down Expand Up @@ -201,12 +200,7 @@ fn get_lint_dict() -> lint_dict {
(~"type_limits",
@{lint: type_limits,
desc: ~"comparisons made useless by limits of the types involved",
default: warn}),

(~"default_methods",
@{lint: default_methods,
desc: ~"allow default methods",
default: forbid}),
default: warn})

/* FIXME(#3266)--make liveness warnings lintable
(~"unused_variable",
Expand Down Expand Up @@ -420,7 +414,6 @@ fn check_item(i: @ast::item, cx: ty::ctxt) {
check_item_structural_records(cx, i);
check_item_deprecated_modes(cx, i);
check_item_type_limits(cx, i);
check_item_default_methods(cx, i);
}

// Take a visitor, and modify it so that it will not proceed past subitems.
Expand Down Expand Up @@ -570,27 +563,6 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) {
visit::visit_item(it, (), visit);
}

fn check_item_default_methods(cx: ty::ctxt, item: @ast::item) {
match item.node {
ast::item_trait(_, _, methods) => {
for methods.each |method| {
match *method {
ast::required(*) => {}
ast::provided(*) => {
cx.sess.span_lint(
default_methods,
item.id,
item.id,
item.span,
~"default methods are experimental");
}
}
}
}
_ => {}
}
}

fn check_item_structural_records(cx: ty::ctxt, it: @ast::item) {
let visit = item_stopping_visitor(visit::mk_simple_visitor(@{
visit_expr: fn@(e: @ast::expr) {
Expand Down
8 changes: 0 additions & 8 deletions src/test/compile-fail/lint-default-methods.rs

This file was deleted.

0 comments on commit 99fa9c3

Please sign in to comment.