diff options
| author | bors <bors@rust-lang.org> | 2013-05-23 18:10:36 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-23 18:10:36 -0700 |
| commit | a776d65b4d8e5eaad501af2b147cfbe1dbf10d3c (patch) | |
| tree | 1366910aafb8be2d6a9ef3872035e166a6dd8f65 /src/libsyntax | |
| parent | 4bbc13d6db303264cea477972969bf88442a611b (diff) | |
| parent | cc4fabcb4361d0daada096f5e6ac19eb6ed21d33 (diff) | |
| download | rust-a776d65b4d8e5eaad501af2b147cfbe1dbf10d3c.tar.gz rust-a776d65b4d8e5eaad501af2b147cfbe1dbf10d3c.zip | |
auto merge of #6690 : erickt/rust/cleanup-warnings, r=brson
Simple patch series to fix up all the warnings a rustc compile is giving at the moment. It also fixes a NOTE in `to_bytes.rs` to remove the `to_bytes::iter_bytes_<N>` functions.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 25 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
5 files changed, 29 insertions, 18 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index e5771a5db2e..a71f0ef2064 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -17,9 +17,8 @@ use abi::AbiSet; use opt_vec::OptVec; use parse::token::get_ident_interner; -use core::cast; use core::hashmap::HashMap; -use core::option::{Option}; +use core::option::Option; use core::to_bytes::IterBytes; use core::to_bytes; use core::to_str::ToStr; @@ -112,7 +111,9 @@ pub struct Lifetime { impl to_bytes::IterBytes for Lifetime { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { - to_bytes::iter_bytes_3(&self.id, &self.span, &self.ident, lsb0, f) + self.id.iter_bytes(lsb0, f) && + self.span.iter_bytes(lsb0, f) && + self.ident.iter_bytes(lsb0, f) } } @@ -266,7 +267,9 @@ impl to_bytes::IterBytes for binding_mode { match *self { bind_by_copy => 0u8.iter_bytes(lsb0, f), - bind_by_ref(ref m) => to_bytes::iter_bytes_2(&1u8, m, lsb0, f), + bind_by_ref(ref m) => { + 1u8.iter_bytes(lsb0, f) && m.iter_bytes(lsb0, f) + } bind_infer => 2u8.iter_bytes(lsb0, f), } @@ -788,7 +791,7 @@ pub enum ty_ { impl to_bytes::IterBytes for Ty { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { - to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f) + self.span.lo.iter_bytes(lsb0, f) && self.span.hi.iter_bytes(lsb0, f) } } @@ -876,9 +879,15 @@ impl to_bytes::IterBytes for explicit_self_ { match *self { sty_static => 0u8.iter_bytes(lsb0, f), sty_value => 1u8.iter_bytes(lsb0, f), - sty_region(ref lft, ref mutbl) => to_bytes::iter_bytes_3(&2u8, &lft, mutbl, lsb0, f), - sty_box(ref mutbl) => to_bytes::iter_bytes_2(&3u8, mutbl, lsb0, f), - sty_uniq(ref mutbl) => to_bytes::iter_bytes_2(&4u8, mutbl, lsb0, f), + sty_region(ref lft, ref mutbl) => { + 2u8.iter_bytes(lsb0, f) && lft.iter_bytes(lsb0, f) && mutbl.iter_bytes(lsb0, f) + } + sty_box(ref mutbl) => { + 3u8.iter_bytes(lsb0, f) && mutbl.iter_bytes(lsb0, f) + } + sty_uniq(ref mutbl) => { + 4u8.iter_bytes(lsb0, f) && mutbl.iter_bytes(lsb0, f) + } } } } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 283203059c8..59743b6e892 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -197,7 +197,7 @@ pub fn is_call_expr(e: @expr) -> bool { impl to_bytes::IterBytes for def_id { #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { - to_bytes::iter_bytes_2(&self.crate, &self.node, lsb0, f) + self.crate.iter_bytes(lsb0, f) && self.node.iter_bytes(lsb0, f) } } diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 77a6137cd17..42117e3b73c 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -140,7 +140,9 @@ impl<D:Decoder> Decodable<D> for span { impl to_bytes::IterBytes for span { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { - to_bytes::iter_bytes_3(&self.lo, &self.hi, &self.expn_info, lsb0, f) + self.lo.iter_bytes(lsb0, f) && + self.hi.iter_bytes(lsb0, f) && + self.expn_info.iter_bytes(lsb0, f) } } @@ -193,7 +195,7 @@ pub struct NameAndSpan {name: ~str, span: Option<span>} impl to_bytes::IterBytes for NameAndSpan { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { - to_bytes::iter_bytes_2(&self.name, &self.span, lsb0, f) + self.name.iter_bytes(lsb0, f) && self.span.iter_bytes(lsb0, f) } } @@ -204,7 +206,7 @@ pub struct CallInfo { impl to_bytes::IterBytes for CallInfo { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { - to_bytes::iter_bytes_2(&self.call_site, &self.callee, lsb0, f) + self.call_site.iter_bytes(lsb0, f) && self.callee.iter_bytes(lsb0, f) } } @@ -216,7 +218,9 @@ pub enum ExpnInfo { impl to_bytes::IterBytes for ExpnInfo { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { match *self { - ExpandedFrom(ref call_info) => to_bytes::iter_bytes_2(&0u8, call_info, lsb0, f) + ExpandedFrom(ref call_info) => { + 0u8.iter_bytes(lsb0, f) && call_info.iter_bytes(lsb0, f) + } } } } diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 545b5338ab1..da59059a0cc 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -15,11 +15,9 @@ use core::prelude::*; -use abi::AbiSet; use ast::ident; use ast; use codemap::span; -// use ext::quote::rt::*; // Transitional reexports so qquote can find the paths it is looking for mod syntax { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 0a2d0ed924e..b8993520ae4 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2752,7 +2752,7 @@ pub impl Parser { match *self.token { token::SEMI => { if !vec::is_empty(attributes_box) { - self.span_err(*self.last_span,~"expected item after attributes"); + self.span_err(*self.last_span, "expected item after attributes"); attributes_box = ~[]; } self.bump(); // empty @@ -2823,7 +2823,7 @@ pub impl Parser { } if !vec::is_empty(attributes_box) { - self.span_err(*self.last_span,~"expected item after attributes"); + self.span_err(*self.last_span, "expected item after attributes"); } let hi = self.span.hi; @@ -3742,7 +3742,7 @@ pub impl Parser { } = self.parse_foreign_items(first_item_attrs, true); if (! attrs_remaining.is_empty()) { self.span_err(*self.last_span, - ~"expected item after attributes"); + "expected item after attributes"); } assert!(*self.token == token::RBRACE); ast::foreign_mod { |
