summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-10-24Destabilize feature non_modrs_modsPietro Albini-3/+30
This reverts commit 7f6b60899502c45fc0b58adf79d09fb77ffc8884.
2018-10-07Revert "Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakis"Ariel Ben-Yehuda-2/+10
This reverts commit 6810f5286b6b91daab06fc3dccb27d8c46f14349, reversing changes made to 8586ec6980462c99a8926646201b2444d8938d29.
2018-10-02Accept trailing comma in `cfg_attr`Vadim Petrochenkov-0/+1
2018-09-21Stabilize crate_in_paths, extern_absolute_paths and extern_prelude on all ↵Eduard-Mihai Burtescu-14/+7
editions.
2018-09-17Auto merge of #54277 - petrochenkov:afterder, r=alexcrichtonbors-40/+70
Temporarily prohibit proc macro attributes placed after derives ... and also proc macro attributes used together with `#[test]`/`#[bench]`. Addresses item 6 from https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393. The end goal is straightforward predictable left-to-right expansion order for attributes. Right now derives are expanded last regardless of their relative ordering with macro attributes and right now it's simpler to temporarily prohibit macro attributes placed after derives than changing the expansion order. I'm not sure whether the new beta is already released or not, but if it's released, then this patch needs to be backported, so the solution needs to be minimal. How to fix broken code (derives): - Move macro attributes above derives. This won't change expansion order, they are expanded before derives anyway. Using attribute macros on same items with `#[test]` and `#[bench]` is prohibited for similar expansion order reasons, but this one is going to be reverted much sooner than restrictions on derives. How to fix broken code (test/bench): - Enable `#![feature(plugin)]` (don't ask why). r? @ghost
2018-09-16Temporarily prohibit proc macro attributes placed after derivesVadim Petrochenkov-40/+70
... and also proc macro attributes used together with test/bench.
2018-09-16Rollup merge of #54181 - vi:hint_and_or, r=estebankGuillaume Gomez-0/+33
Suggest && and || instead of 'and' and 'or' Resolves #54109. Note: competing pull reqeust: #54179 r? @csmoe
2018-09-15issue 54109: use short suggestionsVitaly _Vi Shukela-4/+4
2018-09-14Auto merge of #53751 - F001:tuple-struct-self-ctor, r=petrochenkov,varkorbors-0/+3
Implement RFC 2302: tuple_struct_self_ctor Tracking issue: https://github.com/rust-lang/rust/issues/51994
2018-09-13Auto merge of #54168 - kennytm:rollup, r=kennytmbors-2/+40
Rollup of 11 pull requests Successful merges: - #53371 (Do not emit E0277 on incorrect tuple destructured binding) - #53829 (Add rustc SHA to released DWARF debuginfo) - #53950 (Allow for opting out of ThinLTO and clean up LTO related cli flag handling.) - #53976 (Replace unwrap calls in example by expect) - #54070 (Add Error::description soft-deprecation to RELEASES) - #54076 (miri loop detector hashing) - #54119 (Add some unit tests for find_best_match_for_name) - #54147 (Add a test that tries to modify static memory at compile-time) - #54150 (Updated 1.29 release notes with --document-private-items flag) - #54163 (Update stage 0 to latest beta) - #54170 (COMPILER_TESTS.md has been moved)
2018-09-13Use span_suggestion_with_applicability for "and/or" hinterVitaly _Vi Shukela-4/+24
Advised by @estebank.
2018-09-14Rollup merge of #54119 - phansch:unit_test_find_best_match_for_name, ↵kennytm-2/+40
r=nikomatsakis Add some unit tests for find_best_match_for_name There were only some UI tests that covered this function. Since there's more diagnostic work going on, I think it makes sense to have this unit tested.
2018-09-13Suggest && and || instead of 'and' and 'or'Vitaly _Vi Shukela-0/+13
Closes #54109.
2018-09-13introduce SelfCtorF001-11/+2
2018-09-13implement feature tuple_struct_self_ctorF001-0/+12
2018-09-13resolve: Put different parent scopes into a single structureVadim Petrochenkov-3/+3
2018-09-12Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakisbors-10/+2
stabilize outlives requirements https://github.com/rust-lang/rust/issues/44493 r? @nikomatsakis
2018-09-12Rollup merge of #54072 - blitzerr:master, r=Mark-Simulacrumkennytm-30/+3
Stabilization change for mod.rs This change is in response to https://github.com/rust-lang/rust/issues/53125. The patch makes the feature accepted and removes the tests that tested the non-accepted status of the feature.
2018-09-11Auto merge of #53913 - petrochenkov:biattr4, r=alexcrichtonbors-5/+4
resolve: Future proof resolutions for potentially built-in attributes This is not full "pass all attributes through name resolution", but a more conservative solution. If built-in attribute is ambiguous with any other macro in scope, then an error is reported. What complications arise with the full solution - https://github.com/rust-lang/rust/pull/53913#issuecomment-418204136. cc https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393 cc https://github.com/rust-lang/rust/issues/52269 Closes https://github.com/rust-lang/rust/issues/53531
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-10/+2
Co-authored-by: nikomatsakis
2018-09-11Auto merge of #51363 - japaric:stable-used, r=cramertjbors-7/+4
stabilize #[used] closes #40289 RFC for stabilization: rust-lang/rfcs#2386 r? @Centril Where should this be documented? Currently the documentation is in the unstable book
2018-09-11Add some unit tests for find_best_match_for_namePhilipp Hansch-2/+40
There were only some UI tests that covered this function. Since there's more diagnostic work going on, I think it makes sense to have this unit tested.
2018-09-11Auto merge of #54092 - estebank:gotta-go-fast, r=nikomatsakisbors-26/+23
Don't compute padding of braces unless they are unmatched Follow up to #53949. Attempt to fix # #54083. r? @nikomatsakis
2018-09-11resolve: Support resolving identifier macros without their own IDVadim Petrochenkov-5/+4
Invocation/expansion ID (aka `Mark`) is not really necessary for resolving a macro path. What is really necessary is its parent module, parent expansion and parent legacy scope. This is required for validation resolutions of built-in attributes, which don't get their own `Mark`s
2018-09-10Auto merge of #54093 - petrochenkov:noinner, r=alexcrichtonbors-8/+26
Feature gate non-builtin attributes in inner attribute position Closes item 3 from https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393
2018-09-10bump versionJorge Aparicio-1/+1
2018-09-10resolve: Remove `unshadowable_attrs`Vadim Petrochenkov-2/+0
2018-09-10Feature gate non-builtin attributes in inner attribute positionVadim Petrochenkov-8/+26
2018-09-09Don't compute padding of braces unless they are unmatchedEsteban Küber-26/+23
2018-09-09Auto merge of #53778 - petrochenkov:shadrelax2, r=nikomatsakisbors-0/+4
resolve: Relax shadowing restrictions on macro-expanded macros Previously any macro-expanded macros weren't allowed to shadow macros from outer scopes. Now only "more macro-expanded" macros cannot shadow "less macro-expanded" macros. See comments to `fn may_appear_after` and added tests for more details and examples. The functional changes are a21f6f588fc28c97533130ae44a6957b579ab58c and 46dd365ce9ca0a6b8653849b80267763c542842a, other commits are refactorings.
2018-09-09Auto merge of #54057 - matthiaskrgr:stabilize-edition-plus-clippy, ↵bors-1/+1
r=Mark-Simulacrum Stabilize edition 2018; also updates Clippy, RLS and Cargo Supersedes https://github.com/rust-lang/rust/pull/53999 , https://github.com/rust-lang/rust/pull/53935 Clippy build was failing there because crate_visibility_modifier feature was taken out of edition 2018 and clippy used it. The clippy update enables the corresponding feature explicitly. r? @Mark-Simulacrum
2018-09-09stabilize `#[used]`Jorge Aparicio-7/+4
closes #40289
2018-09-09Auto merge of #53902 - dtolnay:group, r=petrochenkovbors-103/+140
proc_macro::Group::span_open and span_close Before this addition, every delimited group like `(`...`)` `[`...`]` `{`...`}` has only a single Span that covers the full source location from opening delimiter to closing delimiter. This makes it impossible for a procedural macro to trigger an error pointing to just the opening or closing delimiter. The Rust compiler does not seem to have the same limitation: ```rust mod m { type T = } ``` ```console error: expected type, found `}` --> src/main.rs:3:1 | 3 | } | ^ ``` On that same input, a procedural macro would be forced to trigger the error on the last token inside the block, on the entire block, or on the next token after the block, none of which is really what you want for an error like above. This commit adds `group.span_open()` and `group.span_close()` which access the Span associated with just the opening delimiter and just the closing delimiter of the group. Relevant to Syn as we implement real error messages for when parsing fails in a procedural macro: https://github.com/dtolnay/syn/issues/476. ```diff impl Group { fn span(&self) -> Span; + fn span_open(&self) -> Span; + fn span_close(&self) -> Span; } ``` Fixes #48187 r? @alexcrichton
2018-09-08Rename sp_lo to sp_openDavid Tolnay-10/+10
2018-09-08Stabilization change for mod.rsRusty Blitzerr-30/+3
This change is in response to https://github.com/rust-lang/rust/issues/53125. The patch makes the feature accepted and removes the tests that tested the non-accepted status of the feature.
2018-09-08Track distinct spans for open and close delimiterDavid Tolnay-97/+134
2018-09-09Auto merge of #53949 - estebank:unclosed-delim, r=nikomatsakisbors-15/+69
Improve messages for un-closed delimiter errors
2018-09-09Remove crate_visibility_modifier from 2018 editionMark Rousskov-1/+1
2018-09-08Add test cases for possible restricted shadowing configurationsVadim Petrochenkov-0/+4
Whitelist `#[rustc_transparent_macro]` so it's not interpreted as a potential attribute macro
2018-09-08Auto merge of #51366 - japaric:stable-panic-impl, r=Mark-Simulacrumbors-5/+2
stabilize #[panic_handler] closes #44489 ### Update(2018-09-07) This was proposed for stabilization in https://github.com/rust-lang/rust/issues/44489#issuecomment-398965881 and its FCP with disposition to merge / accept is nearly over. The summary of what's being stabilized can be found in https://github.com/rust-lang/rust/issues/44489#issuecomment-416645946 Documentation PRs: - Reference. https://github.com/rust-lang-nursery/reference/pull/362 - Nomicon. https://github.com/rust-lang-nursery/nomicon/pull/75 --- `#[panic_implementation]` was implemented recently in #50338. `#[panic_implementation]` is basically the old `panic_fmt` language item but in a less error prone (\*) shape. There are still some issues and questions to sort out around this feature (cf. #44489) but this PR is meant to start a discussion about those issues / questions with the language team. (\*) `panic_fmt` was not type checked; changes in its function signature caused serious, silent binary size regressions like the one observed in #43054 Some unresolved questions from #44489: > Should the Display of PanicInfo format the panic information as "panicked at 'reason', > src/main.rs:27:4", as "'reason', src/main.rs:27:4", or simply as "reason". The current implementation formats `PanicInfo` as the first alternative, which is how panic messages are formatted by the `std` panic handler. The `Display` implementation is more than a convenience: `PanicInfo.message` is unstable so it's not possible to replicate the `Display` implementation on stable. > Is this design compatible, or can it be extended to work, with unwinding implementations for > no-std environments? I believe @whitequark made more progress with unwinding in no-std since their last comment in #44489. Perhaps they can give us an update? --- Another unresolved question is where this feature should be documented. The feature currently doesn't have any documentation. cc @rust-lang/lang cc @jackpot51 @alevy @phil-opp
2018-09-07stabilize `#[panic_handler]`Jorge Aparicio-5/+2
2018-09-06Validate syntax of `cfg` attributesVadim Petrochenkov-13/+47
2018-09-05Change wording of unclosed delimiter labelEsteban Küber-1/+4
2018-09-05Provide more context for unenclosed delimitersEsteban Küber-13/+64
* When encountering EOF, point at the last opening brace that does not have the same indentation level as its close delimiter. * When encountering the wrong type of close delimiter, point at the likely correct open delimiter to give a better idea of what went wrong.
2018-09-05Reword un-closed delimiter labelEsteban Küber-2/+2
2018-09-04Move #[test_case] to a syntax extensionJohn Renner-65/+17
2018-09-04Fix #[test] shadowing in macro_preludeJohn Renner-2/+3
2018-09-04Introduce Custom Test FrameworksJohn Renner-519/+131
2018-09-04Breaking change upgradesMark Rousskov-2/+2
2018-09-02Replace check() + bump() with eat()Seiichi Uchida-20/+10