summary refs log tree commit diff
path: root/src/libsyntax_pos/hygiene.rs
AgeCommit message (Collapse)AuthorLines
2019-08-02Replace "existential" by "opaque"varkor-3/+3
2019-07-27Remove run-pass test suitesVadim Petrochenkov-1/+1
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-1/+1
2019-07-19hygiene: Tweak naming some moreVadim Petrochenkov-48/+49
2019-07-19Adjust other names after the `Mark` renamingVadim Petrochenkov-103/+107
2019-07-19libsyntax: Remove `Mark` into `ExpnId`Vadim Petrochenkov-50/+50
2019-07-11hygiene: Make sure each `Mark` has an associated expansion infoVadim Petrochenkov-3/+17
The root expansion was missing one. Expansions created for "derive containers" (see one of the next commits for the description) also didn't get expansion info.
2019-07-11hygiene: Fix wording of desugaring descriptionsVadim Petrochenkov-8/+9
Use variant names rather than descriptions for identifying desugarings in `#[rustc_on_unimplemented]`. Both are highly unstable, but variant name is at least a single identifier.
2019-07-11hygiene: Introduce a helper method for creating new expansionsVadim Petrochenkov-35/+24
Creating a fresh expansion and immediately generating a span from it is the most common scenario. Also avoid allocating `allow_internal_unstable` lists for derive markers repeatedly. And rename `ExpnInfo::with_unstable` to `ExpnInfo::allow_unstable`, seems to be a better fitting name.
2019-07-11expand: Do not overwrite existing `ExpnInfo` when injecting derive markersVadim Petrochenkov-1/+5
Create a fresh expansion for them instead - this is the usual way to allow unstable features for generated/desugared code. Fixes https://github.com/rust-lang/rust/issues/52363
2019-07-11hygiene: Reuse `MacroKind` in `ExpnKind`Vadim Petrochenkov-18/+16
Orthogonality and reuse are good.
2019-07-11hygiene: Remove some unused implsVadim Petrochenkov-7/+7
2019-07-11syntax: Make def-site span mandatory in ↵Vadim Petrochenkov-6/+4
ExpnInfo/MacroBacktrace/DiagnosticSpanMacroExpansion We have to deal with dummy spans anyway Remove def-site span from expander interfaces. It's not used by the expansion infra, only by specific expanders, which can keep it themselves if they want it.
2019-07-11hygiene: Remove some dead codeVadim Petrochenkov-27/+1
2019-07-11Rename some things in `syntax_pos/hygiene`Vadim Petrochenkov-22/+22
More consistent with other naming: ExpnFormat -> ExpnKind ExpnKind::name -> ExpnKind::descr DesugaringKind::name -> DesugaringKind::descr Shorter, no tautology: CompilerDesugaring -> Desugaring CompilerDesugaringKind -> DesugaringKind
2019-07-11Move `MacroKind` into `libsyntax_pos`Vadim Petrochenkov-0/+28
So it can be eventually used in `ExpnInfo`
2019-07-09Resolve `$crate` in all hygienic contexts for pretty-pringingVadim Petrochenkov-12/+18
Stop visiting AST to discover those contexts, just iterate through hygiene data instead
2019-07-06Enforce 'cond: bool' in while-expr + improve reachability diags.Mazdak Farrokhzad-2/+3
2019-06-18hygiene: Avoid some unnecessary `ExpnInfo` clonesVadim Petrochenkov-5/+5
2019-06-18syntax: Move `default_transparency` into `ExpnInfo`Vadim Petrochenkov-25/+17
2019-06-18syntax: Introduce `default`/`with_unstable` constructors for `ExpnInfo`Vadim Petrochenkov-0/+23
2019-06-05Addressed points raised in review.Alexander Regueiro-2/+2
2019-06-05Add `modernize_and_adjust` methods.Nicholas Nethercote-0/+8
These combine two `HygieneData::with` calls into one.
2019-06-05Add a useful comment about this file.Nicholas Nethercote-0/+20
2019-06-05Add `walk_chain`.Nicholas Nethercote-0/+15
This combines multiple `HygieneData::with` calls on a hot path.
2019-06-05Add `SyntaxContext::hygienic_eq`.Nicholas Nethercote-0/+8
This combines multiple `HygieneData::with` calls into one, by combining parts of `hygienic_eq` and `adjust_ident`.
2019-06-05Add and use `SyntaxContext::outer_and_expn_info`.Nicholas Nethercote-0/+10
This combines two `HygieneData::with` calls into one on a hot path.
2019-06-05Optimize `glob_adjust` and `reverse_glob_adjust`.Nicholas Nethercote-23/+27
They can each now do a single `HygieneData::with` call by replacing the `SyntaxContext` and `Mark` methods with the equivalent methods from `HygieneData`.
2019-06-05Add `HygieneData::apply_mark`.Nicholas Nethercote-4/+6
This combines two `HygieneData::with` calls into one.
2019-06-05Add `HygieneData::apply_mark_with_transparency`.Nicholas Nethercote-35/+35
Also remove `HygieneData::apply_mark_internal`, which is no longer needed.
2019-06-05Add `HygieneData::apply_mark_internal`.Nicholas Nethercote-55/+58
2019-06-05Add `HygieneData::marks`.Nicholas Nethercote-13/+15
2019-06-05Add `HygieneData::adjust`.Nicholas Nethercote-5/+9
2019-06-05Add `HygieneData::remove_mark`.Nicholas Nethercote-5/+7
2019-06-05Add `HygieneData::default_transparency`.Nicholas Nethercote-2/+6
Also use `HygieneData::expn_info` in an appropriate place.
2019-06-05Add some useful methods to `HygieneData`.Nicholas Nethercote-10/+28
2019-06-05Move `modern` calls inside `glob_adjust` and `reverse_glob_adjust`.Nicholas Nethercote-3/+4
2019-05-30Add `HygieneData::{outer,expn_info,is_descendant_of}` methods.Nicholas Nethercote-26/+24
This commit factors out some repeated code.
2019-05-29Introduce and use `SyntaxContext::outer_expn_info()`.Nicholas Nethercote-0/+10
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-29Introduce and use `Mark::outer_is_descendant_of()`.Nicholas Nethercote-3/+18
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-7/+7
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-11/+1
2019-05-10Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match.Mazdak Farrokhzad-0/+5
2019-05-07Implement built-in await syntaxTaylor Cramer-0/+2
Adds support for .await under the existing async_await feature gate. Moves macro-like await! syntax to the await_macro feature gate. Removes support for `await` as a non-keyword under the `async_await` feature.
2019-04-22Promote rust comments to rustdocAlexey Shmalko-3/+3
2019-04-05Increase `Span` from 4 bytes to 8 bytes.Nicholas Nethercote-0/+3
This increases the size of some important types, such as `ast::Expr` and `mir::Statement`. However, it drastically reduces how much the interner is used, and the fields are more natural sizes that don't require bit operations to extract. As a result, instruction counts drop across a range of workloads, by as much as 12% for incremental "check" builds of `script-servo`. Peak memory usage goes up a little for some cases, but down by more for some other cases -- as much as 18% for non-incremental builds of `packed-simd`. The commit also: - removes the `repr(packed)`, because it has negligible effect, but can cause undefined behaviour; - replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.) with derived ones.
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-2/+2
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11Parallel rustc needs synchronizing smart pointer cloningOliver Scherer-2/+2
2019-02-11Use `Rc<[Symbol]>` instead of `Vec<Symbol>` to reduce # of allocsOliver Scherer-1/+2
2019-02-11Require a list of features to allow in `allow_internal_unstable`Oliver Scherer-3/+3