about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/util
AgeCommit message (Collapse)AuthorLines
2021-08-30Handle let-else initializer edge case errorsCameron Steffen-0/+27
2021-07-30Add warning when whitespace is not skipped after an escaped newline.Anton Golov-4/+20
2021-07-08Rework SESSION_GLOBALS API to prevent overwriting itGuillaume Gomez-5/+5
2021-01-16Remove unnecessary manual shrink_to_fit callsDániel Buga-3/+0
2021-01-09ast: Remove some indirection layers from values in key-value attributesVadim Petrochenkov-5/+4
2020-12-28Rollup merge of #80344 - matthiaskrgr:matches, r=Dylan-DPCDylan DPC-13/+11
use matches!() macro in more places
2020-12-24use matches!() macro in more placesMatthias Krüger-13/+11
2020-12-22Rework beautify_doc_string so that it returns a Symbol instead of a StringGuillaume Gomez-35/+37
2020-11-24Move lev_distance to rustc_ast, make non-genericArlie Davis-168/+0
rustc_ast currently has a few dependencies on rustc_lexer. Ideally, an AST would not have any dependency its lexer, for minimizing unnecessarily design-time dependencies. Breaking this dependency would also have practical benefits, since modifying rustc_lexer would not trigger a rebuild of rustc_ast. This commit does not remove the rustc_ast --> rustc_lexer dependency, but it does remove one of the sources of this dependency, which is the code that handles fuzzy matching between symbol names for making suggestions in diagnostics. Since that code depends only on Symbol, it is easy to move it to rustc_span. It might even be best to move it to a separate crate, since other tools such as Cargo use the same algorithm, and have simply contain a duplicate of the code. This changes the signature of find_best_match_for_name so that it is no longer generic over its input. I checked the optimized binaries, and this function was duplicated at nearly every call site, because most call sites used short-lived iterator chains, generic over Map and such. But there's no good reason for a function like this to be generic, since all it does is immediately convert the generic input (the Iterator impl) to a concrete Vec<Symbol>. This has all of the costs of generics (duplicated method bodies) with no benefit. Changing find_best_match_for_name to be non-generic removed about 10KB of code from the optimized binary. I know it's a drop in the bucket, but we have to start reducing binary size, and beginning to tame over-use of generics is part of that.
2020-10-18Auto merge of #78066 - bugadani:wat, r=jonas-schievinkbors-1/+1
Clean up small, surprising bits of code This PR clean up a small number of unrelated, small things I found while browsing the code base.
2020-10-18No need to map the max_distanceDániel Buga-1/+1
2020-10-16Parse inline const expressionsSantiago Pastorino-0/+2
2020-10-14Remove unused code from rustc_astest31-1/+0
2020-10-04Remove extra indirection in LitKind::ByteStrRobin Schoonover-3/+2
2020-09-10use sort_unstable to sort primitive typesMatthias Krüger-1/+2
It's not important to retain original order if we have &[1, 1, 2, 3] for example. clippy::stable_sort_primitive
2020-08-30mv compiler to compiler/mark-0/+1180