about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-01-17Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrumbors-1/+1
Add lint for copyright headers to 'tidy' tool r? @Mark-Simulacrum CC @centril
2019-01-16Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakisbors-179/+281
Implement basic input validation for built-in attributes Correct top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is enforced for built-in attributes, built-in attributes must also fit into the "meta-item" syntax (aka the "classic attribute syntax"). For some subset of attributes (found by crater run), errors are lowered to deprecation warnings. NOTE: This PR previously included https://github.com/rust-lang/rust/pull/57367 as well.
2019-01-15Rollup merge of #57467 - JohnTitor:implement-the-check-attribute-1, r=oli-obkMazdak Farrokhzad-2/+2
Implement `check_attribute` to forbid `#[allow_internal_unsafe]` Fixes #56768. r? @oli-obk
2019-01-15Add PartialEqYuki Okushi-2/+2
2019-01-14Rollup merge of #57585 - estebank:trailing-semicolon, r=petrochenkovMazdak Farrokhzad-24/+35
Recover from item trailing semicolon CC https://github.com/rust-lang/rfcs/pull/2479 r? @petrochenkov
2019-01-14Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkovMazdak Farrokhzad-34/+8
Unaccept `extern_in_paths` Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac. Closes https://github.com/rust-lang/rust/issues/55600 r? @petrochenkov
2019-01-14Rollup merge of #57540 - estebank:eval-more, r=petrochenkovMazdak Farrokhzad-31/+122
Modify some parser diagnostics to continue evaluating beyond the parser Continue evaluating further errors after parser errors on: - trailing type argument attribute - lifetime in incorrect location - incorrect binary literal - missing `for` in `impl Trait for Foo` - type argument in `where` clause - incorrect float literal - incorrect `..` in pattern - associated types - incorrect discriminator value variant error and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled. These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors. Each commit has an individual diagnostic change with their corresponding tests. CC #48724.
2019-01-14Rollup merge of #57465 - jethrogb:jb/stablize-cfg-target-vendor, ↵Mazdak Farrokhzad-4/+2
r=joshtriplett,Centril Stabilize cfg_target_vendor This stabilizes the use of `cfg(target_vendor = "...")` and removes the corresponding `cfg_target_vendor` feature. Other unstable cfgs remain behind their existing feature gates. This functionality was added back in 2015 in #28612 to complete the coverage of target tuples (`<arch><sub>-<vendor>-<os>-<env>`). [RFC 131](https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md) governs the target specification, not including `target_vendor` seems to have just been an oversight. `target_os`, `target_family`, and `target_arch` are stable as of 1.0.0. `target_env` was also not mentioned in RFC 131, was added in #24777, never behind a feature_gate, and insta-stable at 1.1.0. The functionality is tested in [test/run-pass/cfg/cfg-target-vendor.rs](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/cfg/cfg-target-vendor.rs). Closes #29718
2019-01-14Stabilize `cfg_target_vendor`, #29718Jethro Beekman-4/+2
2019-01-14Auto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obkbors-5/+7
Use structured suggestions for nonstandard style lints This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered. Fixes #48103. Fixes #52414.
2019-01-13Recover from item trailing semicolonEsteban Küber-24/+35
2019-01-13Cosmetic improvementsAlexander Regueiro-1/+1
2019-01-13Rollup merge of #57004 - nnethercote:TS-change-Stream, r=petrochenkovMazdak Farrokhzad-335/+141
Make `TokenStream` less recursive. `TokenStream` is currently recursive in *two* ways: - the `TokenTree` variant contains a `ThinTokenStream`, which can contain a `TokenStream`; - the `TokenStream` variant contains a `Vec<TokenStream>`. The latter is not necessary and causes significant complexity. This commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`. This reduces complexity significantly. In particular, `StreamCursor` is eliminated, and `Cursor` becomes much simpler, consisting now of just a `TokenStream` and an index. The commit also removes the `Extend` impl for `TokenStream`, because it is only used in tests. (The commit also removes those tests.) Overall, the commit reduces the number of lines of code by almost 200.
2019-01-13remove extern_in_paths.Mazdak Farrokhzad-34/+8
2019-01-13Address review commentsVadim Petrochenkov-4/+11
2019-01-13Implement basic input validation for built-in attributesVadim Petrochenkov-179/+274
2019-01-13Rollup merge of #57564 - varkor:update-const_fn-tracking-issue, r=CentrilMazdak Farrokhzad-1/+1
Update the const fn tracking issue to the new metabug The new `const fn` tracking issue is #57563. We don't want to point to a closed issue in the diagnostics (or FIXMEs), so these have been updated (from the old issue, #24111). r? @Centril
2019-01-13Rollup merge of #57461 - nnethercote:ParseResult-Failure-static-str, ↵Mazdak Farrokhzad-4/+4
r=simulacrum Change `String` to `&'static str` in `ParseResult::Failure`. This avoids 770,000 allocations when compiling the `html5ever` benchmark, reducing instruction counts by up to 2%.
2019-01-12Suggest correct location for lifetime parameters in useEsteban Küber-9/+43
2019-01-13Update the const fn tracking issue to the new metabugvarkor-1/+1
2019-01-12Auto merge of #56759 - petrochenkov:prestabuni, r=nikomatsakisbors-3/+2
Stabilize `uniform_paths` Address all the things described in https://github.com/rust-lang/rust/issues/56417. Assign visibilities to `macro_rules` items - `pub` to `macro_export`-ed macros and `pub(crate)` to non-exported macros, these visibilities determine how far these macros can be reexported with `use`. Prohibit use of reexported inert attributes and "tool modules", after renaming (e.g. `use inline as imported_inline`) their respective tools and even compiler passes won't be able to recognize and properly check them. Also turn use of uniform paths in 2015 macros into an error, I'd prefer to neither remove nor stabilize them right away because I still want to make some experiments in this area (uniform path fallback was added to 2015 macros used on 2018 edition in https://github.com/rust-lang/rust/pull/56053#issuecomment-441405140). UPDATE: The last commit also stabilizes the feature `uniform_paths`. Closes https://github.com/rust-lang/rust/issues/53130 Closes https://github.com/rust-lang/rust/issues/55618 Closes https://github.com/rust-lang/rust/issues/56326 Closes https://github.com/rust-lang/rust/issues/56398 Closes https://github.com/rust-lang/rust/issues/56417 Closes https://github.com/rust-lang/rust/issues/56821 Closes https://github.com/rust-lang/rust/issues/57252 Closes https://github.com/rust-lang/rust/issues/57422
2019-01-12Stabilize `uniform_paths`Vadim Petrochenkov-3/+2
2019-01-12Auto merge of #57542 - Centril:rollup, r=Centrilbors-6/+6
Rollup of 26 pull requests Successful merges: - #56425 (Redo the docs for Vec::set_len) - #56906 (Issue #56905) - #57042 (Don't call `FieldPlacement::count` when count is too large) - #57175 (Stabilize `let` bindings and destructuring in constants and const fn) - #57192 (Change std::error::Error trait documentation to talk about `source` instead of `cause`) - #57296 (Fixed the link to the ? operator) - #57368 (Use CMAKE_{C,CXX}_COMPILER_LAUNCHER for ccache) - #57400 (Rustdoc: update Source Serif Pro and replace Heuristica italic) - #57417 (rustdoc: use text-based doctest parsing if a macro is wrapping main) - #57433 (Add link destination for `read-ownership`) - #57434 (Remove `CrateNum::Invalid`.) - #57441 (Supporting backtrace for x86_64-fortanix-unknown-sgx.) - #57450 (actually take a slice in this example) - #57459 (Reference tracking issue for inherent associated types in diagnostic) - #57463 (docs: Fix some 'second-edition' links) - #57466 (Remove outdated comment) - #57493 (use structured suggestion when casting a reference) - #57498 (make note of one more normalization that Paths do) - #57499 (note that FromStr does not work for borrowed types) - #57505 (Remove submodule step from README) - #57510 (Add a profiles section to the manifest) - #57511 (Fix undefined behavior) - #57519 (Correct RELEASES.md for 1.32.0) - #57522 (don't unwrap unexpected tokens in `format!`) - #57530 (Fixing a typographical error.) - #57535 (Stabilise irrefutable if-let and while-let patterns) Failed merges: r? @ghost
2019-01-12Rollup merge of #57535 - varkor:stabilise-if-while-let-patterns, r=CentrilMazdak Farrokhzad-3/+2
Stabilise irrefutable if-let and while-let patterns This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). This replaces https://github.com/rust-lang/rust/pull/55639, as we want to stabilise this in time for the beta cut-off. Closes https://github.com/rust-lang/rust/pull/55639. r? @Centril
2019-01-12move const_let accepted gate to avoid future conflict.Mazdak Farrokhzad-2/+2
2019-01-11Add label for invalid literal suffixEsteban Küber-0/+2
2019-01-11Tweak incorrect discriminator value variant errorEsteban Küber-7/+13
2019-01-11Small tweaks to parser errorsEsteban Küber-7/+20
2019-01-11Tweak type argument after assoc type errorEsteban Küber-2/+9
2019-01-11Continue evaluating after finding incorrect .. in patternEsteban Küber-3/+10
2019-01-11Continue evaluating after incorrect float literalEsteban Küber-1/+5
2019-01-11Continue evaluating after type argument in where clauseEsteban Küber-2/+6
2019-01-11Continue evaluating after missing `for` in `impl Trait for Foo`Esteban Küber-1/+7
2019-01-11Continue evaluating after parsing incorrect binary literalEsteban Küber-1/+1
2019-01-11Continue parsing after lifetime in incorrect locationEsteban Küber-2/+6
2019-01-11Continue parser after trailing type argument attributeEsteban Küber-2/+6
2019-01-12Stabilise irrefutable if-let and while-let patternsvarkor-3/+2
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2019-01-11stabilize top level or-pats in if/while let.Mazdak Farrokhzad-11/+5
2019-01-09Clarify const_let commentOliver Scherer-1/+3
2019-01-09Stabilize `let` bindings and destructuring in constants and const fnOliver Scherer-3/+2
2019-01-09Change `String` to `&'static str` in `ParseResult::Failure`.Nicholas Nethercote-4/+4
This avoids 770,000 allocations when compiling the `html5ever` benchmark, reducing instruction counts by up to 2%.
2019-01-08improve non_snake_case diagnosticsAndy Russell-5/+7
Use a structured suggestion and tighten the span to just the identifier.
2019-01-08Make `TokenStream` less recursive.Nicholas Nethercote-335/+141
`TokenStream` is currently recursive in *two* ways: - the `TokenTree` variant contains a `ThinTokenStream`, which can contain a `TokenStream`; - the `TokenStream` variant contains a `Vec<TokenStream>`. The latter is not necessary and causes significant complexity. This commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`. This reduces complexity significantly. In particular, `StreamCursor` is eliminated, and `Cursor` becomes much simpler, consisting now of just a `TokenStream` and an index. The commit also removes the `Extend` impl for `TokenStream`, because it is only used in tests. (The commit also removes those tests.) Overall, the commit reduces the number of lines of code by almost 200.
2019-01-08remove unwanted stage0 line, fix styledylan_DPC-1/+1
2019-01-08remove unused imports and feature gate from testsdylan_DPC-3/+0
2019-01-08stabilise cfg_attrdylan_DPC-23/+4
2019-01-06tests: Do not use `-Z parse-only`, continue compilation to test recoveryVadim Petrochenkov-1/+0
2019-01-05Rollup merge of #57314 - wiktorkuchta:master, r=Centrilkennytm-1/+1
Fix repeated word typos Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo ](https://github.com/e-maxx-eng/e-maxx-eng/pull/389) Not a stupid `sed`, I actually tried to fix case by case.
2019-01-05Auto merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakisbors-0/+3
Implement the Re-rebalance coherence RFC This is the first time I touch anything in the compiler so just tell me if I got something wrong. Big thanks to @sgrif for the pointers where to look for those things. cc #55437
2019-01-04Auto merge of #56897 - euclio:parse-fatal, r=estebankbors-2/+0
make `panictry!` private to libsyntax 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.