about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2019-01-11don't unwrap unexpected tokens in `format!`Andy Russell-1/+1
Fixes #57512.
2019-01-02make `panictry!` private to libsyntaxAndy Russell-111/+213
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2018-12-31Use structured suggestion for braceless unicode escape squenceEsteban Küber-2/+2
2018-12-31Account for `\xFF` and `\u{FF}` sequences in string format errorsEsteban Küber-0/+45
2018-12-30Improve error recovery for some built-in macrosVadim Petrochenkov-17/+26
2018-12-29Auto merge of #57140 - estebank:str-err, r=varkorbors-2/+9
Tweaks to format string diagnostics Add label spans and fix incorrect spans. Fix #55155, fix #55350.
2018-12-27Make sure feature gate errors are recoverableVadim Petrochenkov-8/+0
2018-12-27Fix `trace_macros` and `log_syntax`Vadim Petrochenkov-6/+6
2018-12-27Get rid of `Block::recovered`Vadim Petrochenkov-1/+0
2018-12-27Do not abort compilation if expansion produces errorsVadim Petrochenkov-4/+4
Fix a number of uncovered deficiencies in diagnostics
2018-12-26Add span label to unused string formatting argumentEsteban Küber-1/+6
Fix #55350.
2018-12-26Point at correct span for arguments in format stringsEsteban Küber-1/+3
When a format string has escaped whitespace characters format arguments were shifted by one per each escaped character. Account for these escaped characters when synthesizing the spans. Fix #55155.
2018-12-26Various changes to string format diagnosticsEsteban Küber-8/+69
- Point at opening mismatched formatting brace - Account for differences between raw and regular strings - Account for differences between the code snippet and `InternedString` - Add more tests
2018-12-25Remove licensesMark Rousskov-339/+0
2018-12-24Rollup merge of #57074 - Zoxc:pq-rec-limits, r=oli-obkMazdak Farrokhzad-0/+2
Fix recursion limits r? @michaelwoerister
2018-12-23Rollup merge of #56964 - nnethercote:TokenStream-IsJoint, r=petrochenkovMazdak Farrokhzad-6/+2
Remove `TokenStream::JointTree`. This is done by adding a new `IsJoint` field to `TokenStream::Tree`, which simplifies a lot of `match` statements. And likewise for `CursorKind`. The commit also adds a new method `TokenTree:stream()` which can replace a choice between `.into()` and `.joint()`.
2018-12-23Fix recursion limitsJohn Kåre Alsaker-0/+2
2018-12-20Remove `TokenStream::JointTree`.Nicholas Nethercote-6/+2
This is done by adding a new `IsJoint` field to `TokenStream::Tree`, which simplifies a lot of `match` statements. And likewise for `CursorKind`. The commit also adds a new method `TokenTree:stream()` which can replace a choice between `.into()` and `.joint()`.
2018-12-19proc_macro: Accept `$crate` as an identifier if it comes from the compilerVadim Petrochenkov-0/+6
2018-12-19proc_macro: Validate tokens coming from the compiler againVadim Petrochenkov-51/+56
2018-12-19Remove `eliminate_crate_var` and special pretty-printing for `$crate`Vadim Petrochenkov-1/+0
2018-12-14format: minor stylistic improvementsljedrz-12/+6
2018-12-14format: refactor verify_arg_typeljedrz-22/+16
2018-12-14format: refactor report_invalid_referencesljedrz-25/+21
2018-12-14format: remove unreachable conditionljedrz-22/+9
2018-12-10Rollup merge of #56491 - euclio:assert-error, r=estebankGuillaume Gomez-0/+8
emit error with span for empty asserts Fixes #55547.
2018-12-10Auto merge of #56369 - nnethercote:rm-Delimited, r=petrochenkovbors-7/+5
Remove `tokenstream::Delimited`. Because it's an extra type layer that doesn't really help; in a couple of places it actively gets in the way, and overall removing it makes the code nicer. It does, however, move `tokenstream::TokenTree` further away from the `TokenTree` in `quote.rs`. More importantly, this change reduces the size of `TokenStream` from 48 bytes to 40 bytes on x86-64, which is enough to slightly reduce instruction counts on numerous benchmarks, the best by 1.5%. Note that `open_tt` and `close_tt` have gone from being methods on `Delimited` to associated methods of `TokenTree`.
2018-12-10Remove `tokenstream::Delimited`.Nicholas Nethercote-7/+5
Because it's an extra type layer that doesn't really help; in a couple of places it actively gets in the way, and overall removing it makes the code nicer. It does, however, move `tokenstream::TokenTree` further away from the `TokenTree` in `quote.rs`. More importantly, this change reduces the size of `TokenStream` from 48 bytes to 40 bytes on x86-64, which is enough to slightly reduce instruction counts on numerous benchmarks, the best by 1.5%. Note that `open_tt` and `close_tt` have gone from being methods on `Delimited` to associated methods of `TokenTree`.
2018-12-10Upgrade `smallvec` to 0.6.7 and use the new `may_dangle` feature.Nicholas Nethercote-1/+1
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-13/+13
2018-12-07Unsupport `#[derive(Trait)]` sugar for `#[derive_Trait]` legacy plugin ↵Vadim Petrochenkov-6/+3
attributes
2018-12-06Rollup merge of #56500 - ljedrz:cleanup_rest_of_const_lifetimes, r=zackmdavisPietro Albini-4/+3
cleanup: remove static lifetimes from consts A follow-up to https://github.com/rust-lang/rust/pull/56497.
2018-12-06Rollup merge of #56426 - petrochenkov:syntweak, r=nikomatsakisPietro Albini-2/+2
libsyntax_pos: A few tweaks
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-1/+1
fixes remaining test failures
2018-12-04emit error with span for empty assertsAndy Russell-0/+8
Fixes #55547.
2018-12-04cleanup: remove static lifetimes from constsljedrz-4/+3
2018-12-04syntax: Rename some keywordsVadim Petrochenkov-2/+2
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now `SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-12-03Rollup merge of #56438 - yui-knk:remove_not_used_DotEq_token, r=petrochenkovkennytm-1/+0
Remove not used `DotEq` token Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-12-02Remove not used `DotEq` tokenyui-knk-1/+0
Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-12-01remove some uses of try!Mark Mansi-1/+1
2018-11-30proc_macro: move to a dependency of libtest.Eduard-Mihai Burtescu-1/+0
2018-11-30proc_macro: move the rustc server to syntax_ext.Eduard-Mihai Burtescu-3/+758
2018-11-30proc_macro: remove the __internal module.Eduard-Mihai Burtescu-19/+9
2018-11-30proc_macro: introduce a "bridge" between clients (proc macros) and servers ↵Eduard-Mihai Burtescu-129/+124
(compiler front-ends).
2018-11-18Rollup merge of #55923 - Zeegomo:master, r=estebankPietro Albini-1/+1
reword #[test] attribute error on fn items fix of [#55787](https://github.com/rust-lang/rust/issues/55787) Reworded error message from "#[test] attribute is only allowed on fn items" to "#[test] attribute is only allowed on non associated functions"
2018-11-18Rollup merge of #55827 - ljedrz:various_stashed, r=alexcrichtonPietro Albini-10/+8
A few tweaks to iterations/collecting - simplify and speed up `dot::GraphWalk::nodes` for `cfg::CFG` - `reserve` the capacity for `edges` in `DepGraph::query` - collect directly to a `HirVec` in `LoweringContext::lower_attrs` - fix overallocation in `OnDiskCache::serialize` - preallocate the `new_partitioning` vector in `merge_codegen_units` - simplify `impl FromHex for str` - improve the creation of `self_arg_names` in `impl MethodDef`
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-13A few tweaks to iterations/collectingljedrz-10/+8
2018-11-11reword #[test] attribute error on fn itemsgiacomo-1/+1
2018-10-31syntax: improve a few allocationsljedrz-1/+1