about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-11-07move syntax::{parse::literal -> util::literal}Mazdak Farrokhzad-4/+2
2019-11-07move syntax::parse::lexer::comments -> syntax::util::commentsMazdak Farrokhzad-25/+27
2019-11-07syntax::attr: remove usage of lexerMazdak Farrokhzad-5/+11
2019-11-07move parse::classify -> util::classifyMazdak Farrokhzad-5/+6
2019-11-07move PResult to librustc_errorsMazdak Farrokhzad-36/+33
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-26/+26
2019-11-07move unescape_error_reporting to lexer/Mazdak Farrokhzad-2/+2
2019-11-07syntax: simplify importsMazdak Farrokhzad-5/+6
2019-11-07move parse/parser.rs -> parse/parser/mod.rsMazdak Farrokhzad-0/+0
2019-11-07Rollup merge of #65974 - Centril:matcher-friendly-gating, r=petrochenkovMazdak Farrokhzad-71/+77
A scheme for more macro-matcher friendly pre-expansion gating Pre-expansion gating will now avoid gating macro matchers that did not result in `Success(...)`. That is, the following is now OK despite `box 42` being a valid `expr` and that form being pre-expansion gated: ```rust macro_rules! m { ($e:expr) => { 0 }; // This fails on the input below due to `, foo`. (box $e:expr, foo) => { 1 }; // Successful matcher, we should get `2`. } fn main() { assert_eq!(1, m!(box 42, foo)); } ``` Closes https://github.com/rust-lang/rust/issues/65846. r? @petrochenkov cc @Mark-Simulacrum
2019-11-07Rollup merge of #65884 - Centril:non-hardcoded-abis, r=petrochenkovMazdak Farrokhzad-155/+174
syntax: ABI-oblivious grammar This PR has the following effects: 1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal. 2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate. 3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place. 4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat. cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :) r? @varkor
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-52/+63
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-07parser: allow ABIs from literal macro fragmentsMazdak Farrokhzad-22/+33
2019-11-07cleanup can_begin_const_argMazdak Farrokhzad-3/+1
2019-11-07parser: don't hardcode ABIs into grammarMazdak Farrokhzad-84/+83
2019-11-07Auto merge of #66175 - JohnTitor:rollup-ihqk5vn, r=JohnTitorbors-11/+10
Rollup of 12 pull requests Successful merges: - #65794 (gate rustc_on_unimplemented under rustc_attrs) - #65945 (Optimize long-linker-command-line test) - #66044 (Improve uninit/zeroed lint) - #66076 (HIR docs: mention how to resolve method paths) - #66084 (Do not require extra LLVM backends for `x.py test` to pass) - #66111 (improve from_raw_parts docs) - #66114 (Improve std::thread::Result documentation) - #66117 (Fixed PhantomData markers in Arc and Rc) - #66146 (Remove unused parameters in `__thread_local_inner`) - #66147 (Miri: Refactor to_scalar_ptr out of existence) - #66162 (Fix broken link in README) - #66171 (Update link on CONTRIBUTING.md) Failed merges: r? @ghost
2019-11-07Rollup merge of #65794 - Centril:unimpl-internal, r=varkorYuki Okushi-11/+10
gate rustc_on_unimplemented under rustc_attrs Move `rustc_on_implemented` from the `on_implemented` gate to `rustc_attrs` as it is internal. Closes #29628 r? @varkor
2019-11-06Make doc comments cheaper with `AttrKind`.Nicholas Nethercote-77/+153
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a big performance win (over 10% in some cases) because `DocComment` lets doc comments (which are common) be represented very cheaply. `Attribute` gets some new helper methods to ease the transition: - `has_name()`: check if the attribute name matches a single `Symbol`; for `DocComment` variants it succeeds if the symbol is `sym::doc`. - `is_doc_comment()`: check if it has a `DocComment` kind. - `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant; panic otherwise. Fixes #60935.
2019-11-06Remove unnecessary `Deref` impl for `Attribute`.Nicholas Nethercote-23/+17
This kind of thing just makes the code harder to read.
2019-11-06rollback gating for failing macro matchersMazdak Farrokhzad-4/+13
2019-11-06revamp pre-expansion gating infraMazdak Farrokhzad-68/+65
2019-11-06gate rustc_on_unimplemented under rustc_attrsMazdak Farrokhzad-11/+10
2019-11-06Rollup merge of #66139 - euclio:pluralize, r=nagisaMazdak Farrokhzad-8/+8
use American spelling for `pluralize!`
2019-11-06Rollup merge of #66086 - RalfJung:smallvec, r=nagisaMazdak Farrokhzad-2/+2
bump smallvec to 1.0 This includes https://github.com/servo/rust-smallvec/pull/162, fixing an unsoundness in smallvec. See https://github.com/servo/rust-smallvec/pull/175 for the 1.0 release announcement. Cc @mbrubeck @emilio
2019-11-06Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, ↵Mazdak Farrokhzad-12/+12
r=estebank Rename `LocalInternedString` and more This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses. r? @estebank
2019-11-06Rollup merge of #66098 - estebank:path-asciption-typo, r=CentrilMazdak Farrokhzad-4/+12
Detect `::` -> `:` typo when involving turbofish Fix #65569.
2019-11-06Rollup merge of #66068 - euclio:null-emitter, r=estebankMazdak Farrokhzad-1/+7
use silent emitter for rustdoc highlighting pass Partially addresses #63284.
2019-11-06Rollup merge of #66054 - petrochenkov:delspan, r=estebankMazdak Farrokhzad-17/+7
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes https://github.com/rust-lang/rust/issues/62524 r? @estebank
2019-11-06Rollup merge of #65892 - pnkfelix:trim-special-derives, r=petrochenkovMazdak Farrokhzad-10/+0
Remove `PartialEq` and `Eq` from the `SpecialDerives`. Now that PR #65519 landed, this is the follow-on work of removing `PartialEq` and `Eq` from the set of `SpecialDerives` .
2019-11-05use American spelling for `pluralize!`Andy Russell-8/+8
2019-11-05Account for typo in turbofish and suggest `::`Esteban Küber-4/+10
2019-11-05Review feedback: Remove more stuff! Simplify simplify simplify!Felix S. Klock II-8/+0
2019-11-05Remove `PartialEq` and `Eq` from the `SpecialDerives`.Felix S. Klock II-2/+0
2019-11-05Rollup merge of #66025 - petrochenkov:lohi, r=eddybPietro Albini-14/+6
`Span` cannot represent `span.hi < span.lo` So we can remove the corresponding checks from various code
2019-11-04Detect `::` -> `:` typo when involving turbofishEsteban Küber-1/+3
2019-11-04bump smallvec to 1.0Ralf Jung-2/+2
2019-11-03use silent emitter for rustdoc highlighting passAndy Russell-1/+7
2019-11-04Auto merge of #65838 - estebank:resilient-recovery, r=Centrilbors-48/+96
Reduce amount of errors given unclosed delimiter When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it on a more granular way in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace. Fix #63690.
2019-11-03syntax: Avoid span arithmetics for delimiter tokensVadim Petrochenkov-17/+7
2019-11-02Auto merge of #66004 - eddyb:revert-early-gate, r=petrochenkovbors-2/+110
Partially revert the early feature-gatings added in #65742. The intent here is to address #65860 ASAP (in time for beta, ideally), while leaving as much of #65742 around as possible, to make it easier to re-enable later. Therefore, I've only kept the parts of the revert that re-add the old (i.e. non-early) feature-gating checks that were removed in #65742, and the test reverts. I've disabled the new early feature-gating checks from #65742 entirely for now, but it would be easy to put them behind a `-Z` flag, or turn them into warnings, which would allow us to keep tests for both the early and late versions of the checks - assuming that's desirable. cc @nikomatsakis @Mark-Simulacrum @Centril
2019-11-02Remove the `AsRef` impl for `SymbolStr`.Nicholas Nethercote-4/+4
Because it's highly magical, which goes against the goal of keeping `SymbolStr` simple. Plus it's only used in a handful of places that only require minor changes.
2019-11-02Simplify various `Symbol` use points.Nicholas Nethercote-5/+5
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.
2019-11-02Convert `x.as_str().to_string()` to `x.to_string()` where possible.Nicholas Nethercote-3/+3
2019-11-01`Span` cannot represent `span.hi < span.lo`Vadim Petrochenkov-14/+6
So we can remove the corresponding checks from various code
2019-11-01Rollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebankTyler Mandry-3/+19
Add error code E0743 for "C-variadic has been used on a non-foreign function" Fixes https://github.com/rust-lang/rust/issues/65967
2019-10-31syntax: disable the new early feature-gatings added in #65742.Eduard-Mihai Burtescu-0/+15
2019-10-31Revert "pre-expansion gate trait_alias."Eduard-Mihai Burtescu-0/+9
This reverts commit 2d182b82ce5ecfe8090ba3d4e78f1cd72c072ef1.
2019-10-31Revert "pre-expansion gate associated_type_bounds"Eduard-Mihai Burtescu-1/+14
This reverts commit c17a1fd7d0ef0f1f546445d0c8bdb11be55e4be7.
2019-10-31Revert "pre-expansion gate crate_visibility_modifier"Eduard-Mihai Burtescu-0/+8
This reverts commit 04c661ba021730bc13d33c6d55cb9aad05026f36.
2019-10-31Revert "pre-expansion gate const_generics"Eduard-Mihai Burtescu-1/+11
This reverts commit 49cbfa1a6f6469ddbc0e88161e52104cc87aea9b.