Description
Putting #![feature(…)]
in a mod is silently ignored.
I tried this code (minimized version):
https://github.com/nelhage/feature-in-mod
I'm writing some toy Rust code that needs to perform pattern-matching over ASTs (that use Box
to reference children), and wanted to use box
patterns. On advice of https://doc.rust-lang.org/1.14.0/book/box-syntax-and-patterns.html I added #![feature(box_patterns)]
to the top of my .rs
file (which is a mod
inside the larger executable).
I expected to see this happen: Either:
- The
feature()
directive would work and I would get access to the feature - The
feature()
directive would yield an error
Instead, this happened:
The feature()
directive had no observable effect at all; cargo build
output did not change after adding the line, either to show a new error or to suppress the "box pattern syntax is experimental" error.
Meta
rustc --version --verbose
:
rustc 1.25.0 (84203cac6 2018-03-25)
binary: rustc
commit-hash: 84203cac67e65ca8640b8392348411098c856985
commit-date: 2018-03-25
host: x86_64-unknown-linux-gnu
release: 1.25.0
LLVM version: 6.0