about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-04-14Auto merge of #59693 - nnethercote:64-bit-Spans, r=petrochenkovbors-1/+1
Increase `Span` from 4 bytes to 8 bytes. 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 10% for `script-servo` incremental builds. 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. r? @petrochenkov
2019-04-14Rollup merge of #59858 - mark-i-m:dup-matcher-bindings-3, r=CentrilMazdak Farrokhzad-14/+4
Make duplicate matcher bindings a hard error r? @Centril Closes #57742
2019-04-14Rollup merge of #59735 - matklad:deadcode, r=sanxiynMazdak Farrokhzad-15/+5
remove lookup_char_pos_adj It is now exactly equivalent to lookup_char_pos.
2019-04-12Rollup merge of #59866 - estebank:recover-missing-semi, r=petrochenkovMazdak Farrokhzad-0/+26
Recover from missing semicolon based on the found token When encountering one of a few keywords when a semicolon was expected, suggest the semicolon and recover: ``` error: expected one of `.`, `;`, `?`, or an operator, found `let` --> $DIR/recover-missing-semi.rs:4:5 | LL | let _: usize = () | - help: missing semicolon here LL | LL | let _ = 3; | ^^^ error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 | LL | let _: usize = () | ^^ expected usize, found () | = note: expected type `usize` found type `()` ```
2019-04-12Rollup merge of #59862 - estebank:tweak-unstable-diag, r=petrochenkovMazdak Farrokhzad-36/+55
Tweak unstable diagnostic output
2019-04-12Rollup merge of #59847 - Kampfkarren:try-block-catch, r=estebankMazdak Farrokhzad-1/+9
Error when using `catch` after `try` Part of https://github.com/rust-lang/rust/issues/31436
2019-04-11Auto merge of #59227 - Zoxc:fix-get, r=eddybbors-10/+12
Fix lifetime on LocalInternedString::get function cc @eddyb @nnethercote
2019-04-11review commentsEsteban Küber-16/+15
2019-04-11Reword tracking issue noteEsteban Küber-2/+5
2019-04-10make duplicate matcher bindings a hard errorMark Mansi-14/+4
2019-04-10FeedbackKampfkarren-1/+2
2019-04-10Tweak unstable diagnostic outputEsteban Küber-36/+52
2019-04-10Recover from missing semicolon based on the found tokenEsteban Küber-0/+27
When encountering one of a few keywords when a semicolon was expected, suggest the semicolon and recover: ``` error: expected one of `.`, `;`, `?`, or an operator, found `let` --> $DIR/recover-missing-semi.rs:4:5 | LL | let _: usize = () | - help: missing semicolon here LL | LL | let _ = 3; | ^^^ error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 | LL | let _: usize = () | ^^ expected usize, found () | = note: expected type `usize` found type `()` ```
2019-04-10Adhere to tidy scriptKampfkarren-1/+2
2019-04-10Special error when using catch after tryKampfkarren-1/+7
2019-04-05remove lookup_char_pos_adjAleksey Kladov-15/+5
It is now exactly equivalent to lookup_char_pos.
2019-04-05Rollup merge of #59687 - matklad:shebang, r=petrochenkovMazdak Farrokhzad-11/+5
cleanup shebang handling in the lexer
2019-04-05Increase `Span` from 4 bytes to 8 bytes.Nicholas Nethercote-1/+1
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-04-04Rollup merge of #59671 - matklad:lexer, r=eddybMazdak Farrokhzad-8/+8
Make some of lexer's API private Lexer is a `pub` type, so it feels wrong that its fields are just pub (I guess it wasn't exported initially), so let's minimize visibility. Context: I am looking into extracting rust-lexer into a library, which can be shared by rust-analyzer and rustc. I hope that a simple interface like `fn next_token(src: &str) -> (TokenKind, usize)` would work, but to try this out I need to understand what is the current API of the lexer.
2019-04-04cleanup shebang handling in the lexerAleksey Kladov-11/+5
2019-04-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
2019-04-03make StringReader methods privateAleksey Kladov-2/+2
2019-04-03make StringReader fields privateAleksey Kladov-6/+6
2019-04-01Rollup merge of #59041 - saleemjaffer:trait_doc_comment_better_error_msg, ↵Mazdak Farrokhzad-0/+16
r=pnkfelix fixes rust-lang#56766 fixes #56766
2019-03-31Auto merge of #59507 - nnethercote:indent-with-SPACES, r=petrochenkovbors-3/+19
Optimize indentation in the pretty printer. Currently the pretty-printer calls `write!` for every space of indentation. On some workloads the indentation level can exceed 100, and a faster implementation reduces instruction counts by up to 7% on a few workloads.
2019-04-01Optimize indentation in the pretty printer.Nicholas Nethercote-3/+19
Currently the pretty-printer calls `write!` for every space of indentation. On some workloads the indentation level can exceed 100, and a faster implementation reduces instruction counts by up to 7% on a few workloads.
2019-03-31Convert symbols to strings for pretty printingJohn Kåre Alsaker-14/+11
2019-03-31Fix lifetime on LocalInternedString::get functionJohn Kåre Alsaker-7/+12
2019-03-30Rollup merge of #59525 - pnkfelix:whitelist-some-rustc-attrs, r=petrochenkovMazdak Farrokhzad-1/+15
Whitelist some rustc attrs These rustc attrs are used within libcore, and were causing failures when one mixed incremental compilation with bootstrapping (due to a default of `-D warnings` when bootstrapping). Fix #59523 Fix #59524 Cc #58633
2019-03-30Rollup merge of #59453 - estebank:recover-tuple-parse, r=petrochenkovMazdak Farrokhzad-26/+57
Recover from parse error in tuple syntax
2019-03-29Whitelist rustc_layout_scalar_valid_range_{start,end} so incr comp does not ↵Felix S. Klock II-0/+14
flag them as unused.
2019-03-29Whitelist `rustc_on_unimplemented` to avoid erroneous flagging as an unused ↵Felix S. Klock II-1/+1
attribute.
2019-03-29Rollup merge of #59510 - varkor:rename-type_parameters, r=eddybMazdak Farrokhzad-9/+9
Rename `type_parameters` to `generics` and so on Some old variable names had fallen through the generics generalisation pull requests.
2019-03-29Rollup merge of #59473 - estebank:borrow-sugg-inside-macro, r=davidtwcoMazdak Farrokhzad-0/+60
Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans Fix #58298.
2019-03-28Deduplicate parse recovery codeEsteban Küber-35/+43
2019-03-29Rollup merge of #59476 - nnethercote:TokenStreamBuilder-SmallVec, r=petrochenkovMazdak Farrokhzad-7/+10
Use `SmallVec` in `TokenStreamBuilder`. This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%. r? @petrochenkov
2019-03-29Rollup merge of #59423 - varkor:walk_mac-visit_path, r=petrochenkovMazdak Farrokhzad-2/+2
Visit path in `walk_mac` Fixes https://github.com/rust-lang/rust/issues/54110.
2019-03-29Rename `type_parameters` to `generics` and so onvarkor-9/+9
2019-03-29Use `SmallVec` in `TokenStreamBuilder`.Nicholas Nethercote-7/+10
This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%. It also reduces instruction counts by up to 1.4% across a range of rustc-perf benchmark runs.
2019-03-28Recover from parse error in tuple syntaxEsteban Küber-8/+31
2019-03-28Rollup merge of #59198 - estebank:recovered-pattern, r=zackmdavisMazdak Farrokhzad-1/+1
Do not complain about unmentioned fields in recovered patterns When the parser has to recover from malformed code in a pattern, do not complain about missing fields. Fix #59145.
2019-03-27Account for fully overlapping multiline annotationsEsteban Küber-0/+60
When two multiline span labels point at the same span, we special case the output to avoid weird behavior: ``` foo( _____^ |_____| || bar, || ); || ^ ||______| |______foo baz ``` instead showing ``` foo( _____^ | bar, | ); | ^ | | |______foo baz ```
2019-03-27Rollup merge of #59421 - estebank:tuple-index-suffix, r=petrochenkovJosh Stone-50/+52
Reject integer suffix when tuple indexing Fix #59418. r? @varkor
2019-03-27Rollup merge of #57565 - petrochenkov:turbowarn, r=CentrilJosh Stone-22/+11
syntax: Remove warning for unnecessary path disambiguators `rustfmt` is now stable and it removes unnecessary turbofishes, so removing the warning as discussed in https://github.com/rust-lang/rust/pull/43540 (where it was introduced). One hardcoded warning less. Closes https://github.com/rust-lang/rust/issues/58055 r? @nikomatsakis
2019-03-27Visit path in `walk_mac`varkor-2/+2
2019-03-26Add specific message for tuple struct invoked with suffixed numeric field nameEsteban Küber-1/+2
2019-03-26Reword invalid suffixe errorsEsteban Küber-7/+6
2019-03-26Use `expect_no_suffix` for errorEsteban Küber-8/+1
2019-03-26Rollup merge of #59150 - estebank:type-ascription, r=varkorMazdak Farrokhzad-15/+68
Expand suggestions for type ascription parse errors Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-25review commentsEsteban Küber-1/+1