diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-07-10 14:43:25 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-07-17 14:57:53 -0700 |
| commit | e20549ff192edec9d625f1119bcb077c3abaf070 (patch) | |
| tree | 9cf88e584f36dc0d7f9f29a2fae55f0203bbc39c /src/libsyntax | |
| parent | 99d44d24c7744361b352499b5f54b8f0bab876ec (diff) | |
| download | rust-e20549ff192edec9d625f1119bcb077c3abaf070.tar.gz rust-e20549ff192edec9d625f1119bcb077c3abaf070.zip | |
librustc: Remove all uses of the `Copy` bound.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_util.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 60 |
4 files changed, 36 insertions, 34 deletions
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 843fd4bdba2..d0dfb0fb06e 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -16,11 +16,13 @@ use opt_vec; use parse::token; use visit; +use std::cast::unsafe_copy; +use std::cast; use std::hashmap::HashMap; use std::int; +use std::local_data; use std::num; use std::option; -use std::local_data; pub fn path_name_i(idents: &[ident]) -> ~str { // FIXME: Bad copies (#2543 -- same for everything else that says "bad") diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index e2f37bd54bd..230640767c9 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -414,7 +414,7 @@ pub enum MapChain<K,V> { // get the map from an env frame -impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{ +impl <K: Eq + Hash + IterBytes, V> MapChain<K,V>{ // Constructor. I don't think we need a zero-arg one. fn new(init: ~HashMap<K,@V>) -> @mut MapChain<K,V> { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index ba8e3e72933..2f1d320fef7 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -693,7 +693,7 @@ pub fn inject_std_macros(parse_sess: @mut parse::ParseSess, cfg: ast::crate_cfg, c: &crate) -> @crate { let sm = match parse_item_from_source_str(@"<std-macros>", std_macros(), - copy cfg, + cfg.clone(), ~[], parse_sess) { Some(item) => item, @@ -708,7 +708,7 @@ pub fn inject_std_macros(parse_sess: @mut parse::ParseSess, ast::_mod { items: items, // FIXME #2543: Bad copy. - .. copy *modd + .. (*modd).clone() } }, .. *default_ast_fold() diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f0b9258eaeb..adecbc050a3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -473,10 +473,10 @@ impl Parser { // parse a sequence bracketed by '<' and '>', stopping // before the '>'. - pub fn parse_seq_to_before_gt<T: Copy>(&self, - sep: Option<token::Token>, - f: &fn(&Parser) -> T) - -> OptVec<T> { + pub fn parse_seq_to_before_gt<T>(&self, + sep: Option<token::Token>, + f: &fn(&Parser) -> T) + -> OptVec<T> { let mut first = true; let mut v = opt_vec::Empty; while *self.token != token::GT @@ -493,10 +493,10 @@ impl Parser { return v; } - pub fn parse_seq_to_gt<T: Copy>(&self, - sep: Option<token::Token>, - f: &fn(&Parser) -> T) - -> OptVec<T> { + pub fn parse_seq_to_gt<T>(&self, + sep: Option<token::Token>, + f: &fn(&Parser) -> T) + -> OptVec<T> { let v = self.parse_seq_to_before_gt(sep, f); self.expect_gt(); return v; @@ -505,11 +505,11 @@ impl Parser { // parse a sequence, including the closing delimiter. The function // f must consume tokens until reaching the next separator or // closing bracket. - pub fn parse_seq_to_end<T: Copy>(&self, - ket: &token::Token, - sep: SeqSep, - f: &fn(&Parser) -> T) - -> ~[T] { + pub fn parse_seq_to_end<T>(&self, + ket: &token::Token, + sep: SeqSep, + f: &fn(&Parser) -> T) + -> ~[T] { let val = self.parse_seq_to_before_end(ket, sep, f); self.bump(); val @@ -518,11 +518,11 @@ impl Parser { // parse a sequence, not including the closing delimiter. The function // f must consume tokens until reaching the next separator or // closing bracket. - pub fn parse_seq_to_before_end<T: Copy>(&self, - ket: &token::Token, - sep: SeqSep, - f: &fn(&Parser) -> T) - -> ~[T] { + pub fn parse_seq_to_before_end<T>(&self, + ket: &token::Token, + sep: SeqSep, + f: &fn(&Parser) -> T) + -> ~[T] { let mut first: bool = true; let mut v: ~[T] = ~[]; while *self.token != *ket { @@ -542,12 +542,12 @@ impl Parser { // parse a sequence, including the closing delimiter. The function // f must consume tokens until reaching the next separator or // closing bracket. - pub fn parse_unspanned_seq<T: Copy>(&self, - bra: &token::Token, - ket: &token::Token, - sep: SeqSep, - f: &fn(&Parser) -> T) - -> ~[T] { + pub fn parse_unspanned_seq<T>(&self, + bra: &token::Token, + ket: &token::Token, + sep: SeqSep, + f: &fn(&Parser) -> T) + -> ~[T] { self.expect(bra); let result = self.parse_seq_to_before_end(ket, sep, f); self.bump(); @@ -556,12 +556,12 @@ impl Parser { // NB: Do not use this function unless you actually plan to place the // spanned list in the AST. - pub fn parse_seq<T: Copy>(&self, - bra: &token::Token, - ket: &token::Token, - sep: SeqSep, - f: &fn(&Parser) -> T) - -> spanned<~[T]> { + pub fn parse_seq<T>(&self, + bra: &token::Token, + ket: &token::Token, + sep: SeqSep, + f: &fn(&Parser) -> T) + -> spanned<~[T]> { let lo = self.span.lo; self.expect(bra); let result = self.parse_seq_to_before_end(ket, sep, f); |
