about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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-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
2018-09-01Auto merge of #53815 - F001:if-let-guard, r=petrochenkovbors-9/+32
refactor match guard This is the first step to implement RFC 2294: if-let-guard. Tracking issue: https://github.com/rust-lang/rust/issues/51114 The second step should be introducing another variant `IfLet` in the Guard enum. I separated them into 2 PRs for the convenience of reviewers. r? @petrochenkov
2018-09-01Auto merge of #53884 - kennytm:rollup, r=kennytmbors-0/+1
Rollup of 9 pull requests Successful merges: - #53076 (set cfg(rustdoc) when rustdoc is running on a crate) - #53622 (cleanup: Add main functions to some UI tests) - #53769 (Also link Clippy repo in the CONTRIBUTING.md file) - #53774 (Add rust-gdbgui script.) - #53781 (bench: libcore: fix build failure of any.rs benchmark (use "dyn Any")) - #53782 (Make Arc cloning mechanics clearer in module docs) - #53790 (Add regression test for issue #52060) - #53801 (Prevent duplicated impl on foreign types) - #53850 (Nuke the `const_to_allocation` query)
2018-09-01Rollup merge of #53076 - QuietMisdreavus:cfg-rustdoc, r=GuillaumeGomezkennytm-0/+1
set cfg(rustdoc) when rustdoc is running on a crate When using `#[doc(cfg)]` to document platform-specific items, it's a little cumbersome to get all the platforms' items to appear all at once. For example, the standard library adds `--cfg dox` to rustdoc's command line whenever it builds docs, and the documentation for `#![feature(doc_cfg)]` suggests using a Cargo feature to approximate the same thing. This is a little awkward, because you always need to remember to set `--features dox` whenever you build documentation. This PR proposes making rustdoc set `#[cfg(rustdoc)]` whenever it runs on a crate, to provide an officially-sanctioned version of this that is set automatically. This way, there's a standardized way to declare that a certain version of an item is specifically when building docs. To try to prevent the spread of this feature from happening too quickly, this PR also restricts the use of this flag to whenever `#![feature(doc_cfg)]` is active. I'm sure there are other uses for this, but right now i'm tying it to this feature. (If it makes more sense to give this its own feature, i can easily do that.)
2018-08-31feature(doc_cfg): set cfg(rustdoc) when rustdoc is runningQuietMisdreavus-0/+1
2018-08-31Implement the `min_const_fn` feature gateOliver Schneider-23/+34
2018-08-30Rollup merge of #53702 - jkozlowski:correct_version_for_macro_vis_matcher, ↵Pietro Albini-1/+1
r=cramertj Fix stabilisation version for macro_vis_matcher. r? @cramertj
2018-08-30Rollup merge of #53655 - jcpst:with_applicability, r=estebankPietro Albini-2/+12
set applicability Update a few more calls as described in #50723 r? @estebank
2018-08-30Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelixPietro Albini-33/+33
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc. Most of the compiler uses the `Fx` hasher but some places ended up with the default one.
2018-08-30Made std::intrinsics::transmute() const fn.thedarkula-0/+3
2018-08-30introduce Guard enumF001-9/+32
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-33/+33
2018-08-27Remove Node* prefix from AnnNodevarkor-23/+21
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-25call span_suggestion with applicabilityJoseph Post-2/+12
2018-08-26Auto merge of #53619 - japaric:panic-handler, r=SimonSapinbors-5/+15
add #[panic_handler]; deprecate #[panic_implementation] r? @SimonSapin cc #44489
2018-08-25Auto merge of #53612 - mark-i-m:anon_param_disallowed_2018, r=petrochenkovbors-1/+7
Remove anonymous trait params from 2018 and beyond cc @Centril @nikomatsakis cc #41686 rust-lang/rfcs#2522 #53272 This PR removes support for anonymous trait parameters syntactically in rust 2018 and onward. TODO: - [x] Add tests