rm default method lint
default methods are enabled by default, so there's not much point in keeping around a lint to report them as being experimental
This commit is contained in:
parent
ce1db94647
commit
4517e39125
5 changed files with 1 additions and 39 deletions
|
@ -79,7 +79,6 @@ pub enum lint {
|
|||
non_camel_case_types,
|
||||
non_uppercase_statics,
|
||||
type_limits,
|
||||
default_methods,
|
||||
unused_unsafe,
|
||||
|
||||
managed_heap_memory,
|
||||
|
@ -222,13 +221,6 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
|
|||
default: warn
|
||||
}),
|
||||
|
||||
("default_methods",
|
||||
LintSpec {
|
||||
lint: default_methods,
|
||||
desc: "allow default methods",
|
||||
default: allow
|
||||
}),
|
||||
|
||||
("unused_unsafe",
|
||||
LintSpec {
|
||||
lint: unused_unsafe,
|
||||
|
@ -690,23 +682,6 @@ fn lint_type_limits() -> visit::vt<@mut Context> {
|
|||
})
|
||||
}
|
||||
|
||||
fn check_item_default_methods(cx: &Context, item: &ast::item) {
|
||||
match item.node {
|
||||
ast::item_trait(_, _, ref methods) => {
|
||||
for methods.iter().advance |method| {
|
||||
match *method {
|
||||
ast::required(*) => {}
|
||||
ast::provided(*) => {
|
||||
cx.span_lint(default_methods, item.span,
|
||||
"default methods are experimental");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn check_item_ctypes(cx: &Context, it: &ast::item) {
|
||||
fn check_ty(cx: &Context, ty: &ast::Ty) {
|
||||
match ty.node {
|
||||
|
@ -1143,7 +1118,6 @@ pub fn check_crate(tcx: ty::ctxt, crate: @ast::Crate) {
|
|||
check_item_ctypes(cx, it);
|
||||
check_item_non_camel_case_types(cx, it);
|
||||
check_item_non_uppercase_statics(cx, it);
|
||||
check_item_default_methods(cx, it);
|
||||
check_item_heap(cx, it);
|
||||
|
||||
cx.process(Item(it));
|
||||
|
|
|
@ -21,7 +21,6 @@ and `Eq` to overload the `==` and `!=` operators.
|
|||
*/
|
||||
|
||||
#[allow(missing_doc)];
|
||||
#[allow(default_methods)]; // NOTE: Remove when allowed in stage0
|
||||
|
||||
/**
|
||||
* Trait for values that can be compared for equality and inequality.
|
||||
|
|
|
@ -17,8 +17,6 @@ implementing the `Iterator` trait.
|
|||
|
||||
*/
|
||||
|
||||
#[allow(default_methods)]; // still off by default in stage0
|
||||
|
||||
use cmp;
|
||||
use iter::Times;
|
||||
use num::{Zero, One};
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#[forbid(default_methods)];
|
||||
|
||||
trait Foo { //~ ERROR default methods are experimental
|
||||
fn bar(&self) { println("hi"); }
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// compile-flags:-Z debug-info
|
||||
|
||||
#[allow(default_methods)];
|
||||
|
||||
pub trait TraitWithDefaultMethod {
|
||||
pub fn method(self) {
|
||||
()
|
||||
|
@ -24,4 +22,4 @@ impl TraitWithDefaultMethod for MyStruct { }
|
|||
|
||||
fn main() {
|
||||
MyStruct.method();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue