Take default methods out from behind the flag.

This commit is contained in:
Michael Sullivan 2013-07-11 14:09:42 -07:00
parent 19446418bc
commit 3fa5203273
23 changed files with 2 additions and 23 deletions

View file

@ -236,7 +236,7 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
LintSpec {
lint: default_methods,
desc: "allow default methods",
default: deny
default: allow
}),
("unused_unsafe",

View file

@ -17,7 +17,7 @@ implementing the `Iterator` trait.
*/
#[allow(default_methods)]; // solid enough for the use case here
#[allow(default_methods)]; // still off by default in stage0
use cmp;
use iter::Times;

View file

@ -18,7 +18,6 @@ trait Positioned {
fn X(&self) -> int;
}
#[allow(default_methods)]
trait Movable: Positioned {
fn translate(&self, dx: int) {
self.SetX(self.X() + dx);

View file

@ -1,4 +1,3 @@
#[allow(default_methods)];
pub struct Something { x: int }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)]
trait Speak {
fn say(&self, s:&str) -> ~str;
fn hi(&self) -> ~str { hello(self) }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
pub trait Foo<T> {
pub fn func1<U>(&self, t: U);

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Foo {
fn f(&self) {

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)]
trait Canvas {
fn add_point(&self, point: &int);
fn add_points(&self, shapes: &[int]) {

View file

@ -113,7 +113,6 @@ impl ToStr for AsciiArt {
// This is similar to an interface in other languages: it defines a protocol which
// developers can implement for arbitrary concrete types.
#[allow(default_methods)]
trait Canvas {
fn add_point(&mut self, shape: Point);
fn add_rect(&mut self, shape: Rect);

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Foo {
fn a(&self) -> int;

View file

@ -14,7 +14,6 @@ trait Positioned<S> {
fn X(&self) -> S;
}
#[allow(default_methods)]
trait Movable<S, T>: Positioned<T> {
fn translate(&self, dx: T) {
self.SetX(self.X() + dx);

View file

@ -16,7 +16,6 @@ trait Positioned {
fn X(&self) -> int;
}
#[allow(default_methods)]
trait Movable: Positioned {
fn translate(&mut self, dx: int) {
let x = self.X();

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A<T> {
fn g<U>(&self, x: T, y: U) -> (T, U) { (x, y) }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A<T> {
fn g(&self, x: T) -> T { x }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A {
fn g<T>(&self, x: T, y: T) -> (T, T) { (x, y) }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A<T> {
fn g(&self, x: uint) -> uint { x }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A {
fn g(&self) -> int { 10 }

View file

@ -1,7 +1,6 @@
// xfail-fast
// aux-build:trait_default_method_xc_aux.rs
#[allow(default_methods)];
extern mod aux(name = "trait_default_method_xc_aux");
use aux::{A, TestEquality, Something};

View file

@ -15,7 +15,6 @@ pub trait Clone2 {
fn clone(&self) -> Self;
}
#[allow(default_methods)]
trait Getter<T: Clone> {
fn do_get(&self) -> T;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Foo {
fn bar(&self) -> ~str {

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Foo {
fn foo(&self, mut v: int) { v = 1; }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Cat {
fn meow(&self) -> bool;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Cat {
fn meow(&self) -> bool;