Skip to content

Commit 4517e39

Browse files
committed
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
1 parent ce1db94 commit 4517e39

File tree

5 files changed

+1
-39
lines changed

5 files changed

+1
-39
lines changed

src/librustc/middle/lint.rs

-26
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub enum lint {
7979
non_camel_case_types,
8080
non_uppercase_statics,
8181
type_limits,
82-
default_methods,
8382
unused_unsafe,
8483

8584
managed_heap_memory,
@@ -222,13 +221,6 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
222221
default: warn
223222
}),
224223

225-
("default_methods",
226-
LintSpec {
227-
lint: default_methods,
228-
desc: "allow default methods",
229-
default: allow
230-
}),
231-
232224
("unused_unsafe",
233225
LintSpec {
234226
lint: unused_unsafe,
@@ -690,23 +682,6 @@ fn lint_type_limits() -> visit::vt<@mut Context> {
690682
})
691683
}
692684

693-
fn check_item_default_methods(cx: &Context, item: &ast::item) {
694-
match item.node {
695-
ast::item_trait(_, _, ref methods) => {
696-
for methods.iter().advance |method| {
697-
match *method {
698-
ast::required(*) => {}
699-
ast::provided(*) => {
700-
cx.span_lint(default_methods, item.span,
701-
"default methods are experimental");
702-
}
703-
}
704-
}
705-
}
706-
_ => {}
707-
}
708-
}
709-
710685
fn check_item_ctypes(cx: &Context, it: &ast::item) {
711686
fn check_ty(cx: &Context, ty: &ast::Ty) {
712687
match ty.node {
@@ -1143,7 +1118,6 @@ pub fn check_crate(tcx: ty::ctxt, crate: @ast::Crate) {
11431118
check_item_ctypes(cx, it);
11441119
check_item_non_camel_case_types(cx, it);
11451120
check_item_non_uppercase_statics(cx, it);
1146-
check_item_default_methods(cx, it);
11471121
check_item_heap(cx, it);
11481122

11491123
cx.process(Item(it));

src/libstd/cmp.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ and `Eq` to overload the `==` and `!=` operators.
2121
*/
2222

2323
#[allow(missing_doc)];
24-
#[allow(default_methods)]; // NOTE: Remove when allowed in stage0
2524

2625
/**
2726
* Trait for values that can be compared for equality and inequality.

src/libstd/iterator.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ implementing the `Iterator` trait.
1717
1818
*/
1919

20-
#[allow(default_methods)]; // still off by default in stage0
21-
2220
use cmp;
2321
use iter::Times;
2422
use num::{Zero, One};

src/test/compile-fail/lint-default-methods.rs

-7
This file was deleted.

src/test/run-pass/issue-7712.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// compile-flags:-Z debug-info
1212

13-
#[allow(default_methods)];
14-
1513
pub trait TraitWithDefaultMethod {
1614
pub fn method(self) {
1715
()
@@ -24,4 +22,4 @@ impl TraitWithDefaultMethod for MyStruct { }
2422

2523
fn main() {
2624
MyStruct.method();
27-
}
25+
}

0 commit comments

Comments
 (0)