about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-11-27Auto merge of #79318 - cjgillot:fitem, r=lcnrbors-0/+8
Store HIR ForeignItem in a side table In a similar fashion to Item, ImplItem and TraitItem.
2020-11-27Auto merge of #79266 - b-naber:gat_trait_path_parser, r=petrochenkovbors-0/+7
Generic Associated Types in Trait Paths - Ast part The Ast part of https://github.com/rust-lang/rust/pull/78978 r? `@petrochenkov`
2020-11-26Rebase fallout.Camille GILLOT-0/+5
2020-11-26Store ForeignItem in a side table.Camille GILLOT-0/+3
2020-11-25insert span_fatal call in ast lowering to indicate that generic arguments in ↵b-naber-0/+7
AssocTyConstraints haven't been fully implemented
2020-11-23Remove Pat pre-lowering.Camille GILLOT-43/+5
2020-11-15Rollup merge of #77802 - jyn514:bootstrap-specific, r=nikomatsakisJonas Schievink-3/+1
Allow making `RUSTC_BOOTSTRAP` conditional on the crate name Motivation: This came up in the [Zulip stream](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Require.20users.20to.20confirm.20they.20know.20RUSTC_.E2.80.A6.20compiler-team.23350/near/208403962) for https://github.com/rust-lang/compiler-team/issues/350. See also https://github.com/rust-lang/cargo/pull/6608#issuecomment-458546258; this implements https://github.com/rust-lang/cargo/issues/6627. The goal is for this to eventually allow prohibiting setting `RUSTC_BOOTSTRAP` in build.rs (https://github.com/rust-lang/cargo/issues/7088). ## User-facing changes - `RUSTC_BOOTSTRAP=1` still works; there is no current plan to remove this. - Things like `RUSTC_BOOTSTRAP=0` no longer activate nightly features. In practice this shouldn't be a big deal, since `RUSTC_BOOTSTRAP` is the opposite of stable and everyone uses `RUSTC_BOOTSTRAP=1` anyway. - `RUSTC_BOOTSTRAP=x` will enable nightly features only for crate `x`. - `RUSTC_BOOTSTRAP=x,y` will enable nightly features only for crates `x` and `y`. ## Implementation changes The main change is that `UnstableOptions::from_environment` now requires an (optional) crate name. If the crate name is unknown (`None`), then the new feature is not available and you still have to use `RUSTC_BOOTSTRAP=1`. In practice this means the feature is only available for `--crate-name`, not for `#![crate_name]`; I'm interested in supporting the second but I'm not sure how. Other major changes: - Added `Session::is_nightly_build()`, which uses the `crate_name` of the session - Added `nightly_options::match_is_nightly_build`, a convenience method for looking up `--crate-name` from CLI arguments. `Session::is_nightly_build()`should be preferred where possible, since it will take into account `#![crate_name]` (I think). - Added `unstable_features` to `rustdoc::RenderOptions` I'm not sure whether this counts as T-compiler or T-lang; _technically_ RUSTC_BOOTSTRAP is an implementation detail, but it's been used so much it seems like this counts as a language change too. r? `@joshtriplett` cc `@Mark-Simulacrum` `@hsivonen`
2020-11-13Reserve space in advanceDániel Buga-5/+5
2020-11-13Allocate less in lower_block_noallocDániel Buga-20/+21
2020-11-12Auto merge of #78782 - petrochenkov:nodoctok, r=Aaron1011bors-7/+10
Do not collect tokens for doc comments Doc comment is a single token and AST has all the information to re-create it precisely. Doc comments are also responsible for majority of calls to `collect_tokens` (with `num_calls == 1` and `num_calls == 0`, cc https://github.com/rust-lang/rust/pull/78736). (I also moved token collection into `fn parse_attribute` to deduplicate code a bit.) r? `@Aaron1011`
2020-11-09Do not collect tokens for doc commentsVadim Petrochenkov-7/+10
2020-11-07Allow making `RUSTC_BOOTSTRAP` conditional on the crate nameJoshua Nelson-3/+1
The main change is that `UnstableOptions::from_environment` now requires an (optional) crate name. If the crate name is unknown (`None`), then the new feature is not available and you still have to use `RUSTC_BOOTSTRAP=1`. In practice this means the feature is only available for `--crate-name`, not for `#![crate_name]`; I'm interested in supporting the second but I'm not sure how. Other major changes: - Added `Session::is_nightly_build()`, which uses the `crate_name` of the session - Added `nightly_options::match_is_nightly_build`, a convenience method for looking up `--crate-name` from CLI arguments. `Session::is_nightly_build()`should be preferred where possible, since it will take into account `#![crate_name]` (I think). - Added `unstable_features` to `rustdoc::RenderOptions` There is a user-facing change here: things like `RUSTC_BOOTSTRAP=0` no longer active nightly features. In practice this shouldn't be a big deal, since `RUSTC_BOOTSTRAP` is the opposite of stable and everyone uses `RUSTC_BOOTSTRAP=1` anyway. - Add tests Check against `Cheat`, not whether nightly features are allowed. Nightly features are always allowed on the nightly channel. - Only call `is_nightly_build()` once within a function - Use booleans consistently for rustc_incremental Sessions can't be passed through threads, so `read_file` couldn't take a session. To be consistent, also take a boolean in `write_file_header`.
2020-11-07Implement destructuring assignment for tuplesFabian Zaiser-1/+16
Co-authored-by: varkor <github@varkor.com>
2020-10-30Fix some more clippy warningsJoshua Nelson-4/+1
2020-10-29Fix typosDániel Buga-3/+3
2020-10-25Auto merge of #77546 - lcnr:impl-trait-closure, r=eddybbors-5/+15
fix def collector for impl trait fixes #77329 We now consistently make `impl Trait` a hir owner, requiring some special casing for synthetic generic params. r? `@eddyb`
2020-10-21Unconditionally capture tokens for attributes.Aaron Hill-2/+3
This allows us to avoid synthesizing tokens in `prepend_attr`, since we have the original tokens available. We still need to synthesize tokens when expanding `cfg_attr`, but this is an unavoidable consequence of the syntax of `cfg_attr` - the user does not supply the `#` and `[]` tokens that a `cfg_attr` expands to.
2020-10-07implement nitsBastian Kauschke-1/+1
2020-10-07split SyntheticTyParamKindBastian Kauschke-1/+1
2020-10-07bodgeBastian Kauschke-7/+12
2020-10-07do not lower patterns in impl TraitBastian Kauschke-0/+5
2020-09-10Attach tokens to `NtMeta` (`ast::AttrItem`)Aaron Hill-0/+1
An `AttrItem` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Attach `TokenStream` to `ast::Ty`Aaron Hill-0/+1
A `Ty` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-08-30mv compiler to compiler/mark-0/+2737