summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-11-25resolve: Implement edition hygiene for imports and absolute pathsVadim Petrochenkov-16/+13
Use per-span hygiene in a few other places in resolve Prefer `rust_2015`/`rust_2018` helpers to comparing editions
2018-11-20Stabilize `extern_crate_item_prelude`Vadim Petrochenkov-3/+2
2018-11-20Fix stability hole with `static _`Oliver Scherer-0/+1
2018-11-20squashed form of #54145Nick Cameron-5/+13
Give each PathSegment a NodeId Store a resolved def on hir::PathSegment save-analysis: remove hacky, unnecessary code now that we have spans for every ident dump data for prefix path segments dump refs for path segments in save-analysis Requires adding path segments to the hir map Fix tests and rustdoc save-analysis: handle missing field names FIxes https://github.com/rust-lang-nursery/rls/issues/1031 rebasing and reviewer changes Primarily refactoring `(Ident, Option<NodeId>)` to `Segment` Fix tests and assertions; add some comments more reviewer changes
2018-11-17resolve: Check resolution consistency for import paths and multi-segment ↵Vadim Petrochenkov-0/+7
macro paths
2018-10-29Fix ordering of nested modules in non-mod.rs modsTaylor Cramer-0/+11
Flatten relative offset into directory path before adding inline (mod x { ... }) module names to the current directory path. Fix #55094
2018-10-29Remove redundant cloneShotaro Yamada-5/+4
2018-10-25Rollup merge of #55282 - sinkuu:redundant_clone, r=estebankPietro Albini-1/+1
Remove redundant clone
2018-10-25Rollup merge of #55269 - matthiaskrgr:typos_oct, r=zackmdavisPietro Albini-2/+2
fix typos in various places
2018-10-25Rollup merge of #54977 - estebank:macro-arg-parse, r=pnkfelixPietro Albini-1/+2
Accept `Option<Box<$t:ty>>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ``` Fix #25274.
2018-10-24Feature gate extern prelude additions from `extern crate` itemsVadim Petrochenkov-0/+3
Fix rustdoc and fulldeps tests
2018-10-23fix typos in various placesMatthias Krüger-2/+2
2018-10-23Remove redundant cloneShotaro Yamada-1/+1
2018-10-23Auto merge of #54778 - scottmcm:stabilize-ihle, r=pnkfelixbors-7/+9
Stabilize impl_header_lifetime_elision in 2015 ~~This is currently blocked on https://github.com/rust-lang/rust/issues/54902; it should be good after that~~ It's already stable in 2018; this finishes the stabilization. FCP completed (https://github.com/rust-lang/rust/issues/15872#issuecomment-417953153), proposal (https://github.com/rust-lang/rust/issues/15872#issuecomment-412759783). Tracking issue: https://github.com/rust-lang/rust/issues/15872 Usage examples (from libcore): https://github.com/rust-lang/rust/pull/54687
2018-10-21Fix a few tests with target-specific outputVadim Petrochenkov-1/+1
Enable one fully ignored test
2018-10-20Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasperbors-4/+5
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations The contents of `unwrap_or` are evaluated eagerly, so it's not a good pick in case of function calls and allocations. This PR also changes a few `unwrap_or`s with `unwrap_or_default`. An added bonus is that in some cases this change also reveals if the object it's called on is an `Option` or a `Result` (based on whether the closure takes an argument).
2018-10-19Add a stub feature so we can still test E0705Scott McMurray-4/+7
2018-10-19Stabilize impl_header_lifetime_elision in 2015Scott McMurray-4/+3
It's already stable in 2018; this finishes the stabilization.
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-8/+3
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-3/+3
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-4/+5
2018-10-15Rollup merge of #55025 - ehuss:missing-lifetime-err-msg, r=petrochenkovManish Goregaokar-5/+6
Add missing lifetime fragment specifier to error message. A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-14Support underscore as constant nameDonato Sciarra-1/+17
Issue: 54912
2018-10-12Add missing lifetime fragment specifier to error message.Eric Huss-5/+6
A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-12Rollup merge of #54967 - holmgr:master, r=estebankkennytm-0/+5
Remove incorrect span for second label inner macro invocation A fix for issue #54841
2018-10-12Auto merge of #53933 - GuillaumeGomez:codeblock-error-display, r=QuietMisdreavusbors-0/+13
Improve error display for codeblocks in rustdoc Part of #53919. r? @QuietMisdreavus
2018-10-11Auto merge of #54850 - mcr431:fix-54707-trait-function-from-macro, ↵bors-0/+17
r=nikomatsakis Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.
2018-10-10Accept `Option<Box<$t:ty>>` in macro argumentEsteban Küber-1/+2
Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ```
2018-10-10Rollup merge of #54893 - dsciarra:issue-54379, r=pnkfelixManish Goregaokar-0/+3
Fixes #47311. r? @nrc
2018-10-10Rollup merge of #54870 - flip1995:stabilize_tool_lints, r=ManishearthManish Goregaokar-3/+2
Fixes #47311. r? @nrc
2018-10-10Rollup merge of #54862 - Havvy:cfg_attr_multi, r=petrochenkovManish Goregaokar-18/+82
Fixes #47311. r? @nrc
2018-10-10Remove incorrect span for second label inner macro invocationholmgr-0/+5
2018-10-09Update feature-gate listingflip1995-3/+2
2018-10-08parse_trait_item_ now handles interpolated blocks as function body declsMatthew Russo-0/+17
2018-10-07cfg-attr-multi: Change issue number to actual tracking issueHavvy (Ryan Scheel)-1/+1
2018-10-07Auto merge of #54835 - ↵bors-23/+4
oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_sein, r=Centril Stabilize `min_const_fn` tracking issue: #53555 r? @Centril
2018-10-07Fix internal compiler error on malformed match arm pattern.Donato Sciarra-0/+3
Issue: 54379
2018-10-07cfg_attr_multi: Feature gateHavvy (Ryan Scheel)-1/+38
2018-10-05cfg_attr_multi: Basic implementationHavvy (Ryan Scheel)-17/+44
Does not implement the warning or a feature flag.
2018-10-05Rollup merge of #54833 - abonander:issue-54441, r=petrochenkovPietro Albini-15/+12
make `Parser::parse_foreign_item()` return a foreign item or error Fixes `Parser::parse_foreign_item()` to follow the convention of `parse_trait_item()` and `parse_impl_item()` in that it *must* parse an item or return an error, and then the caller is responsible for detecting the closing delimiter. This prevents it from looping endlessly on an unexpected token in `ext/expand.rs` where it was also leaking memory by continually pushing to `Parser::expected_tokens` via `Parser::check_keyword()`. closes #54441 r? @petrochenkov cc @dtolnay
2018-10-05Rollup merge of #54804 - euclio:inverted-parameters, r=estebankPietro Albini-1/+20
add suggestion for inverted function parameters Fixes #54065.
2018-10-05add suggestion for inverted function parametersAndy Russell-1/+20
Fixes #54065.
2018-10-05Auto merge of #54336 - petrochenkov:preuni, r=alexcrichtonbors-47/+30
resolve: Some refactorings in preparation for uniform paths 2.0 The main result is that in-scope resolution performed during macro expansion / import resolution is now consolidated in a single function (`fn early_resolve_ident_in_lexical_scope`), which can now be used for resolving first import segments as well when uniform paths are enabled. r? @ghost
2018-10-05Stabilize min_const_fn feature gateOliver Scherer-13/+2
2018-10-05Auto merge of #52121 - jebrosen:macros2_feature, r=petrochenkovbors-17/+19
Merge `proc_macro_` expansion feature gates as `proc_macro_hygiene` Merges `proc_macro_mod`, `proc_macro_expr`, `proc_macro_non_items`, and `proc_macro_gen` into a single feature: `proc_macro_hygiene`. These features are not all blocked on implementing macro hygiene *per se*, but rather on interactions with hygiene that have not been entirely resolved.
2018-10-05make `Parser::parse_foreign_item()` return a foreign item or errorAustin Bonander-15/+12
closes #54441
2018-10-05Stabilize `min_const_fn`Oliver Schneider-10/+2
2018-10-05expansion: Remove restriction on use of macro attributes with test/benchVadim Petrochenkov-47/+30
The restrictions were introduced in https://github.com/rust-lang/rust/pull/54277 and no longer necessary now because legacy plugins are now expanded in usual left-to-right order
2018-10-04Rollup merge of #54777 - zackmdavis:async_pretty_ice, r=cramertjPietro Albini-0/+3
abolish ICE when pretty-printing async block @jnetterf reported an ICE when the unused-parentheses lint triggered around an async block (#54752). In order to compose an autofixable suggestion, the lint invokes the pretty-printer on the unnecessarily-parenthesized expression. (One wonders why the lint doesn't just use `SourceMap::span_to_snippet` instead, to preserve the formatting of the original source?—but to answer that, you'd have to ask the author of 5c9f806d.) But then the pretty-printer panics when trying to call `<pprust::State as PrintState>::end` when `State.boxes` is empty. Empirically, the problem would seem to be solved if we start some "boxes" beforehand in the `ast::ExprKind::Async` arm of the big match in `print_expr_outer_attr_style`, exactly like we do in the immediately-preceding match arm for `ast::ExprKind::Block`—it would seem pretty ("pretty") reasonable for the pretty-printing of async blocks to work a lot like the pretty-printing of ordinary non-async blocks, right?? Of course, it would be shamefully cargo-culty to commit code on the basis of this kind of mere reasoning-by-analogy (in contrast to understanding the design of the pretty-printer in such detail that the correctness of the patch is comprehended with all the lucid certainty of mathematical proof, rather than being merely surmised by intuition). But maybe we care more about fixing the bug with high probability today, than with certainty in some indefinite hypothetical future? Maybe the effort is worth [a fifth of a shirt](https://hacktoberfest.digitalocean.com/stats/zackmdavis)?? Humbly resolves #54752. r? @cramertj
2018-10-03Update error id to an unused oneOliver Schneider-2/+2