librustc: Mark all type implementations public. rs=impl-publicity
This commit is contained in:
parent
b171d0ef7b
commit
107bf96ff0
114 changed files with 175 additions and 175 deletions
|
|
@ -4,7 +4,7 @@ pub struct Fish {
|
|||
x: int
|
||||
}
|
||||
|
||||
impl Fish {
|
||||
pub impl Fish {
|
||||
fn swim(&self) {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
enum S = ();
|
||||
|
||||
impl S {
|
||||
pub impl S {
|
||||
fn foo() { }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ fn timed(result: &mut float, op: fn()) {
|
|||
*result = (end - start);
|
||||
}
|
||||
|
||||
impl Results {
|
||||
pub impl Results {
|
||||
fn bench_int<T:Set<uint>>(&mut self, rng: @rand::Rng, num_keys: uint,
|
||||
rand_cap: uint, f: fn() -> T) {
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ fn Noise2DContext() -> ~Noise2DContext {
|
|||
}
|
||||
}
|
||||
|
||||
impl Noise2DContext {
|
||||
pub impl Noise2DContext {
|
||||
#[inline(always)]
|
||||
fn get_gradient(&self, x: int, y: int) -> Vec2 {
|
||||
let idx = self.permutations[x & 255] + self.permutations[y & 255];
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct cat {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
|
||||
fn speak() { self.meows += 1u; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
use core::either::*;
|
||||
enum X = Either<(uint,uint),extern fn()>;
|
||||
impl &X {
|
||||
pub impl &X {
|
||||
fn with(blk: fn(x: &Either<(uint,uint),extern fn()>)) {
|
||||
blk(&**self)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct Foo {
|
|||
x: int,
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
fn f(&self) {}
|
||||
fn g(&const self) {}
|
||||
fn h(&mut self) {}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct Foo {
|
|||
n: LinearSet<int>,
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
fn foo(&mut self, fun: fn(&int)) {
|
||||
for self.n.each |f| {
|
||||
fun(f);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ impl ops::Add<int,int> for Point {
|
|||
}
|
||||
}
|
||||
|
||||
impl Point {
|
||||
pub impl Point {
|
||||
fn times(z: int) -> int {
|
||||
self.x * self.y * z
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ struct cat {
|
|||
name : ~str,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
|
||||
fn eat() -> bool {
|
||||
if self.how_hungry > 0 {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ struct cat {
|
|||
tail: int,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn meow() { tail += 1; } //~ ERROR: Did you mean: `self.tail`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ pub mod stream {
|
|||
use core::option;
|
||||
use core::pipes;
|
||||
|
||||
impl<T:Owned> Stream<T> {
|
||||
pub impl<T:Owned> Stream<T> {
|
||||
pub fn recv() -> extern fn(+v: Stream<T>) -> ::stream::Stream<T> {
|
||||
// resolve really should report just one error here.
|
||||
// Change the test case when it changes.
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ fn siphash(k0 : u64) {
|
|||
v0: u64,
|
||||
}
|
||||
|
||||
impl siphash {
|
||||
pub impl siphash {
|
||||
fn reset(&mut self) {
|
||||
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture
|
||||
//~^ ERROR unresolved name: `k0`.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// xfail-test
|
||||
enum x = ();
|
||||
impl x {
|
||||
pub impl x {
|
||||
unsafe fn with() { } // This should fail
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct Foo {
|
|||
u: ~()
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
fn get_s(&self) -> &self/str {
|
||||
self.s
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct Obj {
|
|||
member: uint
|
||||
}
|
||||
|
||||
impl Obj {
|
||||
pub impl Obj {
|
||||
static pure fn boom() -> bool {
|
||||
return 1+1 == 2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ mod my_mod {
|
|||
pub fn MyStruct () -> MyStruct {
|
||||
MyStruct {priv_field: 4}
|
||||
}
|
||||
impl MyStruct {
|
||||
pub impl MyStruct {
|
||||
priv fn happyfun() {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct cat {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn eat() {
|
||||
self.how_hungry -= 5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct dog {
|
|||
cats_chased: uint,
|
||||
}
|
||||
|
||||
impl dog {
|
||||
pub impl dog {
|
||||
fn chase_cat(&mut self) {
|
||||
let p: &static/mut uint = &mut self.cats_chased; //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements
|
||||
*p += 1u;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct dog {
|
|||
food: uint,
|
||||
}
|
||||
|
||||
impl dog {
|
||||
pub impl dog {
|
||||
fn chase_cat(&mut self) {
|
||||
for uint::range(0u, 10u) |_i| {
|
||||
let p: &'static mut uint = &mut self.food; //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern: implement a trait or new type instead
|
||||
impl <T> Option<T> {
|
||||
pub impl <T> Option<T> {
|
||||
fn foo() { }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ impl Drop for S {
|
|||
fn finalize(&self) {}
|
||||
}
|
||||
|
||||
impl S {
|
||||
pub impl S {
|
||||
fn foo(self) -> int {
|
||||
self.bar();
|
||||
return self.x; //~ ERROR use of moved value
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ struct S {
|
|||
x: ~int
|
||||
}
|
||||
|
||||
impl S {
|
||||
pub impl S {
|
||||
fn foo(self) -> int {
|
||||
self.bar();
|
||||
return *self.x; //~ ERROR use of moved value
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct Foo {
|
|||
x: int
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
static fn new() -> Foo {
|
||||
Foo { x: 3 }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
enum Foo = uint;
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
fn len(&self) -> uint { **self }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct Foo {
|
|||
x: int,
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
fn f(&const self) {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ struct Wizard {
|
|||
spells: ~[&static/str]
|
||||
}
|
||||
|
||||
impl Wizard {
|
||||
pub impl Wizard {
|
||||
fn cast(&mut self) {
|
||||
for self.spells.each |&spell| {
|
||||
io::println(spell);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct dog {
|
|||
volume : @mut int,
|
||||
}
|
||||
|
||||
impl dog {
|
||||
pub impl dog {
|
||||
priv fn bark() -> int {
|
||||
debug!("Woof %u %d", *self.barks, *self.volume);
|
||||
*self.barks += 1u;
|
||||
|
|
@ -55,7 +55,7 @@ impl noisy for cat {
|
|||
fn speak() -> int { self.meow() as int }
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn meow_count() -> uint { *self.meows }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ impl noisy for cat {
|
|||
fn speak(&mut self) { self.meow(); }
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn eat(&mut self) -> bool {
|
||||
if self.how_hungry > 0 {
|
||||
error!("OM NOM NOM");
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ struct cat<T> {
|
|||
name : T,
|
||||
}
|
||||
|
||||
impl<T> cat<T> {
|
||||
pub impl<T> cat<T> {
|
||||
fn speak(&mut self) { self.meow(); }
|
||||
|
||||
fn eat(&mut self) -> bool {
|
||||
|
|
@ -103,7 +103,7 @@ impl<T> Map<int, T> for cat<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> cat<T> {
|
||||
pub impl<T> cat<T> {
|
||||
pure fn get(&self, k: &int) -> &self/T {
|
||||
match self.find(k) {
|
||||
Some(v) => { v }
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct cat {
|
|||
name : ~str,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn eat(&mut self) -> bool {
|
||||
if self.how_hungry > 0 {
|
||||
error!("OM NOM NOM");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ priv impl cat {
|
|||
}
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn eat(&mut self) -> bool {
|
||||
if self.how_hungry > 0 {
|
||||
error!("OM NOM NOM");
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct cat {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn speak(&mut self) { self.meows += 1u; }
|
||||
fn meow_count(&mut self) -> uint { self.meows }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct cat<U> {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl<U> cat<U> {
|
||||
pub impl<U> cat<U> {
|
||||
fn speak<T>(&mut self, stuff: ~[T]) {
|
||||
self.meows += stuff.len();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct cat {
|
|||
name : ~str,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn speak(&mut self) { self.meow(); }
|
||||
|
||||
fn eat(&mut self) -> bool {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct cat<U> {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl<U> cat<U> {
|
||||
pub impl<U> cat<U> {
|
||||
fn speak(&mut self) { self.meows += 1u; }
|
||||
fn meow_count(&mut self) -> uint { self.meows }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct cat {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn speak(&mut self) {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct cat {
|
|||
name : ~str,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn speak(&mut self) { self.meow(); }
|
||||
|
||||
fn eat(&mut self) -> bool {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ struct SpeechMaker {
|
|||
speeches: uint
|
||||
}
|
||||
|
||||
impl SpeechMaker {
|
||||
pub impl SpeechMaker {
|
||||
pure fn how_many(&self) -> uint { self.speeches }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ struct SpeechMaker {
|
|||
speeches: uint
|
||||
}
|
||||
|
||||
impl SpeechMaker {
|
||||
pub impl SpeechMaker {
|
||||
fn talk(&mut self) {
|
||||
self.speeches += 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
enum E { V, VV(int) }
|
||||
const C: E = V;
|
||||
|
||||
impl E {
|
||||
pub impl E {
|
||||
fn method(&self) {
|
||||
match *self {
|
||||
V => {}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct Box {
|
|||
x: uint
|
||||
}
|
||||
|
||||
impl Box {
|
||||
pub impl Box {
|
||||
fn set_many(&mut self, xs: &[uint]) {
|
||||
for xs.each |x| { self.x = *x; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ fn linear_map<K,V>() -> LinearMap<K,V> {
|
|||
size: 0})
|
||||
}
|
||||
|
||||
impl<K,V> LinearMap<K,V> {
|
||||
pub impl<K,V> LinearMap<K,V> {
|
||||
fn len(&mut self) -> uint {
|
||||
self.size
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ fn compute_area(shape: &shape) -> float {
|
|||
}
|
||||
}
|
||||
|
||||
impl shape {
|
||||
pub impl shape {
|
||||
// self is in the implicit self region
|
||||
fn select<T>(&self, threshold: float,
|
||||
a: &r/T, b: &r/T) -> &r/T {
|
||||
|
|
@ -54,7 +54,7 @@ fn thing(x: A) -> thing {
|
|||
}
|
||||
}
|
||||
|
||||
impl thing {
|
||||
pub impl thing {
|
||||
fn foo(@self) -> int { *self.x.a }
|
||||
fn bar(~self) -> int { *self.x.a }
|
||||
fn quux(&self) -> int { *self.x.a }
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ enum option_<T> {
|
|||
some_(T),
|
||||
}
|
||||
|
||||
impl<T> option_<T> {
|
||||
pub impl<T> option_<T> {
|
||||
fn foo() -> bool { true }
|
||||
}
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ enum option__ {
|
|||
some__(int)
|
||||
}
|
||||
|
||||
impl option__ {
|
||||
pub impl option__ {
|
||||
fn foo() -> bool { true }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct foo<A> {
|
|||
x: A,
|
||||
}
|
||||
|
||||
impl<A:Copy> foo<A> {
|
||||
pub impl<A:Copy> foo<A> {
|
||||
fn bar<B,C:clam<A>>(c: C) -> B {
|
||||
fail!();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ trait clam<A> { }
|
|||
|
||||
enum foo = int;
|
||||
|
||||
impl foo {
|
||||
pub impl foo {
|
||||
fn bar<B,C:clam<B>>(c: C) -> B { fail!(); }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct c1<T> {
|
|||
x: T,
|
||||
}
|
||||
|
||||
impl<T:Copy> c1<T> {
|
||||
pub impl<T:Copy> c1<T> {
|
||||
fn f1(x: int) {
|
||||
}
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ fn c1<T:Copy>(x: T) -> c1<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T:Copy> c1<T> {
|
||||
pub impl<T:Copy> c1<T> {
|
||||
fn f2(x: int) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct c1<T> {
|
|||
x: T,
|
||||
}
|
||||
|
||||
impl<T:Copy> c1<T> {
|
||||
pub impl<T:Copy> c1<T> {
|
||||
fn f1(x: T) {}
|
||||
}
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ fn c1<T:Copy>(x: T) -> c1<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T:Copy> c1<T> {
|
||||
pub impl<T:Copy> c1<T> {
|
||||
fn f2(x: T) {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ impl Drop for socket {
|
|||
fn finalize(&self) {}
|
||||
}
|
||||
|
||||
impl socket {
|
||||
pub impl socket {
|
||||
|
||||
fn set_identity() {
|
||||
do closure {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct font {
|
|||
fontbuf: &self/~[u8],
|
||||
}
|
||||
|
||||
impl font {
|
||||
pub impl font {
|
||||
fn buf() -> &self/~[u8] {
|
||||
self.fontbuf
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn thing() -> thing {
|
|||
x: 0
|
||||
}
|
||||
}
|
||||
impl thing { fn f(self) {} }
|
||||
pub impl thing { fn f(self) {} }
|
||||
|
||||
pub fn main() {
|
||||
let z = thing();
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct list<T> {
|
|||
next: Option<@mut list<T>>
|
||||
}
|
||||
|
||||
impl<T> list<T>{
|
||||
pub impl<T> list<T>{
|
||||
fn addEnd(&mut self, element: &self/T) {
|
||||
let newList = list {
|
||||
element: element,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
struct Foo { x: int }
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
fn stuff(&mut self) -> &self/mut Foo {
|
||||
return self;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ struct X {
|
|||
err: ErrPrinter
|
||||
}
|
||||
|
||||
impl X {
|
||||
pub impl X {
|
||||
fn boom() {
|
||||
exit(self.err, "prog", "arg");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct Foo {
|
|||
y: int,
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
pub impl Foo {
|
||||
fn sum() -> int {
|
||||
self.x + self.y
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ struct S {
|
|||
x: ~str
|
||||
}
|
||||
|
||||
impl S {
|
||||
pub impl S {
|
||||
fn foo(self) {
|
||||
self.bar();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ pub fn main() {
|
|||
i: int,
|
||||
}
|
||||
|
||||
impl b {
|
||||
pub impl b {
|
||||
fn do_stuff() -> int { return 37; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct S {
|
|||
x: int
|
||||
}
|
||||
|
||||
impl S {
|
||||
pub impl S {
|
||||
pure fn add(&self, other: &S) -> S {
|
||||
S { x: self.x + other.x }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct cat {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn meow_count(&mut self) -> uint { self.meows }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct cat {
|
|||
how_hungry : int,
|
||||
}
|
||||
|
||||
impl cat {
|
||||
pub impl cat {
|
||||
fn play(&mut self) {
|
||||
self.meows += 1u;
|
||||
self.nap();
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ fn align(size: uint, align: uint) -> uint {
|
|||
|
||||
enum ptr_visit_adaptor<V> = Inner<V>;
|
||||
|
||||
impl<V:TyVisitor + movable_ptr> ptr_visit_adaptor<V> {
|
||||
pub impl<V:TyVisitor + movable_ptr> ptr_visit_adaptor<V> {
|
||||
|
||||
#[inline(always)]
|
||||
fn bump(sz: uint) {
|
||||
|
|
@ -478,7 +478,7 @@ struct Stuff {
|
|||
vals: ~[~str]
|
||||
}
|
||||
|
||||
impl my_visitor {
|
||||
pub impl my_visitor {
|
||||
fn get<T>(f: fn(T)) {
|
||||
unsafe {
|
||||
f(*(self.ptr1 as *T));
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ impl Drop for shrinky_pointer {
|
|||
}
|
||||
}
|
||||
|
||||
impl shrinky_pointer {
|
||||
pub impl shrinky_pointer {
|
||||
fn look_at() -> int { return **(self.i); }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue