| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.
This PR removes most of the interior mutability from `FileMap`, which should be beneficial, especially in a multithreaded setting. This is achieved by initializing the state in question when the filemap is constructed instead of during lexing. Hopefully this doesn't degrade performance.
cc @wesleywiser
|
|
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.
|
|
|
|
Remove emulation of hygiene with gensyms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These were stabilized in March 2018's #47813, and are the Preferred Way
to Do It going forward (q.v. #51043).
|
|
|
|
|
|
detail and cannot be inspected outside of `hygiene.rs`
|
|
Move `is_builtin` for `Mark` to a separate flag
|
|
|
|
|
|
|
|
Add existential type definitions
Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items.
r? @nikomatsakis
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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:
|
|
Streamline `StringReader::bump`
These patches make `bump` smaller and nicer. They speed up most runs for coercions and tuple-stress by 1--3%.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
https://www.doi.org/doi_handbook/3_Resolution.html#3.8
|
|
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.
|
|
Because `bump()` is hot.
|
|
|
|
Allocate Symbol strings from an arena
This is an alternative to https://github.com/rust-lang/rust/pull/50549
cc @nnethercote
r? @michaelwoerister
|
|
- Point at format string position inside the formatting string
- Explain that argument names can't start with an underscore
|
|
|
|
Because they are simple and hot.
This change speeds up some incremental runs of a few rustc-perf
benchmarks, the best by 3%.
|
|
Because they are (a) trivial, and (b) super hot.
This change speeds up most rustc-benchmarks, the best by 5%.
|
|
Add some utilities to `libsyntax`
Adds a few functions to `Mark` and `Span` that I found useful in an upcoming refactor of NLL region error reporting. Also includes some new documentation based on my discussion with @jseyfried on IRC.
r? @jseyfried
|