about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-11-08Rollup merge of #55777 - nnethercote:less-P-in-ast, r=petrochenkovMark Rousskov-6/+6
Use `Lit` rather than `P<Lit>` in `ast::ExprKind`. Because it results in fewer allocations and small speedups on some benchmarks.
2018-11-08Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.Nicholas Nethercote-6/+6
Because it results in fewer allocations and small speedups on some benchmarks.
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-3/+3
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-07Rollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petrochenkovkennytm-1/+6
Fix feature gate only being checked on first repr attr. Reported in https://github.com/rust-lang/rust/issues/33158#issuecomment-412185357.
2018-11-06refactor: use shorthand fieldsteresy-3/+3
2018-11-06Rollup merge of #55601 - petrochenkov:featissue, r=pnkfelixkennytm-19/+8
Fix tracking issue numbers for some unstable features And also remove deprecated unstable `#[panic_implementation]` attribute that was superseded by stable `#[panic_handler]` and doesn't have an open tracking issue.
2018-11-05Auto merge of #55451 - estebank:arg-doc, r=pnkfelixbors-20/+65
Custom diagnostic when trying to doc comment argument When writing ``` pub fn f( /// Comment id: u8, ) {} ``` Produce a targeted diagnostic ``` error: documentation comments cannot be applied to method arguments --> $DIR/fn-arg-doc-comment.rs:2:5 | LL | /// Comment | ^^^^^^^^^^^ doc comments are not allowed here ``` Fix #54801.
2018-11-04Auto merge of #55455 - estebank:expected-descr, r=michaelwoeristerbors-24/+26
Use token description in "expected/found" parse messages Fix #54309.
2018-11-04Auto merge of #54861 - rep-nop:find_main_in_doctest, r=estebankbors-9/+81
rustdoc: Replaces fn main search and extern crate search with proper parsing during doctests. Fixes #21299. Fixes #33731. Let me know if there's any additional changes you'd like made!
2018-11-03Extended elaboration for trait aliases to include arbitrary bounds.Alexander Regueiro-5/+5
2018-11-03Added support for trait aliases as object types.Alexander Regueiro-5/+5
2018-11-03Added support for trait aliases as bounds.Alexander Regueiro-7/+10
2018-11-02implement existing parser fns in terms of fallible fnsQuietMisdreavus-14/+21
2018-11-02Remove deprecated unstable `#[panic_implementation]`Vadim Petrochenkov-13/+2
It was superseded by `#[panic_handler]`
2018-11-02Fix tracking issue numbers for some unstable featuresVadim Petrochenkov-6/+6
2018-11-01buffer errors from initial tokenization when parsingQuietMisdreavus-3/+68
2018-11-01Rollup merge of #55558 - nnethercote:tweak-MatcherPos-matches, r=petrochenkovPietro Albini-6/+13
Tweak `MatcherPos::matches` These changes reduce instruction counts on `sentry-cli-check` incremental builds by up to 2%.
2018-11-01Rollup merge of #55542 - ljedrz:syntax_alloc_improvements, r=kennytmPietro Albini-0/+2
syntax: improve a few allocations Add 2 `reserve`s and a `with_capacity` where the final vector size is known.
2018-11-01Use `SmallVec` for the inner vectors in `MatcherPos::matches`.Nicholas Nethercote-5/+7
This avoids some allocations.
2018-11-01Share empty `Vec`s more within `MatcherPos::matches`.Nicholas Nethercote-4/+9
`create_matches` creates a `Vec<Rc<Vec<NamedMatch>>>`. Even though all the inner `Vec`s are empty, each one is created separately. This commit changes `create_matches` so it instead creates one empty inner `Vec`, and shares it. The commit also changes `MatcherPos::matches` to a boxed slice, because its length doesn't change.
2018-10-31syntax: improve a few allocationsljedrz-0/+2
2018-10-31use String::from() instead of format!() macro to construct Strings.Matthias Krüger-1/+1
2018-10-31Fix feature gate only being checked on first repr attr.Cameron Hart-1/+6
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-162/+163
2018-10-29Fix regressionEsteban Küber-1/+1
2018-10-29Rollup merge of #55384 - nnethercote:better-integer_lit-float_lit, ↵Pietro Albini-4/+19
r=michaelwoerister Avoid unnecessary allocations in `float_lit` and `integer_lit`. This commit avoids an allocation when parsing any float and integer literals that don't involved underscores. This reduces the number of allocations done for the `tuple-stress` benchmark by 10%, reducing its instruction count by just under 1%.
2018-10-28Use token description in "expected/found" parse messagesEsteban Küber-23/+25
2018-10-28Provide specific label for patern parsing errorEsteban Küber-22/+28
2018-10-28Point at `match` when a parse failure ocurrs inside of itEsteban Küber-1/+5
2018-10-28Produce targeted diagnostic when using doc comments on fn argsEsteban Küber-1/+36
Before parsing argument names and types, try to consume an incorrectly included doc comment or attribute in order to recover and continue parsing the rest of the fn definition.
2018-10-28Auto merge of #55192 - cramertj:nested-mod, r=petrochenkovbors-0/+11
Fix ordering of nested modules in non-mod.rs mods Flatten relative offset into directory path before adding inline (mod x { ... }) module names to the current directory path. Fix #55094
2018-10-27feature-gate lint reasonsZack M. Davis-0/+3
We take stability seriously, so we shy away from making even seemingly "trivial" features insta-stable.
2018-10-26Auto merge of #54929 - csmoe:cfg_lint, r=petrochenkovbors-56/+165
Suggest to remove prefix `b` in cfg attribute lint string Closes #54926 r? @estebank
2018-10-26Rollup merge of #55358 - sinkuu:redundant_clone2, r=estebankkennytm-5/+4
Remove redundant clone (2)
2018-10-26Rollup merge of #55301 - estebank:macro-allowed, r=petrochenkovkennytm-44/+94
List allowed tokens after macro fragments Fix #34069.
2018-10-26Rollup merge of #55298 - estebank:macro-def, r=pnkfelixkennytm-13/+39
Point at macro definition when no rules expect token Fix #35150.
2018-10-26Rollup merge of #55292 - estebank:macro-eof, r=pnkfelixkennytm-5/+28
Macro diagnostics tweaks Fix #30128, fix #10951 by adding an appropriate span to the diagnostic. Fix #26288 by suggesting adding semicolon to macro call.
2018-10-26Avoid unnecessary allocations in `float_lit` and `integer_lit`.Nicholas Nethercote-4/+19
This commit avoids an allocation when parsing any float and integer literals that don't involved underscores. This reduces the number of allocations done for the `tuple-stress` benchmark by 10%, reducing its instruction count by just under 1%.
2018-10-26Remove redundant cloneShotaro Yamada-5/+4
2018-10-26more reviewer changesNick Cameron-5/+1
2018-10-26rebasing and reviewer changesNick Cameron-1/+1
Primarily refactoring `(Ident, Option<NodeId>)` to `Segment`
2018-10-26Store a resolved def on hir::PathSegmentNick Cameron-1/+1
2018-10-26Give each PathSegment a NodeIdNick Cameron-7/+19
2018-10-25List allowed tokens after macro fragmentsEsteban Küber-44/+94
2018-10-25Rollup merge of #55282 - sinkuu:redundant_clone, r=estebankPietro Albini-1/+1
Remove redundant clone
2018-10-25Rollup merge of #55269 - matthiaskrgr:typos_oct, r=zackmdavisPietro Albini-2/+2
fix typos in various places
2018-10-25Rollup merge of #54977 - estebank:macro-arg-parse, r=pnkfelixPietro Albini-1/+2
Accept `Option<Box<$t:ty>>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ``` Fix #25274.
2018-10-24Fix incorrect semicolon suggestionEsteban Küber-1/+3
2018-10-24Point to macro def span instead of whole bodyEsteban Küber-1/+1
2018-10-23Point at macro definition when no rules expect tokenEsteban Küber-13/+39