about summary refs log tree commit diff
path: root/src/librustc_ast/util
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1180/+0
2020-08-19Move doc comment parsing to rustc_lexerAleksey Kladov-51/+4
Plain comments are trivial, while doc comments are not, so it feels like this belongs to the rustc_lexer. The specific reason to do this is the desire to use rustc_lexer in rustdoc for syntax highlighting, without duplicating "is this a doc comment?" logic there.
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-08-13Rollup merge of #74650 - estebank:ambiguous-expr-binop, r=eddybTyler Mandry-1/+0
Correctly parse `{} && false` in tail expression Fix #74233, fix #54186.
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-2/+2
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-08-06rustc_expand: Don not beautify doc comments before passing them to macrosVadim Petrochenkov-23/+20
Beautify all doc strings in rustdoc instead, including those in `#[doc]` attributes
2020-08-06rustc_ast/comments: Modernize some enum reexportsVadim Petrochenkov-8/+10
2020-08-06rustc_ast: Stop using "string typing" for doc comment tokensVadim Petrochenkov-81/+68
Explicitly store their kind and style retrieved during lexing in the token
2020-07-22Correctly parse `{} && false` in tail expressionEsteban Küber-1/+0
Fix #74233.
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-36/+54
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-09Eliminate confusing "globals" terminology.Nicholas Nethercote-2/+2
There are some structures that are called "globals", but are they global to a compilation session, and not truly global. I have always found this highly confusing, so this commit renames them as "session globals" and adds a comment explaining things. Also, the commit fixes an unnecessary nesting of `set()` calls `src/librustc_errors/json/tests.rs`
2020-07-01Remove `token::FlattenGroup`Vadim Petrochenkov-1/+1
2020-06-26Rollup merge of #73629 - flip1995:assoc_op_copy_clone, r=ManishearthManish Goregaokar-1/+1
Make AssocOp Copy Found that this enum is not `Copy` while reviewing this Clippy PR: https://github.com/rust-lang/rust-clippy/pull/5727#discussion_r443761621 There shouldn't be a reason why this should not be `Copy`.
2020-06-26proc_macro: Stop flattening groups with dummy spansVadim Petrochenkov-1/+1
2020-06-22Make AssocOp Copyflip1995-1/+1
2020-06-10Track span of function in method calls, and use this in #[track_caller]Aaron Hill-1/+1
Fixes #69977 When we parse a chain of method calls like `foo.a().b().c()`, each `MethodCallExpr` gets assigned a span that starts at the beginning of the call chain (`foo`). While this is useful for diagnostics, it means that `Location::caller` will return the same location for every call in a call chain. This PR makes us separately record the span of the function name and arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This `Span` is passed through HIR lowering and MIR building to `TerminatorKind::Call`, where it is used in preference to `Terminator.source_info.span` when determining `Location::caller`. This new span is also useful for diagnostics where we want to emphasize a particular method call - for an example, see https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
2020-05-13Replace some usages of the old `unescape_` functions in AST, clippy and tests.Julian Wollersberger-33/+42
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-2/+2
2020-04-18Move `MapInPlace` to rustc_data_structuresYuki Okushi-110/+0
2020-04-05Stop importing int/float modules in librustc_*Linus Färnstrand-1/+0
2020-03-20can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.Mazdak Farrokhzad-1/+1
2020-03-09Use `Token::uninterpolate` in couple more places matching on `(Nt)Ident`Vadim Petrochenkov-11/+4
2020-02-29Move directory `libsyntax` -> `librustc_ast`Vadim Petrochenkov-0/+1333