Skip to content

Commit

Permalink
librustc: Disallow trait bounds in types, enumerations, and structure…
Browse files Browse the repository at this point in the history
… definitions. r=tjc
  • Loading branch information
pcwalton committed Jan 29, 2013
1 parent eb4d39e commit 6ce7446
Show file tree
Hide file tree
Showing 44 changed files with 424 additions and 107 deletions.
6 changes: 3 additions & 3 deletions src/libcore/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ pub mod linear {

const INITIAL_CAPACITY: uint = 32u; // 2^5

struct Bucket<K: Eq Hash, V> {
struct Bucket<K,V> {
hash: uint,
key: K,
value: V,
}

pub struct LinearMap<K: Eq Hash, V> {
pub struct LinearMap<K,V> {
k0: u64,
k1: u64,
resize_at: uint,
Expand Down Expand Up @@ -408,7 +408,7 @@ pub mod linear {
pure fn ne(&self, other: &LinearMap<K, V>) -> bool { !self.eq(other) }
}

pub struct LinearSet<T: Hash IterBytes Eq> {
pub struct LinearSet<T> {
priv map: LinearMap<T, ()>
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ pub mod fsync {


// Artifacts that need to fsync on destruction
pub struct Res<t: Copy> {
pub struct Res<t> {
arg: Arg<t>,
}

Expand Down
8 changes: 4 additions & 4 deletions src/libcore/oldcomm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ use vec;
* transmitted. If a port value is copied, both copies refer to the same
* port. Ports may be associated with multiple `chan`s.
*/
pub enum Port<T: Owned> {
pub enum Port<T> {
Port_(@PortPtr<T>)
}

Expand All @@ -84,7 +84,7 @@ pub enum Port<T: Owned> {
* data will be silently dropped. Channels may be duplicated and
* themselves transmitted over other channels.
*/
pub enum Chan<T: Owned> {
pub enum Chan<T> {
Chan_(port_id)
}

Expand Down Expand Up @@ -120,7 +120,7 @@ pub fn listen<T: Owned, U>(f: fn(Chan<T>) -> U) -> U {
f(po.chan())
}

struct PortPtr<T:Owned> {
struct PortPtr<T> {
po: *rust_port,
drop {
unsafe {
Expand Down Expand Up @@ -238,7 +238,7 @@ fn peek_chan<T: Owned>(ch: Chan<T>) -> bool {
}

/// Receive on a raw port pointer
fn recv_<T: Owned>(p: *rust_port) -> T {
fn recv_<T>(p: *rust_port) -> T {
unsafe {
let yield = 0;
let yieldp = ptr::addr_of(&yield);
Expand Down
Loading

0 comments on commit 6ce7446

Please sign in to comment.