diff options
| author | oliver-giersch <oliver.giersch@googlemail.com> | 2018-10-15 14:37:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-15 14:37:54 +0200 |
| commit | 5891a64165ea4819ca331f5a35f5318a91e1be3f (patch) | |
| tree | e2da4d1f0bf89c9bce5c29783744f12039b3dd33 /src/libsyntax/feature_gate.rs | |
| parent | fa76d42b3e547bd3a0e049cc2c1e00f6b9560d6c (diff) | |
| parent | 42f401dd02fd418e038d9b2829d60d69407e9aab (diff) | |
| download | rust-5891a64165ea4819ca331f5a35f5318a91e1be3f.tar.gz rust-5891a64165ea4819ca331f5a35f5318a91e1be3f.zip | |
Merge pull request #4 from rust-lang/master
sync with upstream
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index b86b92fb29e..84122688c83 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -499,6 +499,9 @@ declare_features! ( // #[cfg_attr(predicate, multiple, attributes, here)] (active, cfg_attr_multi, "1.31.0", Some(54881), None), + + // Allows `const _: TYPE = VALUE` + (active, underscore_const_names, "1.31.0", Some(54912), None), ); declare_features! ( @@ -1583,6 +1586,13 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } } + ast::ItemKind::Const(_,_) => { + if i.ident.name == "_" { + gate_feature_post!(&self, underscore_const_names, i.span, + "naming constants with `_` is unstable"); + } + } + ast::ItemKind::ForeignMod(ref foreign_module) => { self.check_abi(foreign_module.abi, i.span); } |
