about summary refs log tree commit diff
path: root/src/libsyntax_pos/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-23Rollup merge of #57020 - estebank:return-span, r=zackmdavisMazdak Farrokhzad-0/+7
Point to cause of `fn` expected return type Fix #48136.
2018-12-20Point at coercion source on type errors for fn returning `impl Trait`Esteban Küber-0/+7
2018-12-12Use a `newtype_index!` within `Symbol`.Nicholas Nethercote-0/+3
This shrinks `Option<Symbol>` from 8 bytes to 4 bytes, which shrinks `Token` from 24 bytes to 16 bytes. This reduces instruction counts by up to 1% across a range of benchmarks.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-81/+81
2018-12-06Fix printing of spans with no TyCtxtJohn Kåre Alsaker-1/+1
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-2/+10
fixes remaining test failures
2018-12-04updates all Filename variants to take a fingerprintMatthew Russo-24/+61
2018-11-29Add inline attributes and add unit to CommonTypesJohn Kåre Alsaker-0/+1
2018-11-27resolve: Implement edition hygiene for imports and absolute pathsVadim Petrochenkov-0/+10
Use per-span hygiene in a few other places in resolve Prefer `rust_2015`/`rust_2018` helpers to comparing editions
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-5/+5
2018-10-23Add macro call span when lacking any other span in diagnosticEsteban Küber-0/+11
2018-09-30Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrumbors-2/+2
Bump to 1.31.0 and bootstrap from 1.30 beta Closes #54594.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-2/+2
2018-09-19Use full name to identify a macro in a `FileName`.Diogo Sousa-1/+1
Before this two macros with same name would be indistinguishable inside a `FileName`. This caused a bug in incremental compilation (see #53097) since two different macros would map out to the same `StableFilemapId`. Fixes #53097.
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-19mv codemap source_mapDonato Sciarra-2/+2
2018-08-19mv filemap source_fileDonato Sciarra-3/+3
2018-08-19mv FileMap SourceFileDonato Sciarra-26/+26
2018-08-19mv CodeMap SourceMapDonato Sciarra-7/+7
2018-08-09[nll] libsyntax_pos: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-07-28Auto merge of #52355 - pietroalbini:zfeature, r=eddybbors-0/+5
Add the -Zcrate-attr=foo unstable rustc option This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code. The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable. cc https://github.com/rust-lang-nursery/crater/issues/282 @Mark-Simulacrum
2018-07-28Rollup merge of #52703 - ljedrz:vec_improvements, r=nikomatsakiskennytm-5/+4
Improve a few vectors - calculate capacity or build from iterators Collecting from iterators improves readability and tailoring vector capacities should be beneficial in terms of performance.
2018-07-27Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributesPietro Albini-0/+5
2018-07-26Improve a few vectors - calculate capacity or build from iteratorsljedrz-5/+4
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-12Deny bare trait objects in the rest of rustljedrz-0/+2
2018-07-08libsyntax_pos: Tweak some visibilitiesVadim Petrochenkov-1/+1
2018-06-30Fortify dummy span checkingVadim Petrochenkov-1/+8
2018-06-30hygiene: Implement transparent marksVadim Petrochenkov-0/+6
2018-06-28Fix FileMap::line_begin_pos().Michael Woerister-5/+3
The method relied on the FileMap still being under construction in order for it to do what the name promises. It's now independent of the current state.
2018-06-27syntax_pos: Store multibyte char size as u8 instead of u32.Michael Woerister-1/+1
2018-06-27Add SSE2 accelerated version of FileMap analysis.Michael Woerister-68/+9
2018-06-27Use u32 instead of usize of encoding byte count of multi-byte chars.Michael Woerister-3/+17
2018-06-27Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.Michael Woerister-70/+88
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-2/+2
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-23hygiene: Merge `NameAndSpan` into `ExpnInfo`Vadim Petrochenkov-21/+18
2018-05-18Auto merge of #50307 - petrochenkov:keyhyg2, r=nikomatsakisbors-0/+8
Implement edition hygiene for keywords Determine "keywordness" of an identifier in its hygienic context. cc https://github.com/rust-lang/rust/pull/49611 I've resurrected `proc` as an Edition-2015-only keyword for testing purposes, but it should probably be buried again. EDIT: `proc` is removed again.
2018-05-18Auto merge of #50847 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-0/+7
Rollup of 10 pull requests Successful merges: - #50387 (Remove leftover tab in libtest outputs) - #50553 (Add Option::xor method) - #50610 (Improve format string errors) - #50649 (Tweak `nearest_common_ancestor()`.) - #50790 (Fix grammar documentation wrt Unicode identifiers) - #50791 (Fix null exclusions in grammar docs) - #50806 (Add `bless` x.py subcommand for easy ui test replacement) - #50818 (Speed up `opt_normalize_projection_type`) - #50837 (Revert #49767) - #50839 (Make sure people know the book is free oline) Failed merges:
2018-05-17Turn some functions from `token.rs` into methods on `Ident`Vadim Petrochenkov-0/+6
2018-05-17Move definition of `Edition` from libsyntax to libsyntax_posVadim Petrochenkov-0/+2
2018-05-17Rollup merge of #50610 - estebank:fmt-str, r=KimundiMark Simulacrum-0/+7
Improve format string errors Point at format string position inside the formatting string: ``` error: invalid format string: unmatched `}` found --> $DIR/format-string-error.rs:21:22 | LL | let _ = format!("}"); | ^ unmatched `}` in format string ``` Explain that argument names can't start with an underscore: ``` error: invalid format string: invalid argument name `_foo` --> $DIR/format-string-error.rs:15:23 | LL | let _ = format!("{_foo}", _foo = 6usize); | ^^^^ invalid argument name in format string | = note: argument names cannot start with an underscore ``` Fix #23476. The more accurate spans will only be seen when using `format!` directly, when using `println!` the diagnostics machinery makes the span be the entire statement.
2018-05-14Remove `StringReader::col`.Nicholas Nethercote-0/+9
It only has a single use, within code handling indented block comments. We can replace that with the new `FileMap::col_pos()`, which computes the col position (BytePos instead of CharPos) based on the record of the last newline char (which we already record). This is actually an improvement, because `trim_whitespace_prefix_and_push_line()` was using `col`, which is a `CharPos`, as a slice index, which is a byte/char confusion.
2018-05-13Inline `char_at()` and `record_width`.Nicholas Nethercote-0/+1
Because `bump()` is hot.
2018-05-10Improve format string errorsEsteban Küber-0/+7
- Point at format string position inside the formatting string - Explain that argument names can't start with an underscore
2018-05-10Allocate Symbol strings from an arenaJohn Kåre Alsaker-0/+1
2018-05-03Always inline simple BytePos and CharPos methods.Nicholas Nethercote-0/+10
Because they are (a) trivial, and (b) super hot. This change speeds up most rustc-benchmarks, the best by 5%.
2018-04-26Fix review nitsbobtwinkles-1/+1
2018-04-23Implement parent() on `syntax_pos::Span`bobtwinkles-0/+6
... and reimplement proc_macro::Span::parent using it. This function turns out to be useful in the compiler as well