rust/src/libsyntax
Mazdak Farrokhzad 50d76d6471
Rollup merge of #68114 - ecstatic-morse:fix-feature-gating, r=Centril
Don't require `allow_internal_unstable` unless `staged_api` is enabled.

#63770 changed `qualify_min_const_fn` to require `allow_internal_unstable` for *all* crates that used an unstable feature, regardless of whether `staged_api` was enabled or the `fn` that used that feature was stably const. In practice, this meant that every crate in the ecosystem that wanted to use nightly features added `#![feature(const_fn)]`, which skips `qualify_min_const_fn` entirely.

After this PR, crates that do not have `#![feature(staged_api)]` will only need to enable the feature they are interested in. For example, `#![feature(const_if_match)]` will be enough to enable `if` and `match` in constants. Crates with `staged_api` (e.g., `libstd`) require `#[allow_internal_unstable]` to be added to a function if it uses nightly features unless that function is also marked `#[rustc_const_unstable]`. This prevents proliferation of `#[allow_internal_unstable]` into functions that are not callable in a `const` context on stable.

r? @oli-obk (author of #63770)
cc @Centril
2020-01-11 12:36:14 +01:00
..
ast libsyntax: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
attr gating diagnostics -> rustc_session::parse 2020-01-11 03:15:32 +01:00
expand Rename syntax_pos to rustc_span in source code 2020-01-01 09:15:18 +03:00
print Introduce #![feature(half_open_range_patterns)]. 2020-01-10 07:29:04 +01:00
util Rollup merge of #67849 - cjkenn:check-sorted-words, r=estebank 2020-01-09 00:29:12 +09:00
ast.rs Introduce #![feature(half_open_range_patterns)]. 2020-01-10 07:29:04 +01:00
build.rs Remove licenses 2018-12-25 21:08:33 -07:00
Cargo.toml nix syntax::errors & prefer rustc_errors over errors 2020-01-10 07:41:30 +01:00
entry.rs Normalize syntax::symbol imports. 2020-01-02 13:57:04 +01:00
lib.rs Rollup merge of #68114 - ecstatic-morse:fix-feature-gating, r=Centril 2020-01-11 12:36:14 +01:00
mut_visit.rs Introduce #![feature(half_open_range_patterns)]. 2020-01-10 07:29:04 +01:00
ptr.rs Format the world 2019-12-22 17:42:47 -05:00
README.md rustc-guide has moved 2018-11-26 15:03:13 -06:00
token.rs Normalize syntax::symbol imports. 2020-01-02 13:57:04 +01:00
tokenstream.rs Rename syntax_pos to rustc_span in source code 2020-01-01 09:15:18 +03:00
visit.rs Introduce #![feature(half_open_range_patterns)]. 2020-01-10 07:29:04 +01:00

The syntax crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), parser, pretty-printer, lexer, macro expander, and utilities for traversing ASTs.

For more information about how these things work in rustc, see the rustc guide: