diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-05-05 08:47:04 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-05-21 11:47:30 -0400 |
| commit | df93deab10850d52252829770895b0249b0d7f1e (patch) | |
| tree | 4e8a7657c0d2714319800a07c485bff473043bad /src/libsyntax/print/pprust.rs | |
| parent | fb206bf34a2463317b9fa1ef3c0ff35d921f8920 (diff) | |
| download | rust-df93deab10850d52252829770895b0249b0d7f1e.tar.gz rust-df93deab10850d52252829770895b0249b0d7f1e.zip | |
Make various fixes:
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5889b968f41..0b211cd0733 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -378,17 +378,6 @@ pub fn ident_to_string(id: &ast::Ident) -> String { to_string(|s| s.print_ident(*id)) } -<<<<<<< HEAD -pub fn fun_to_string(decl: &ast::FnDecl, unsafety: ast::Unsafety, name: ast::Ident, - opt_explicit_self: Option<&ast::ExplicitSelf_>, - generics: &ast::Generics) -> String { - to_string(|s| { -||||||| parent of 61a958e... syntax: parse `const fn` for free functions and inherent methods. -pub fn fun_to_string(decl: &ast::FnDecl, unsafety: ast::Unsafety, name: ast::Ident, - opt_explicit_self: Option<&ast::ExplicitSelf_>, - generics: &ast::Generics) -> String { - $to_string(|s| { -======= pub fn fun_to_string(decl: &ast::FnDecl, unsafety: ast::Unsafety, constness: ast::Constness, @@ -396,8 +385,7 @@ pub fn fun_to_string(decl: &ast::FnDecl, opt_explicit_self: Option<&ast::ExplicitSelf_>, generics: &ast::Generics) -> String { - $to_string(|s| { ->>>>>>> 61a958e... syntax: parse `const fn` for free functions and inherent methods. + to_string(|s| { try!(s.head("")); try!(s.print_fn(decl, unsafety, constness, abi::Rust, Some(name), generics, opt_explicit_self, ast::Inherited)); @@ -2751,7 +2739,7 @@ impl<'a> State<'a> { ast::Constness::NotConst, abi, name, - generics, + &generics, opt_explicit_self, ast::Inherited)); self.end() |
