summary refs log tree commit diff
path: root/src/libsyntax/source_map.rs
AgeCommit message (Collapse)AuthorLines
2019-06-26Fix clippy::redundant_field_namesIgor Matuszewski-4/+4
2019-06-17don't ICE on large filesAleksey Kladov-3/+16
This is an extremely marginal error, so the cost of properly threading `Handler` everywhere just not seemed justified. However, it's useful to panic when we create a file, and not when we slice strings with overflown indexes somewhere in the guts of the compiler. For this reason, while we provide safe `try_new_source_file`, we don't change the existing public interface and just panic more or less cleanly.
2019-06-03syntax/rustc: move `mark_span_with_reason` back.David Wood-21/+0
2019-05-30Auto merge of #61253 - nnethercote:avoid-hygiene_data-lookups, r=petrochenkovbors-2/+2
Avoid `hygiene_data` lookups These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined. r? @petrochenkov
2019-05-29Introduce and use `SyntaxContext::outer_expn_info()`.Nicholas Nethercote-2/+2
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-29syntax: bail out of `find_width_of_character_at_span` if the span doesn't ↵Eduard-Mihai Burtescu-0/+5
start and end in the same file.
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-1/+1
2019-05-09Do not modify mutability of simple bindings.David Wood-0/+21
This commit removes the modification of the mutability of simple bindings. While the mutability isn't used, it is important that it is kept so that the input to procedural macros matches what the user wrote. This commit also modifies the span of the binding mode so that it is considered a compiler desugaring and won't be linted against for being unused..
2019-04-05remove lookup_char_pos_adjAleksey Kladov-13/+3
It is now exactly equivalent to lookup_char_pos.
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-1/+1
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-9/+9
2019-02-07libsyntax => 2018Taiki Endo-3/+5
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-12Bump to 1.33.0Alex Crichton-4/+4
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-07use top level `fs` functions where appropriateAndy Russell-4/+2
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-29/+13
fixes remaining test failures
2018-12-04updates all Filename variants to take a fingerprintMatthew Russo-3/+3
2018-12-04new_source_file no longer enters duplicate files, expand_include_bytes ↵Matthew Russo-16/+34
includes the source if it can convert bytes to string
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-91/+92
2018-10-20Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasperbors-1/+2
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations The contents of `unwrap_or` are evaluated eagerly, so it's not a good pick in case of function calls and allocations. This PR also changes a few `unwrap_or`s with `unwrap_or_default`. An added bonus is that in some cases this change also reveals if the object it's called on is an `Option` or a `Result` (based on whether the closure takes an argument).
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-8/+3
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-2/+2
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-1/+2
2018-09-09Auto merge of #53949 - estebank:unclosed-delim, r=nikomatsakisbors-11/+21
Improve messages for un-closed delimiter errors
2018-09-05Provide more context for unenclosed delimitersEsteban Küber-11/+21
* When encountering EOF, point at the last opening brace that does not have the same indentation level as its close delimiter. * When encountering the wrong type of close delimiter, point at the likely correct open delimiter to give a better idea of what went wrong.
2018-09-04Breaking change upgradesMark Rousskov-2/+2
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-1/+1
or "".into()
2018-08-19fix tidy errorsDonato Sciarra-2/+4
2018-08-19mv codemap source_mapDonato Sciarra-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-0/+1235