about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-10-05Auto merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavisbors-178/+146
Cleanup rustc/ty part 2 The second part of cleanups and minor improvements for rustc/ty. - improve allocations - calculate span after a possible early continue - simplify some patterns - mark a comment as FIXME - whitespace fixes The PR is independent from from the first part.
2018-10-05Auto merge of #54741 - oli-obk:impl_trait_hierarchy, r=cramertjbors-181/+152
Nest the `impl Trait` existential item inside the return type fixes #54045 r? @cramertj
2018-10-05Auto merge of #54336 - petrochenkov:preuni, r=alexcrichtonbors-403/+262
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-05Auto merge of #52121 - jebrosen:macros2_feature, r=petrochenkovbors-44/+42
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-05Reapply the macro_rules disambiguation changes from masterVadim Petrochenkov-20/+7
2018-10-05Reapply the derive helper changes from masterVadim Petrochenkov-37/+38
2018-10-05expansion: Remove restriction on use of macro attributes with test/benchVadim Petrochenkov-114/+44
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-05resolve: Keep more precise traces for expanded macro resolutionsVadim Petrochenkov-16/+16
`NameBinding`s instead of `Def`s
2018-10-05resolve: Merge resolution for `macro_rules` into the common early in-scope ↵Vadim Petrochenkov-253/+173
resolution function `fn resolve_legacy_scope`/`fn resolve_lexical_macro_path_segment` -> `fn early_resolve_ident_in_lexical_scope`
2018-10-05Auto merge of #54703 - davidtwco:issue-52086, r=nikomatsakisbors-12/+216
error message when trying to move from an Rc or Arc is ungreat Fixes #52086. r? @nikomatsakis
2018-10-05resolve: Support value namespace in `fn resolve_lexical_macro_path_segment`Vadim Petrochenkov-8/+17
2018-10-05expansion: Expand attribute macros registered by legacy plugins in usual ↵Vadim Petrochenkov-15/+3
left-to-right order
2018-10-05resolve: Integrate inert attributes registererd by legacy plugins into macro ↵Vadim Petrochenkov-11/+35
resolution
2018-10-05Auto merge of #54017 - alexcrichton:wasm-atomics2, r=sfacklerbors-4/+509
std: Start implementing wasm32 atomics This commit is an initial start at implementing the standard library for wasm32-unknown-unknown with the experimental `atomics` feature enabled. None of these changes will be visible to users of the wasm32-unknown-unknown target because they all require recompiling the standard library. The hope with this is that we can get this support into the standard library and start iterating on it in-tree to enable experimentation. Currently there's a few components in this PR: * Atomic fences are disabled on wasm as there's no corresponding atomic op and it's not clear yet what the convention should be, but this will change in the future! * Implementations of `Mutex`, `Condvar`, and `RwLock` were all added based on the atomic intrinsics that wasm has. * The `ReentrantMutex` and thread-local-storage implementations panic currently as there's no great way to get a handle on the current thread's "id" yet. Right now the wasm32 target with atomics is unfortunately pretty unusable, requiring a lot of manual things here and there to actually get it operational. This will likely continue to evolve as the story for atomics and wasm unfolds, but we also need more LLVM support for some operations like custom `global` directives for this to work best.
2018-10-04Auto merge of #54649 - nikomatsakis:universes-refactor-1, r=scalexmbors-1547/+1883
adopt "placeholders" to represent universally quantified regions This does a few preliminary refactorings that lay some groundwork for moving towards universe integration. Two things, primarily: - Rename from "skolemized" to "placeholder" - When instantiating `for<'a, 'b, 'c>`, just create one universe for all 3 regions, and distinguish them from one another using the `BoundRegion`. - This is more accurate, and I think that in general we'll be moving towards a model of separating "binder" (universe, debruijn index) from "index within binder" in a number of places. - In principle, it feels the current setup of making lots of universes could lead to us doing the wrong thing, but I've actually not been able to come up with an example where this is so. r? @scalexm cc @arielb1
2018-10-04Auto merge of #54666 - matthewjasper:mir-function-spans, r=pnkfelixbors-653/+665
[NLL] Improve "borrow later used here" messages * In the case of two conflicting borrows, the later used message says which borrow it's referring to * If the later use is a function call (from the users point of view) say that the later use is for the call. Point just to the function. r? @pnkfelix Closes #48643
2018-10-04s/skol_predicate/placeholder_predicateNiko Matsakis-2/+2
2018-10-04fix typo: s/tained/tainted/Niko Matsakis-1/+1
2018-10-04remove occurences of `skolemization`Niko Matsakis-53/+50
2018-10-04remove all occurences of `skolemize`Niko Matsakis-4/+4
2018-10-04build up the placeholder indices as we goNiko Matsakis-31/+43
Avoids a linear walk over the regions at the end.
2018-10-04extend NLL universe code to have >1 placeholder within one universeNiko Matsakis-124/+226
2018-10-04create just one subuniverse per binder -- no need for more, reallyNiko Matsakis-69/+37
2018-10-04reorder the placeholders and inference variables in hr::subNiko Matsakis-7/+9
2018-10-04rename skolemized to placeholderNiko Matsakis-211/+226
2018-10-04select.rs: rustfmtNiko Matsakis-1107/+1347
2018-10-04Auto merge of #54784 - Manishearth:clippyup, r=oli-obkbors-14/+24
Update clippy None
2018-10-04Auto merge of #54809 - pietroalbini:rollup, r=pietroalbinibors-75/+303
Rollup of 10 pull requests Successful merges: - #53523 (Add doc for impl From for Std Error) - #54746 (simplify some unused lints code) - #54761 (Make spec_extend use for_each()) - #54769 (Fix typo in CONTRIBUTING.md) - #54773 (Update a FIXME in memory.rs) - #54777 (abolish ICE when pretty-printing async block) - #54780 (Remove duplicate predicates in `explicit_predicates_of`) - #54788 (A handful of cleanups for rustc/mir) - #54789 (Introduce `TyKind::UnnormalizedProjection`) - #54795 (remove padding from multiline format string label) Failed merges: r? @ghost
2018-10-04Update Cargo.lockOliver Schneider-0/+1
2018-10-04Add features to the workspace hackOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-1/+5
2018-10-04Rollup merge of #54795 - euclio:ifmt-bad-arg, r=estebankPietro Albini-2/+22
remove padding from multiline format string label Fixes #53836.
2018-10-04Rollup merge of #54789 - scalexm:unnormalized, r=nikomatsakisPietro Albini-11/+58
Introduce `TyKind::UnnormalizedProjection` Introduce a new variant used for lazy normalization in chalk integration. Mostly `bug!` everywhere. r? @nikomatsakis
2018-10-04Rollup merge of #54788 - ljedrz:cleanup_rustc_mir, r=oli-obkPietro Albini-27/+22
A handful of cleanups for rustc/mir - use the "regular" `into()` instead of `graphviz::IntoCow` in `mod.rs` - `format!("{}", x)` > `x.to_string()` - remove one unnecessary `String` allocation - shorten the logic of one loop - `assert!(x == y)` > `assert_eq!(x, y)` - whitespace & formatting fixes r? @oli-obk
2018-10-04Rollup merge of #54780 - scalexm:dup-predicates, r=nikomatsakisPietro Albini-6/+36
Remove duplicate predicates in `explicit_predicates_of` I took a more brutal approach than described in #52187. I could have used the `linked_hash_map` crate but this seems overkill, especially as we need a vec storage in the end. r? @nikomatsakis
2018-10-04Rollup merge of #54777 - zackmdavis:async_pretty_ice, r=cramertjPietro Albini-0/+10
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-04Rollup merge of #54773 - rust-lang:wesleywiser-patch-1, r=oli-obkPietro Albini-1/+1
Update a FIXME in memory.rs In #51833, I improved the performance of `copy_undef_mask()`. As such, the old FIXME wasn't appropriate anymore. The main remaining thing left to do is to implement a fast path for non-overlapping copies (per @oli-obk). r? @oli-obk
2018-10-04Rollup merge of #54761 - Lucretiel:patch-1, r=cramertjPietro Albini-2/+2
Make spec_extend use for_each() `for_each` will use an iterator's own implementation of `try_fold`, which I understand to be generally preferable (because nested iterator adapter's will use each other's `try_fold` and be designed for the specific adaptation in a way that promotes performance and inlining.
2018-10-04Rollup merge of #54746 - llogiq:simplify-unused-lints, r=michaelwoeristerPietro Albini-26/+11
simplify some unused lints code Those are but small simplifications for readability.
2018-10-04Rollup merge of #53523 - phungleson:fix-impl-from-for-std-error, ↵Pietro Albini-0/+141
r=GuillaumeGomez Add doc for impl From for Std Error As part of issue #51430 (cc @skade). I am not sure if it is going to a correct direction so put up here so that people can comment.
2018-10-04Auto merge of #54638 - christianpoveda:master, r=kennytmbors-5/+26
Add checking for tool distribution in Tier 1 This fixes https://github.com/rust-lang/rust/issues/54483 r? @kennytm
2018-10-04Auto merge of #53851 - oli-obk:local_promotion, r=eddybbors-335/+484
Limit the promotion of const fns to the libstd and the `rustc_promotable` attribute There are so many questions around promoting const fn calls... it seems saner to try to limit automatic promotion to const fns which were explicitly opted in for promotion. I added the attribute to all public stable const fns that were already promotable (e.g. not Cell::new) in order to not cause any breakage r? @eddyb cc @nikomatsakis
2018-10-04Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakisbors-5/+328
handle outlives predicates in trait evaluation This handles higher-ranked outlives predicates in trait evaluation the same way they are handled in projection. Fixes #54302. I think this is a more correct fix than #54401 because it fixes the root case in evaluation instead of making evaluation used in less cases. However, we might want to go to a direction closer to @nikomatsakis's solution with Chalk. r? @nikomatsakis
2018-10-04Auto merge of #54447 - KiChjang:issue-54331, r=nikomatsakisbors-64/+176
Lower type ascriptions to HAIR and MIR Fixes #54331. r? @nikomatsakis
2018-10-03Auto merge of #54391 - davidtwco:issue-54230, r=petrochenkovbors-19/+296
suggest `crate::...` for "local" paths in 2018 Fixes #54230. This commit adds suggestions for unresolved imports in the cases where there could be a missing `crate::`, `super::`, `self::` or a missing external crate name before an import. r? @nikomatsakis
2018-10-03Clearer later use messages for callsMatthew Jasper-636/+607
Give a special message when the later use is from a call. Use the span of the callee instead of the whole expression. For conflicting borrow messages say that the later use is of the first borrow.
2018-10-03Record whether a Call in MIR corresponds to a call in HIRMatthew Jasper-17/+58
2018-10-03remove padding from multiline format string labelAndy Russell-2/+22
Fixes #53836.
2018-10-03Auto merge of #54605 - petrochenkov:mambig, r=alexcrichtonbors-23/+130
resolve: Disambiguate a subset of conflicts "macro_rules" vs "macro name in module" Currently if macro name may refer to both a `macro_rules` macro definition and a macro defined/imported into module we conservatively report an ambiguity error. Unfortunately, these errors became a source of regressions when macro modularization was enabled - see issue https://github.com/rust-lang/rust/issues/54472. This PR disambiguates such conflicts in favor of `macro_rules` if both the `macro_rules` item and in-module macro name are defined in the same normal (named) module and `macro_rules` is closer in scope to the point of use (see the tests for examples). This is a subset of more general approach described in https://github.com/rust-lang/rust/issues/54472#issuecomment-424666659. The subset is enough to fix all the regressions from https://github.com/rust-lang/rust/issues/54472, but it can be extended to apply to all "macro_rules" vs "macro name in module" conflicts in the future. To give an analogy, this is equivalent to scoping rules for `let` variables and items defined in blocks (`macro_rules` behaves like "`let` at module level" in general). ```rust { // beginning of the block use xxx::m; // (1) // Starting from the beginning of the block and until here m!() refers to (1) macro_rules! m { ... } // (2) // Starting from here and until the end of the block m!() refers to (2) } // end of the block ``` More complex examples with `use` and `macro_rules` from different modules still report ambiguity errors, even if equivalent examples with `let` are legal. Fixes https://github.com/rust-lang/rust/issues/54472 (stable-to-beta regression)
2018-10-03Fix `ty::UnnormalizedProjection` in rustdocscalexm-0/+1
2018-10-03Update clippyManish Goregaokar-14/+19