diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-02-25 22:05:07 +0200 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-05-21 11:47:30 -0400 |
| commit | af3795721cd9ffc591eeeb077df16d3658be150f (patch) | |
| tree | 045c56da8c0228dd3eed799475c86a0d8ff1dcc4 /src/libsyntax/ast.rs | |
| parent | bc6318d2be4d9eb62af9170958fd48ef45e4a74e (diff) | |
| download | rust-af3795721cd9ffc591eeeb077df16d3658be150f.tar.gz rust-af3795721cd9ffc591eeeb077df16d3658be150f.zip | |
syntax: parse `const fn` for free functions and inherent methods.
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index e00cb82649b..bd7fb441bf5 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1475,6 +1475,12 @@ pub enum Unsafety { Normal, } +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +pub enum Constness { + Const, + NotConst, +} + impl fmt::Display for Unsafety { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(match *self { @@ -1543,6 +1549,7 @@ pub enum ExplicitSelf_ { pub type ExplicitSelf = Spanned<ExplicitSelf_>; #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] + Constness, pub struct Mod { /// A span from the first token past `{` to the last token until `}`. /// For `mod foo;`, the inner span ranges from the first token @@ -1761,7 +1768,7 @@ pub enum Item_ { /// A `const` item ItemConst(P<Ty>, P<Expr>), /// A function declaration - ItemFn(P<FnDecl>, Unsafety, Abi, Generics, P<Block>), + ItemFn(P<FnDecl>, Unsafety, Constness, Abi, Generics, P<Block>), /// A module ItemMod(Mod), /// An external module |
