about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-10-25Rollup merge of #65074 - Rantanen:json-byte-pos, r=matkladMazdak Farrokhzad-4/+199
Fix the start/end byte positions in the compiler JSON output Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output. This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one. The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions. Fixes #65029
2019-10-25RFC 2008: StabilizationDavid Wood-7/+4
This commit stabilizes RFC 2008 (#44109) by removing the feature gate. Signed-off-by: David Wood <david@davidtw.co>
2019-10-25Rollup merge of #65747 - Centril:union-issue-fix, r=varkorMazdak Farrokhzad-5/+13
Adjust the tracking issue for `untagged_unions`. Makes https://github.com/rust-lang/rust/issues/55149 the new tracking issue for `untagged_unions`. Closes https://github.com/rust-lang/rust/issues/32836 which is the old tracking issue. r? @varkor
2019-10-25Rollup merge of #65742 - Centril:gate-pre-expansion-subset, r=davidtwcoMazdak Farrokhzad-126/+124
Pre-expansion gate most of the things This is a subset of https://github.com/rust-lang/rust/pull/64672. A crater run has already been done and this PR implements conclusions according to https://github.com/rust-lang/rust/pull/64672#issuecomment-542703363. r? @davidtwco cc @petrochenkov
2019-10-24Adjust the tracking issue for `untagged_unions`.Mazdak Farrokhzad-5/+13
Also elaborate on some feature gates in `active.rs`.
2019-10-24pre-expansion gate type_ascriptionMazdak Farrokhzad-15/+9
2019-10-24pre-expansion gate box_syntaxMazdak Farrokhzad-7/+6
2019-10-24pre-expansion gate label_break_valueMazdak Farrokhzad-6/+7
2019-10-24dedup GAT gate checksMazdak Farrokhzad-16/+21
2019-10-24pre-expansion gate try_blocksMazdak Farrokhzad-4/+6
2019-10-24pre-expansion gate exclusive_range_patternMazdak Farrokhzad-8/+11
2019-10-24pre-expansion gate box_patternsMazdak Farrokhzad-15/+7
2019-10-24pre-expansion gate decl_macroMazdak Farrokhzad-5/+8
2019-10-24pre-expansion gate const_genericsMazdak Farrokhzad-11/+8
2019-10-24pre-expansion gate crate_visibility_modifierMazdak Farrokhzad-8/+4
2019-10-24pre-expansion gate associated_type_boundsMazdak Farrokhzad-16/+14
2019-10-24pre-expansion gate trait_alias.Mazdak Farrokhzad-9/+5
2019-10-24syntax: reject `trait Foo: Bar = Baz;`.Mazdak Farrokhzad-8/+20
Add test for rejecting `trait A: B1 = B2;`. Also test rejection of `trait A: = B;`.
2019-10-23Rollup merge of #65641 - nnethercote:derive-TokenStream-Encodable-Decodable, ↵Mazdak Farrokhzad-15/+2
r=petrochenkov Derive `Rustc{En,De}codable` for `TokenStream`. `TokenStream` used to be a complex type, but it is now just a newtype around a `Lrc<Vec<TreeAndJoint>>`. Currently it uses custom encoding that discards the `IsJoint` and custom decoding that adds `NonJoint` back in for every token tree. This requires building intermediate `Vec<TokenTree>`s. This commit makes `TokenStream` derive `Rustc{En,De}codable`. This simplifies the code, and avoids the creation of the intermediate vectors, saving up to 3% on various benchmarks. It also changes the AST JSON output in one test. r? @petrochenkov
2019-10-23Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakisbors-0/+3
Object safe for dispatch cc #43561
2019-10-23Auto merge of #65716 - JohnTitor:rollup-fkcr85k, r=JohnTitorbors-9/+8
Rollup of 14 pull requests Successful merges: - #64145 (Target-feature documented as unsafe) - #65007 (Mention keyword closing policy) - #65417 (Add more coherence tests) - #65507 (Fix test style in unused parentheses lint test) - #65591 (Add long error explanation for E0588) - #65617 (Fix WASI sleep impl) - #65656 (Add option to disable keyboard shortcuts in docs) - #65678 (Add long error explanation for E0728) - #65681 (Code cleanups following up on #65576.) - #65686 (refactor and move `maybe_append` ) - #65688 (Add some tests for fixed ICEs) - #65689 (bring back some Debug instances for Miri) - #65695 (self-profiling: Remove module names from some event-ids in codegen backend.) - #65706 (Add missing space in librustdoc) Failed merges: r? @ghost
2019-10-23Rollup merge of #65686 - yjhmelody:yjhmelody-patch-1, r=CentrilYuki Okushi-9/+8
refactor and move `maybe_append`
2019-10-22RFC 2027: "first draft" of implementationMathias Blikstad-0/+3
These are a squashed series of commits.
2019-10-22Readd some PartialEq and Hash derives used by Clippyflip1995-3/+6
2019-10-22refactor maybe_appendyjhmelody-9/+8
2019-10-21Rollup merge of #65647 - nnethercote:rm-unnecessary-traits, r=CentrilMazdak Farrokhzad-10/+8
Remove unnecessary trait bounds and derivations This PR removes unnecessary trait bounds and derivations from many types. r? @nikomatsakis
2019-10-21Fix the start/end byte positions in the compiler JSON outputMikko Rantanen-4/+199
2019-10-21Remove many unnecessary trait derivations.Nicholas Nethercote-10/+8
2019-10-21Derive `Rustc{En,De}codable` for `TokenStream`.Nicholas Nethercote-15/+2
`TokenStream` used to be a complex type, but it is now just a newtype around a `Lrc<Vec<TreeAndJoint>>`. Currently it uses custom encoding that discards the `IsJoint` and custom decoding that adds `NonJoint` back in for every token tree. This requires building intermediate `Vec<TokenTree>`s. This commit makes `TokenStream` derive `Rustc{En,De}codable`. This simplifies the code, and avoids the creation of the intermediate vectors, saving up to 3% on various benchmarks. It also changes the AST JSON output in one test.
2019-10-20typo fixguanqun-1/+1
2019-10-18Rollup merge of #65552 - JohnTitor:use-bitwise-not, r=Dylan-DPCTyler Mandry-1/+1
Clarify diagnostics when using `~` as a unary op It seems we prefer `bitwise not` to `bitwise negation`. Fixes #57239 r? @estebank
2019-10-18Rollup merge of #65498 - SimonSapin:plugin-help, r=CentrilTyler Mandry-2/+8
Plugins deprecation: don’t suggest simply removing the attribute Building Servo with a recent Nightly produces: ```rust warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597 --> components/script/lib.rs:14:1 | 14 | #![plugin(script_plugins)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute | = note: `#[warn(deprecated)]` on by default ``` First, linking to https://github.com/rust-lang/rust/issues/29597 is not ideal since there is pretty much no discussion there of the deprecation and what can be used instead. This PR changes the link to the deprecation PR which does have more discussion. Second, the “remove this attribute” suggestion is rather unhelpful. Just because a feature is deprecated doesn’t mean that simply removing its use without a replacement is acceptable. In the case of custom lint, there is no replacement available. Prefixing a message with “help:” when telling users that they’re screwed honestly feels disrespectful. This PR also changes the message to be more factual.
2019-10-18Rollup merge of #65493 - GuillaumeGomez:long-err-explanation-E0584, r=kinnisonTyler Mandry-1/+27
Add long error explanation for E0584 Part of #61137. r? @kinnison
2019-10-18Rollup merge of #65455 - ↵Tyler Mandry-36/+41
nnethercote:avoid-unnecessary-TokenTree-to-TokenStream-conversions, r=petrochenkov Avoid unnecessary `TokenTree` to `TokenStream` conversions A `TokenStream` contains any number of `TokenTrees`. Therefore, a single `TokenTree` can be promoted to a `TokenStream`. But doing so costs two allocations: one for the single-element `Vec`, and one for the `Lrc`. (An `IsJoint` value also must be added; the default is `NonJoint`.) The current code converts `TokenTree`s to `TokenStream`s unnecessarily in a few places. This PR removes some of these unnecessary conversions, both simplifying the code and speeding it up. r? @petrochenkov
2019-10-18Rollup merge of #65364 - XiangQingW:master, r=estebankTyler Mandry-3/+20
Collect occurrences of empty blocks for mismatched braces diagnostic Fix #63904
2019-10-18Clarify diagnostics when using `~` as a unary opYuki Okushi-1/+1
2019-10-18Change `MetaItem::tokens()` to `MetaItem::token_trees_and_joints()`.Nicholas Nethercote-21/+26
Likewise for `NestedMetaItem::tokens()`. Also, add `MetaItemKind::token_trees_and_joints()`, which `MetaItemKind::tokens()` now calls. This avoids some unnecessary `TokenTree` to `TokenStream` conversions, and removes the need for the clumsy `TokenStream::append_to_tree_and_joint_vec()`.
2019-10-18Change `Lit::tokens()` to `Lit::token_tree()`.Nicholas Nethercote-13/+13
Because most of the call sites have an easier time working with a `TokenTree` instead of a `TokenStream`.
2019-10-18Make `TokenStream::from_iter` less general and more efficient.Nicholas Nethercote-3/+3
The current code has this impl: ``` impl<T: Into<TokenStream>> iter::FromIterator<T> for TokenStream ``` If given an `IntoIterator<Item = TokenTree>`, it will convert each individual `TokenTree` to a `TokenStream` (at the cost of two allocations: a `Vec` and an `Lrc`). It will then merge those `TokenStream`s into a single `TokenStream`. This is inefficient. This commit changes the impl to this less general one: ``` impl iter::FromIterator<TokenTree> for TokenStream ``` It collects the `TokenTree`s into a single `Vec` first and then converts that to a `TokenStream` by wrapping it in a single `Lrc`. The previous generality was unnecessary; no other code needs changing. This change speeds up several benchmarks by up to 4%.
2019-10-18Remove two no-op `into()` calls.Nicholas Nethercote-2/+2
2019-10-17Plugins deprecation: don’t suggest simply removing the attributeSimon Sapin-2/+8
Building Servo with a recent Nightly produces: ```rust warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597 --> components/script/lib.rs:14:1 | 14 | #![plugin(script_plugins)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute | = note: `#[warn(deprecated)]` on by default ``` First, linking to https://github.com/rust-lang/rust/issues/29597 is not ideal since there is pretty much no discussion there of the deprecation and what can be used instead. This PR changes the link to the deprecation PR which does have more discussion. Second, the “remove this attribute” suggestion is rather unhelpful. Just because a feature is deprecated doesn’t mean that simply removing its use without a replacement is acceptable. In the case of custom lint, there is no replacement available. Prefixing a message with “help:” when telling users that they’re screwed honestly feels disrespectful. This PR also changes the message to be more factual.
2019-10-17Add long error explanation for E0584Guillaume Gomez-1/+27
2019-10-16panictry!(..) -> .unwrap()Mazdak Farrokhzad-2/+2
2019-10-16ui-fulldeps: make them pass again?Mazdak Farrokhzad-3/+3
2019-10-16make tidy happyMazdak Farrokhzad-3/+13
2019-10-16parser: leave a FIXME for laterMazdak Farrokhzad-0/+2
2019-10-16move SeqSep to parser.rsMazdak Farrokhzad-30/+31
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-8391/+37
2019-10-16syntax::parse: don't depend on syntax::extMazdak Farrokhzad-6/+12
2019-10-16attr: remove dep on ExtCtxtMazdak Farrokhzad-9/+5