diff options
| author | Corey Richardson <corey@octayn.net> | 2013-06-21 18:10:23 -0400 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2013-06-21 18:10:56 -0400 |
| commit | 116897fa6cba39ba43180debf0f9136be6a44205 (patch) | |
| tree | ba95207fcbe3f13ad36fa3278f1137066380b340 /src/libsyntax | |
| parent | 45f588e8fd938c65df056ab72861e144cf35e674 (diff) | |
| download | rust-116897fa6cba39ba43180debf0f9136be6a44205.tar.gz rust-116897fa6cba39ba43180debf0f9136be6a44205.zip | |
Remove `ast::pure_fn` and all concept of `pure` from the compiler
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 25 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 1758433aa73..a3ead99a714 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -845,7 +845,6 @@ pub struct fn_decl { #[deriving(Eq, Encodable, Decodable)] pub enum purity { - pure_fn, // declared with "pure fn" unsafe_fn, // declared with "unsafe fn" impure_fn, // declared with "fn" extern_fn, // declared with "extern fn" @@ -856,7 +855,6 @@ impl ToStr for purity { match *self { impure_fn => ~"impure", unsafe_fn => ~"unsafe", - pure_fn => ~"pure", extern_fn => ~"extern" } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index d73c5240a1c..e166e30bd78 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2188,26 +2188,29 @@ pub fn print_fn_header_info(s: @ps, print_opt_sigil(s, opt_sigil); } -pub fn opt_sigil_to_str(opt_p: Option<ast::Sigil>) -> ~str { +pub fn opt_sigil_to_str(opt_p: Option<ast::Sigil>) -> &'static str { match opt_p { - None => ~"fn", - Some(p) => fmt!("fn%s", p.to_str()) + None => "fn", + Some(p) => match p { + ast::BorrowedSigil => "fn&", + ast::OwnedSigil => "fn~", + ast::ManagedSigil => "fn@" + } } } -pub fn purity_to_str(p: ast::purity) -> ~str { +pub fn purity_to_str(p: ast::purity) -> &'static str { match p { - ast::impure_fn => ~"impure", - ast::unsafe_fn => ~"unsafe", - ast::pure_fn => ~"pure", - ast::extern_fn => ~"extern" + ast::impure_fn => "impure", + ast::unsafe_fn => "unsafe", + ast::extern_fn => "extern" } } -pub fn onceness_to_str(o: ast::Onceness) -> ~str { +pub fn onceness_to_str(o: ast::Onceness) -> &'static str { match o { - ast::Once => ~"once", - ast::Many => ~"many" + ast::Once => "once", + ast::Many => "many" } } |
