rust/src/libsyntax
Mazdak Farrokhzad fe807fcf3e
Rollup merge of #62213 - QuietMisdreavus:cfg-doctest, r=GuillaumeGomez
rustdoc: set cfg(doctest) when collecting doctests

Note: This PR builds on top of https://github.com/rust-lang/rust/pull/61199; only the last commit is specific to this PR.

As discussed in https://github.com/rust-lang/rust/pull/61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once https://github.com/rust-lang/rust/pull/61351 lands.)

Tracking issue: https://github.com/rust-lang/rust/issues/62210
2019-07-07 17:00:18 +02:00
..
attr syntax: Migrate built-in macros to the regular stability checking 2019-07-07 13:04:07 +03:00
diagnostics Rollup merge of #61813 - matthewjasper:remove-unnecessary-symbol-ops, r=petrochenkov 2019-06-15 17:45:02 +02:00
ext syntax: Pre-intern names of all built-in macros 2019-07-07 13:04:07 +03:00
parse syntax: Pre-intern names of all built-in macros 2019-07-07 13:04:07 +03:00
print Inline rust_printer 2019-06-29 09:10:17 -04:00
util Add missing lifetime specifier 2019-07-03 10:01:03 +02:00
ast.rs Fix clippy::redundant_field_names 2019-06-26 13:59:58 +02:00
build.rs
Cargo.toml rustc: Remove dylib crate type from most rustc crates 2019-07-07 03:23:00 +02:00
config.rs Lint on 'cfg_attr(,).' 2019-06-22 12:11:01 +02:00
early_buffered_lints.rs Remove outdated question_mark_macro_sep lint 2019-06-26 20:34:12 +02:00
entry.rs
error_codes.rs
feature_gate.rs Rollup merge of #62213 - QuietMisdreavus:cfg-doctest, r=GuillaumeGomez 2019-07-07 17:00:18 +02:00
json.rs
lib.rs Rollup merge of #61545 - flip1995:internal_lints, r=oli-obk 2019-07-05 20:26:51 +02:00
mut_visit.rs Remove io::Result from syntax::print 2019-06-29 09:10:17 -04:00
ptr.rs rustc: use a separate copy of P for HIR than for AST. 2019-07-01 14:34:34 +03:00
README.md
show_span.rs
source_map.rs Fix clippy::redundant_field_names 2019-06-26 13:59:58 +02:00
std_inject.rs syntax: Introduce default/with_unstable constructors for ExpnInfo 2019-06-18 10:48:56 +03:00
test_snippet.rs
test.rs Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddyb 2019-07-05 06:55:48 +00:00
tokenstream.rs Switch master to 1.38 2019-07-04 11:26:57 -04:00
visit.rs Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkov 2019-06-24 05:00:10 +00: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: