summary refs log tree commit diff
path: root/src/libsyntax_pos
AgeCommit message (Collapse)AuthorLines
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-2/+10
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-18Auto merge of #48917 - petrochenkov:import, r=oli-obkbors-2/+9
syntax: Make imports in AST closer to the source and cleanup their parsing This is a continuation of https://github.com/rust-lang/rust/pull/45846 in some sense.
2018-03-17Make Span and Symbol implement Send and SyncJohn Kåre Alsaker-2/+10
2018-03-17Rename `Span::empty` to `Span::shrink_to_lo`, add `Span::shrink_to_hi`Vadim Petrochenkov-2/+9
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-61/+65
2018-03-15Make FileMap thread-safeJohn Kåre Alsaker-30/+37
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-24/+41
2018-03-08Don't derive traits on packed structsOliver Schneider-1/+22
2018-03-05while let all the thingsleonardo.yvens-6/+1
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-8/+8
2018-02-28Rollup merge of #48359 - jsgf:remap-path-prefix, r=sanxiynManish Goregaokar-1/+1
Fixes #47311. r? @nrc
2018-02-22Implement --remap-path-prefixJeremy Fitzhardinge-1/+1
Remove experimental -Zremap-path-prefix-from/to, and replace it with the stabilized --remap-path-prefix=from=to variant. This is an implementation for issue of #41555.
2018-02-18Fix up tests and typosSeiichi Uchida-1/+1
2018-02-18Replace dummy spans with empty spansSeiichi Uchida-0/+6
2018-02-02Rollup merge of #47942 - estebank:macro-spans, r=nikomatsakis Minimize weird ↵kennytm-6/+17
spans involving macro context Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without merging them. Fix #32072, #47778. CC #23480.
2018-02-01Minimize weird spans involving macro contextEsteban Küber-6/+17
Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without mergin them.
2018-01-27end_point handling multibyte characters correctly.David Wood-16/+0
2018-01-27Moved overflow check into end_point function.David Wood-1/+3
2018-01-12Auto merge of #46551 - jseyfried:improve_legacy_modern_macro_interaction, r=nrcbors-0/+39
macros: improve 1.0/2.0 interaction This PR supports using unhygienic macros from hygienic macros without breaking the latter's hygiene. ```rust // crate A: #[macro_export] macro_rules! m1 { () => { f(); // unhygienic: this macro needs `f` in its environment fn g() {} // (1) unhygienic: `g` is usable outside the macro definition } } // crate B: #![feature(decl_macro)] extern crate A; use A::m1; macro m2() { fn f() {} // (2) m1!(); // After this PR, `f()` in the expansion resolves to (2), not (3) g(); // After this PR, this resolves to `fn g() {}` from the above expansion. // Today, it is a resolution error. } fn test() { fn f() {} // (3) m2!(); // Today, `m2!()` can see (3) even though it should be hygienic. fn g() {} // Today, this conflicts with `fn g() {}` from the expansion, even though it should be hygienic. } ``` Once this PR lands, you can make an existing unhygienic macro hygienic by wrapping it in a hygienic macro. There is an [example](https://github.com/rust-lang/rust/pull/46551/commits/b766fa887dc0e4b923a38751fe4d570e35a75710) of this in the tests. r? @nrc
2018-01-01Fix docs for future pulldown migrationMalo Jaffré-4/+7
2017-12-19incr.comp.: Precompute small hash for filenames to save some work.Michael Woerister-5/+21
2017-12-15incr.comp.: Revert hashing optimization that caused regression.Michael Woerister-33/+0
2017-12-14incr.comp.: Do less hashing per Span.Michael Woerister-12/+44
2017-12-14incr.comp.: Speed up span hashing by caching expansion context hashes.Michael Woerister-0/+9
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-10/+80
2017-12-13Improve interaction between macros 2.0 and `macro_rules!`.Jeffrey Seyfried-0/+39
2017-12-12Refactor `MarkData` field `modern: bool` to `kind: MarkKind`.Jeffrey Seyfried-14/+28
2017-12-07Auto merge of #46497 - AgustinCB:issue-46311, r=petrochenkovbors-0/+10
Modify message for keyword as identifier name This is a temporary solution to #46311. The message is generic enough to cover both cases and is probably a fine enough solution to the specific problem described in the task. However, the underlying reason for this to be wrong is that `next_token_inner` returns `Lifetime` even if the token is a label. That's not simple, as the syntax for both can be quite similar and it may need to take a look to the next token to make a decision. I'm not sure I have enough knowledge about the project to be able to solve that (yet!), so I thought I'll fix the immediate problem first.
2017-12-07don't print self symbol's internal index unless gensymedNiko Matsakis-1/+10
It's just not useful. It also makes it hard to have tests that probe internal state, since the interning number is very sensitive. Dumping the number in the case of gensym is not ideal but will do for now.
2017-12-07remove unused testAgustin Chiappe Berrini-20/+0
2017-12-07remove unnecessary functionAgustin Chiappe Berrini-5/+1
2017-12-07address commentsAgustin Chiappe Berrini-18/+0
2017-12-06Auto merge of #45953 - estebank:tab-4, r=nikomatsakisbors-3/+12
Display `\t` in diagnostics code as four spaces Follow up to #44386 using the unicode variable width machinery from #45711 to replace tabs in the source code when displaying a diagnostic error with four spaces (instead of only one), while properly accounting for this when calculating underlines. Partly addresses #44618.
2017-12-06and refactor to just move the checkingAgustin Chiappe Berrini-0/+52
2017-12-01incr.comp.: Store Spans as (file,line,col,length) in incr.comp. cache.Michael Woerister-0/+5
The previous method ran into problems because ICH would treat Spans as (file,line,col) but the cache contained byte offsets and its possible for the latter to change while the former stayed stable.
2017-12-01incr.comp.: Properly hash and encode macro expansion information.Michael Woerister-4/+29
2017-11-24Display `\t` in diagnostics code as four spacesEsteban Küber-3/+12
2017-11-13Fix style in interner testJohn-John Tedro-1/+1
2017-11-06Auto merge of #45758 - nzig:explain-span-ctxt, r=petrochenkovbors-3/+5
Add comment explaining the ctxt field in Span As discussed in #45747. r? @petrochenkov
2017-11-05Fix comment formattingNadav Zingerman-2/+2
2017-11-04Auto merge of #45711 - tirr-c:unicode-span, r=estebankbors-4/+92
Display spans correctly when there are zero-width or wide characters Hopefully... * fixes #45211 * fixes #8706 --- Before: ``` error: invalid width `7` for integer literal --> unicode_2.rs:12:25 | 12 | let _ = ("a̐éö̲", 0u7); | ^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: invalid width `42` for integer literal --> unicode_2.rs:13:20 | 13 | let _ = ("아あ", 1i42); | ^^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: aborting due to 2 previous errors ``` After: ``` error: invalid width `7` for integer literal --> unicode_2.rs:12:25 | 12 | let _ = ("a̐éö̲", 0u7); | ^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: invalid width `42` for integer literal --> unicode_2.rs:13:20 | 13 | let _ = ("아あ", 1i42); | ^^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: aborting due to 2 previous errors ``` Spans might display incorrectly on the browser. r? @estebank
2017-11-04Add comment explaining the ctxt field in SpanNadav Zingerman-1/+3
2017-11-03add `auto` keyword, parse `auto trait`, lower to HIRleonardo.yvens-5/+6
Adds an `IsAuto` field to `ItemTrait` which flags if the trait was declared as an `auto trait`. Auto traits cannot have generics nor super traits.
2017-11-03Display spans correctly when there are non-half-width charactersWonwoo Choi-4/+92
2017-10-29Optimize some span operationsVadim Petrochenkov-25/+52
Decode span data only once
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-4/+5
2017-10-10Rollup merge of #44775 - MaloJaffre:debug-struct, r=sfacklerkennytm-2/+5
Refactor to use `debug_struct` in several Debug impls Also use `pad` and derive `Debug` for `Edge`. Fixes #44771.
2017-10-09Refactor to use `debug_struct` in several Debug implsMalo Jaffré-2/+5
Fixes #44771.
2017-10-03Rename FileMap::path and change to an OptionPhilip Craig-5/+6