diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-06-24 15:11:36 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-06-24 15:11:36 -0700 |
| commit | c06ee9f7a7fe1ad311c9fd0eb57e00646297cdbd (patch) | |
| tree | 057ba89ccf6682dac64ae9ba9e1ed4e3e95aa577 /src/libsyntax | |
| parent | f48068657a26fbe781007f6f40abaa80f6e5dbc3 (diff) | |
| parent | 116897fa6cba39ba43180debf0f9136be6a44205 (diff) | |
| download | rust-c06ee9f7a7fe1ad311c9fd0eb57e00646297cdbd.tar.gz rust-c06ee9f7a7fe1ad311c9fd0eb57e00646297cdbd.zip | |
Merge remote-tracking branch 'cmr/various-cleanup' into incoming
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 2e3d557daa9..b1fbfa0d91a 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 fa22b7ceb71..853e917a6f1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2201,26 +2201,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" } } |
