about summary refs log tree commit diff
path: root/src/libsyntax_pos
AgeCommit message (Collapse)AuthorLines
2019-06-18hygiene: Avoid some unnecessary `ExpnInfo` clonesVadim Petrochenkov-5/+5
2019-06-18syntax: Move `default_transparency` into `ExpnInfo`Vadim Petrochenkov-25/+17
2019-06-18syntax: Introduce `default`/`with_unstable` constructors for `ExpnInfo`Vadim Petrochenkov-0/+23
2019-06-17don't ICE on large filesAleksey Kladov-3/+9
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-16Auto merge of #60730 - matthewjasper:optimize-false-edges, r=pnkfelixbors-0/+1
Optimize matches Attempt to fix or improve #60571 This is breaking some diagnostics because the MIR for match arms isn't in source order any more. cc @centril
2019-06-15Rollup merge of #61813 - matthewjasper:remove-unnecessary-symbol-ops, ↵Mazdak Farrokhzad-0/+4
r=petrochenkov Remove some unnecessary symbol interner ops * Don't gensym symbols that don't need to worry about colliding with other symbols * Use symbol constants instead of interning string literals in a few places. * Don't generate a module in `__register_diagnostic` r? @petrochenkov
2019-06-14Use `sym` constansts for `PrimitiveTypeTable` keysMatthew Jasper-0/+2
2019-06-14Avoid some unnecessary symbol interner operationsMatthew Jasper-0/+2
2019-06-13Call str::eq and <[T]>::eq for match comparisonsMatthew Jasper-0/+1
We used to call the less efficient `<&str>::eq` and `<&[T]>::eq`.
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-0/+1
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-12Rollup merge of #61568 - Mark-Simulacrum:symbol-fmt-macros, r=estebankMazdak Farrokhzad-3/+21
Use Symbol, Span in libfmt_macros I'm not super happy with this, personally, but I think it might be a decent start -- happy to take suggestions as to how to expand this or change things further. r? @estebank Fixes #60795
2019-06-11Auto merge of #61735 - eddyb:must-use-life, r=oli-obkbors-0/+1
Add deny(unused_lifetimes) to all the crates that have deny(internal). @Zoxc brought up, regarding #61722, that we don't force the removal of unused lifetimes. Turns out that it's not that bad to enable for compiler crates (I wonder why it's not `warn` by default?). I would've liked to enable `single_use_lifetimes` as well, but https://github.com/rust-lang/rust/issues/53738 makes it unusable for now. For the `rustfmt` commit, I used https://github.com/rust-lang/rustfmt/issues/1324#issuecomment-482109952, and manually filtered out some noise. r? @oli-obk cc @rust-lang/compiler
2019-06-11Add deny(unused_lifetimes) to all the crates that have deny(internal).Eduard-Mihai Burtescu-0/+1
2019-06-10Implement RFC 2645 (transparent enums and unions)Michael Bradshaw-0/+2
Tracking issue: #60405
2019-06-09Introduce InnerSpan abstractionMark Rousskov-3/+15
This should be used when trying to get at subsets of a larger span, especially when the larger span is not available in the code attempting to work with those subsets (especially common in the fmt_macros crate). This is usually a good replacement for (BytePos, BytePos) and (usize, usize) tuples. This commit also removes from_inner_byte_pos, since it took usize arguments, which is error prone.
2019-06-09Use Symbol for named arguments in fmt_macrosMark Rousskov-0/+6
2019-06-09Allow attributes in formal function parametersCaio-0/+1
2019-06-08Introduce `#[rustc_dummy]` attribute and use it in testsVadim Petrochenkov-0/+1
Unlike other built-in attributes, this attribute accepts any input
2019-06-08Turn `#[allocator]` into a built-in attribute and rename it to ↵Vadim Petrochenkov-0/+1
`#[rustc_allocator]`
2019-06-08Remove unused `#![feature(custom_attribute)]`sVadim Petrochenkov-1/+0
2019-06-07Auto merge of #61209 - matthewjasper:const-tuple-constructors, r=oli-obkbors-0/+1
Make tuple constructors real const fns Mir construction special cases `Ctor(...)` to be lowered as `Ctor { 0: ... }`, which means this doesn't come up much in practice, but it seems inconsistent not to allow this. r? @oli-obk
2019-06-06Make constructors actually be const functionsMatthew Jasper-0/+1
2019-06-06Some code cleanup and tidy/test fixesVadim Petrochenkov-3/+2
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-13/+17
2019-06-05Fixed rebase fallout.Alexander Regueiro-0/+1
2019-06-05Addressed points raised in review.Alexander Regueiro-2/+2
2019-06-05Add `modernize_and_adjust` methods.Nicholas Nethercote-0/+16
These combine two `HygieneData::with` calls into one.
2019-06-05Add a useful comment about this file.Nicholas Nethercote-0/+20
2019-06-05Add `walk_chain`.Nicholas Nethercote-0/+15
This combines multiple `HygieneData::with` calls on a hot path.
2019-06-05Add `SyntaxContext::hygienic_eq`.Nicholas Nethercote-0/+8
This combines multiple `HygieneData::with` calls into one, by combining parts of `hygienic_eq` and `adjust_ident`.
2019-06-05Add and use `SyntaxContext::outer_and_expn_info`.Nicholas Nethercote-0/+10
This combines two `HygieneData::with` calls into one on a hot path.
2019-06-05Optimize `glob_adjust` and `reverse_glob_adjust`.Nicholas Nethercote-23/+27
They can each now do a single `HygieneData::with` call by replacing the `SyntaxContext` and `Mark` methods with the equivalent methods from `HygieneData`.
2019-06-05Add `HygieneData::apply_mark`.Nicholas Nethercote-4/+6
This combines two `HygieneData::with` calls into one.
2019-06-05Add `HygieneData::apply_mark_with_transparency`.Nicholas Nethercote-35/+35
Also remove `HygieneData::apply_mark_internal`, which is no longer needed.
2019-06-05Add `HygieneData::apply_mark_internal`.Nicholas Nethercote-55/+58
2019-06-05Add `HygieneData::marks`.Nicholas Nethercote-13/+15
2019-06-05Add `HygieneData::adjust`.Nicholas Nethercote-5/+9
2019-06-05Add `HygieneData::remove_mark`.Nicholas Nethercote-5/+7
2019-06-05Add `HygieneData::default_transparency`.Nicholas Nethercote-2/+6
Also use `HygieneData::expn_info` in an appropriate place.
2019-06-05Add some useful methods to `HygieneData`.Nicholas Nethercote-10/+28
2019-06-05Move `modern` calls inside `glob_adjust` and `reverse_glob_adjust`.Nicholas Nethercote-8/+8
2019-05-30Add `HygieneData::{outer,expn_info,is_descendant_of}` methods.Nicholas Nethercote-26/+24
This commit factors out some repeated code.
2019-05-29Introduce and use `SyntaxContext::outer_expn_info()`.Nicholas Nethercote-10/+20
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-29Introduce and use `Mark::outer_is_descendant_of()`.Nicholas Nethercote-3/+18
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-27Use `Symbol` more in lint APIsOliver Scherer-0/+10
2019-05-27Use `Symbol` equality in `may_begin_with` and `parse_nt`.Nicholas Nethercote-0/+7
2019-05-27Use `Symbol` equality in `is_ident_named`.Nicholas Nethercote-0/+2
2019-05-27Pre-intern "0", "1", ..., "9", and use where appropriate.Nicholas Nethercote-2/+18
2019-05-27Pass symbols to `ExtCtxt::std_path` instead of strings.Nicholas Nethercote-0/+21
Because this function is hot. Also remove the dead `ty_option` function.
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-0/+6
Most involving `Symbol::intern` on string literals.