Take default methods out from behind the flag.
This commit is contained in:
parent
19446418bc
commit
3fa5203273
23 changed files with 2 additions and 23 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#[allow(default_methods)];
|
||||
|
||||
pub struct Something { x: int }
|
||||
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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]) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ pub trait Clone2 {
|
|||
fn clone(&self) -> Self;
|
||||
}
|
||||
|
||||
#[allow(default_methods)]
|
||||
trait Getter<T: Clone> {
|
||||
fn do_get(&self) -> T;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue