From bf2a225c0b6f90f61bcaf4a6f33d9eaf424795b6 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 20 Feb 2013 17:07:17 -0800 Subject: librustc: Separate most trait bounds with '+'. rs=plussing --- src/libsyntax/ast.rs | 6 +++--- src/libsyntax/codemap.rs | 4 ++-- src/libsyntax/diagnostic.rs | 2 +- src/libsyntax/ext/auto_encode.rs | 6 +++--- src/libsyntax/ext/pipes/ast_builder.rs | 2 +- src/libsyntax/parse/common.rs | 14 +++++++------- src/libsyntax/print/pprust.rs | 2 +- src/libsyntax/util/interner.rs | 2 +- src/libsyntax/util/testing.rs | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 234cef5f6eb..6befb2f1880 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -32,7 +32,7 @@ macro_rules! interner_key ( #[deriving_eq] pub struct ident { repr: uint } -pub impl Encodable for ident { +pub impl Encodable for ident { fn encode(&self, s: &S) { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) @@ -45,7 +45,7 @@ pub impl Encodable for ident { } } -pub impl Decodable for ident { +pub impl Decodable for ident { static fn decode(d: &D) -> ident { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) @@ -383,7 +383,7 @@ pub enum inferable { infer(node_id) } -pub impl to_bytes::IterBytes for inferable { +pub impl to_bytes::IterBytes for inferable { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { expl(ref t) => diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 851b35ca3bd..c9bc41ed61e 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -140,12 +140,12 @@ pub impl cmp::Eq for span { pure fn ne(&self, other: &span) -> bool { !(*self).eq(other) } } -pub impl Encodable for span { +pub impl Encodable for span { /* Note #1972 -- spans are encoded but not decoded */ fn encode(&self, _s: &S) { } } -pub impl Decodable for span { +pub impl Decodable for span { static fn decode(_d: &D) -> span { dummy_sp() } diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index ad0998d503a..f378325d0ab 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -300,7 +300,7 @@ fn print_macro_backtrace(cm: @codemap::CodeMap, sp: span) { } } -pub fn expect(diag: span_handler, +pub fn expect(diag: span_handler, opt: Option, msg: fn() -> ~str) -> T { match opt { diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index 9ceaebe6dd1..7fbba987cc7 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -23,7 +23,7 @@ For example, a type like: would generate two implementations like: -impl Encodable for Node { +impl Encodable for Node { fn encode(&self, s: &S) { do s.emit_struct("Node", 1) { s.emit_field("id", 0, || s.emit_uint(self.id)) @@ -31,7 +31,7 @@ impl Encodable for Node { } } -impl Decodable for node_id { +impl Decodable for node_id { static fn decode(d: &D) -> Node { do d.read_struct("Node", 1) { Node { @@ -54,7 +54,7 @@ would yield functions like: S: Encoder, T: Encodable > spanned: Encodable { - fn encode(s: &S) { + fn encode(s: &S) { do s.emit_rec { s.emit_field("node", 0, || self.node.encode(s)); s.emit_field("span", 1, || self.span.encode(s)); diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index f4d0e57c595..49f7fe5853e 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -319,7 +319,7 @@ pub impl ext_ctxt_ast_builder for ext_ctxt { +items: ~[@ast::item]) -> @ast::item { // XXX: Total hack: import `core::kinds::Owned` to work around a - // parser bug whereby `fn f` doesn't parse. + // parser bug whereby `fn f` doesn't parse. let vi = ast::view_item_use(~[ @codemap::spanned { node: ast::view_path_simple( diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index e7b5005d8db..4c9c9a5e52a 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -212,7 +212,7 @@ pub impl Parser { // parse a sequence bracketed by '<' and '>', stopping // before the '>'. - fn parse_seq_to_before_gt(sep: Option, + fn parse_seq_to_before_gt(sep: Option, f: fn(Parser) -> T) -> ~[T] { let mut first = true; let mut v = ~[]; @@ -231,7 +231,7 @@ pub impl Parser { return v; } - fn parse_seq_to_gt(sep: Option, + fn parse_seq_to_gt(sep: Option, f: fn(Parser) -> T) -> ~[T] { let v = self.parse_seq_to_before_gt(sep, f); self.expect_gt(); @@ -240,7 +240,7 @@ pub impl Parser { } // parse a sequence bracketed by '<' and '>' - fn parse_seq_lt_gt(sep: Option, + fn parse_seq_lt_gt(sep: Option, f: fn(Parser) -> T) -> spanned<~[T]> { let lo = self.span.lo; self.expect(token::LT); @@ -253,7 +253,7 @@ pub impl Parser { // parse a sequence, including the closing delimiter. The function // f must consume tokens until reaching the next separator or // closing bracket. - fn parse_seq_to_end(ket: token::Token, sep: seq_sep, + fn parse_seq_to_end(ket: token::Token, sep: seq_sep, f: fn(Parser) -> T) -> ~[T] { let val = self.parse_seq_to_before_end(ket, sep, f); self.bump(); @@ -263,7 +263,7 @@ pub impl Parser { // parse a sequence, not including the closing delimiter. The function // f must consume tokens until reaching the next separator or // closing bracket. - fn parse_seq_to_before_end(ket: token::Token, sep: seq_sep, + fn parse_seq_to_before_end(ket: token::Token, sep: seq_sep, f: fn(Parser) -> T) -> ~[T] { let mut first: bool = true; let mut v: ~[T] = ~[]; @@ -284,7 +284,7 @@ pub impl Parser { // parse a sequence, including the closing delimiter. The function // f must consume tokens until reaching the next separator or // closing bracket. - fn parse_unspanned_seq(bra: token::Token, + fn parse_unspanned_seq(bra: token::Token, ket: token::Token, sep: seq_sep, f: fn(Parser) -> T) -> ~[T] { @@ -296,7 +296,7 @@ pub impl Parser { // NB: Do not use this function unless you actually plan to place the // spanned list in the AST. - fn parse_seq(bra: token::Token, ket: token::Token, sep: seq_sep, + fn parse_seq(bra: token::Token, ket: token::Token, sep: seq_sep, f: fn(Parser) -> T) -> spanned<~[T]> { let lo = self.span.lo; self.expect(bra); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index eeba00be704..ab7e3204b7b 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2282,7 +2282,7 @@ pub mod test { //use util; use util::testing::check_equal; - fn string_check (given : &T, expected: &T) { + fn string_check (given : &T, expected: &T) { if !(given == expected) { fail!(fmt!("given %?, expected %?",given,expected)); } diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index dcb3261169b..4b13818974c 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -23,7 +23,7 @@ pub struct Interner { } // when traits can extend traits, we should extend index to get [] -pub impl Interner { +pub impl Interner { static fn new() -> Interner { Interner { map: LinearMap::new(), diff --git a/src/libsyntax/util/testing.rs b/src/libsyntax/util/testing.rs index b6d333349a0..78a175df29f 100644 --- a/src/libsyntax/util/testing.rs +++ b/src/libsyntax/util/testing.rs @@ -11,13 +11,13 @@ // support for test cases. use core::cmp; -pub pure fn check_equal_ptr (given : &T, expected: &T) { +pub pure fn check_equal_ptr (given : &T, expected: &T) { if !((given == expected) && (expected == given )) { fail!(fmt!("given %?, expected %?",given,expected)); } } -pub pure fn check_equal (given : T, expected: T) { +pub pure fn check_equal (given : T, expected: T) { if !((given == expected) && (expected == given )) { fail!(fmt!("given %?, expected %?",given,expected)); } -- cgit 1.4.1-3-g733a5