about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-4/+2
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2018-01-09Rollup merge of #47258 - rkruppe:struct-assert, r=eddybkennytm-4/+4
rustc::ty: Rename struct_variant to non_enum_variant r? @eddyb
2018-01-08rustc::ty: Rename `struct_variant` to `non_enum_variant`Robin Kruppe-4/+4
It is also intended for use with unions.
2018-01-07Rename ReprExtern to ReprC, and similarily rename a few other fields and ↵Robin Kruppe-8/+8
locals that mentioned "extern repr"
2018-01-01Fix docs for future pulldown migrationMalo Jaffré-2/+3
2017-12-26Implements RFC 1937: `?` in `main`Bastian Köcher-0/+2
This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function.
2017-12-21Auto merge of #46922 - kennytm:rollup, r=kennytmbors-17/+22
Rollup of 14 pull requests - Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918 - Failed merges:
2017-12-22Rollup merge of #46780 - varkor:contrib-5, r=arielb1kennytm-17/+22
Fix ICE when calling non-functions within closures The visitor for walking function bodies did not previously properly handle error-cases for function calls. These are now ignored, preventing the panic. This fixes #46771.
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-73/+75
The Generics now contain one Vec of an enum for the generic parameters, rather than two separate Vec's for lifetime and type parameters. Additionally, places that previously used Vec<LifetimeDef> now use Vec<GenericParam> instead.
2017-12-21Auto merge of #46754 - cramertj:refactor-arg-impl, r=nikomatsakisbors-13/+0
Refactor argument-position impl Trait Fixes https://github.com/rust-lang/rust/issues/46685, https://github.com/rust-lang/rust/issues/46470 r? @nikomatsakis cc @chrisvittal
2017-12-20extract `constrain_anon_types` to the `InferCtxt`Niko Matsakis-1/+1
No funtional change.
2017-12-20Auto merge of #46441 - gaurikholkar:single_lifetimes, r=nikomatsakisbors-14/+80
Lint against single-use lifetime names This is a fix for #44752 TO-DO - [x] change lint message - [x] add ui tests r? @nikomatsakis
2017-12-20adding lint for single use lifetime namesNiko Matsakis-14/+80
2017-12-18Fix tidy errorvarkor-1/+2
2017-12-18Add `delay_span_bug` and increase idiomaticityvarkor-3/+4
2017-12-18Fix the regressionvarkor-2/+2
2017-12-18Fix ICE when calling non-functions within closuresvarkor-17/+20
The visitor for walking function bodies did not previously properly handle error-cases for function calls. These are now ignored, preventing the panic.
2017-12-18Move middle::trans.rs to mir::mono.rsMaik Klein-189/+0
2017-12-18Rename TransItem to MonoItemMaik Klein-8/+8
2017-12-17Add sync module to rustc_data_structuresJohn Kåre Alsaker-1/+1
2017-12-15Refactor argument-position impl TraitTaylor Cramer-13/+0
2017-12-15Auto merge of #46706 - sunjay:gat-lifetimes, r=nikomatsakisbors-20/+67
Lifetime Resolution for Generic Associated Types Tracking Issue: https://github.com/rust-lang/rust/issues/44265 r? @nikomatsakis This PR implements lifetime resolution for generic associated types. :tada: ## Remaining Work Before Merge I'm going to go do these things in the next day or so. Please let me know if you spot anything in my changes until then. - [x] If I'm not mistaken, at least some tests should pass now. I need to go through the tests and re-enable the ones that should work by removing the appropriate `~ ERROR` comments
2017-12-14add trait aliases to HIRAlex Burka-1/+2
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-1/+1
2017-12-13Auto merge of #46616 - cramertj:impl-trait-elision, r=nikomatsakisbors-16/+37
Implement impl Trait lifetime elision Fixes #43396. There's one weird ICE in the interaction with argument-position `impl Trait`. I'm still debugging it-- I've left a test for it commented out with a FIXME. Also included a FIXME to ensure that `impl Trait` traits are caught under the lint in https://github.com/rust-lang/rust/issues/45992. r? @nikomatsakis
2017-12-12Trait item lifetime resolution for GATsSunjay Varma-20/+67
2017-12-13Resolve absolute paths as extern under a feature flagVadim Petrochenkov-0/+1
2017-12-12Implement impl Trait lifetime elisionTaylor Cramer-16/+37
2017-12-11make `krate` infallibleNiko Matsakis-4/+3
2017-12-11move `resolve_lifetimes` into a proper queryNiko Matsakis-130/+206
Now that we made `resolve_lifetimes` into a query, elision errors no longer abort compilation, which affects some tests. Also, remove `dep_graph_crosscontaminate_tables` -- there is no a path in the dep-graph, though red-green handles it. The same scenario is (correctly) tested by issue-42602.rs in any case.
2017-12-11resolve_lifetime: rustfmtNiko Matsakis-476/+721
2017-12-05Auto merge of #46305 - irinagpopa:backstory, r=alexcrichton,eddybbors-2/+2
Move rustc_back modules where they belong.
2017-12-04rustc_back: remove slice module in favor of std::slice::from_ref.Irina-Gabriela Popa-2/+2
2017-12-04move `free_regions_map` into `infer::outlives`Niko Matsakis-128/+3
2017-12-04replace constant regions with a post-inference checkNiko Matsakis-22/+29
Rather than declaring some region variables to be constant, and reporting errors when they would have to change, we instead populate each free region X with a minimal set of points (the CFG plus end(X)), and then we let inference do its thing. This may add other `end(Y)` points into X; we can then check after the fact that indeed `X: Y` holds. This requires a bit of "blame" detection to find where the bad constraint came from: we are currently using a pretty dumb algorithm. Good place for later expansion.
2017-12-01Auto merge of #46370 - michaelwoerister:rm-metadata-hashing, r=eddybbors-28/+2
incr.comp.: Remove ability to produce incr. comp. hashes during metadata export. This functionality has been superseded by on-import hashing, which can be less conservative and does not require extra infrastructure. r? @nikomatsakis
2017-11-29incr.comp.: Remove on-export crate metadata hashing.Michael Woerister-28/+2
2017-11-28incr.comp.: Make a bunch of query results encodable.Michael Woerister-0/+1
2017-11-26Rollup merge of #46259 - bjorn3:display_lang_item, r=nagisakennytm-1/+1
Derive Debug for LangItem
2017-11-26Auto merge of #46033 - sinkuu:const-enum-match-check, r=arielb1bors-3/+6
Do match-check for consts Fixes #43195 (ICE caused by building MIR that contains non-exausitive match)
2017-11-25Derive Debug for LangItembjorn3-1/+1
2017-11-25Auto merge of #46191 - eddyb:better-late-than-never, r=nikomatsakisbors-13/+0
rustc: don't mark lifetimes as early-bound in the presence of impl Trait. This hack from the original implementation shouldn't be needed anymore, thanks to @cramertj. r? @nikomatsakis
2017-11-25Conform namesShotaro Yamada-3/+3
2017-11-24Auto merge of #46093 - scottmcm:lower-128-mir, r=nagisabors-0/+28
Add a MIR pass to lower 128-bit operators to lang item calls Runs only with `-Z lower_128bit_ops` since it's not hooked into targets yet. This isn't really useful on its own, but the declarations for the lang items need to be in the compiler before compiler-builtins can be updated to define them, so this is part 1 of at least 3. cc https://github.com/rust-lang/rust/issues/45676 @est31 @nagisa
2017-11-24Do match-check before const MIR generationShotaro Yamada-3/+6
2017-11-22rustc: don't mark lifetimes as early-bound in the presence of impl Trait.Eduard-Mihai Burtescu-13/+0
2017-11-22Implement in-band lifetime bindingsTaylor Cramer-15/+90
2017-11-21Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1bors-4/+13
move closure kind, signature into `ClosureSubsts` Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects: - It means that the closure's type changes as inference finds out more things, which is very nice. - As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators). - It avoids cyclic closures calls. - These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410). We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed. r? @arielb1
2017-11-22Rollup merge of #46103 - ↵kennytm-9/+14
zackmdavis:dead_code_lint_should_say_never_constructed_for_variants, r=arielb1 dead code lint to say "never constructed" for variants As reported in #19140, #44083, and #44565, some users were confused when the dead-code lint reported an enum variant to be "unused" when it was matched on (but not constructed). This wording change makes it clearer that the lint is in fact checking for construction. We continue to say "used" for all other items (it's tempting to say "called" for functions and methods, but this turns out not to be correct: functions can be passed as arguments and the dead-code lint isn't special-casing that or anything). Resolves #19140. r? @pnkfelix
2017-11-21Auto merge of #45701 - cramertj:impl-trait-this-time, r=eddybbors-12/+126
impl Trait Lifetime Handling This PR implements the updated strategy for handling `impl Trait` lifetimes, as described in [RFC 1951](https://github.com/rust-lang/rfcs/blob/master/text/1951-expand-impl-trait.md) (cc #42183). With this PR, the `impl Trait` desugaring works as follows: ```rust fn foo<T, 'a, 'b, 'c>(...) -> impl Foo<'a, 'b> { ... } // desugars to exists type MyFoo<ParentT, 'parent_a, 'parent_b, 'parent_c, 'a, 'b>: Foo<'a, 'b>; fn foo<T, 'a, 'b, 'c>(...) -> MyFoo<T, 'static, 'static, 'static, 'a, 'b> { ... } ``` All of the in-scope (parent) generics are listed as parent generics of the anonymous type, with parent regions being replaced by `'static`. Parent regions referenced in the `impl Trait` return type are duplicated into the anonymous type's generics and mapped appropriately. One case came up that wasn't specified in the RFC: it's possible to write a return type that contains multiple regions, neither of which outlives the other. In that case, it's not clear what the required lifetime of the output type should be, so we generate an error. There's one remaining FIXME in one of the tests: `-> impl Foo<'a, 'b> + 'c` should be able to outlive both `'a` and `'b`, but not `'c`. Currently, it can't outlive any of them. @nikomatsakis and I have discussed this, and there are some complex interactions here if we ever allow `impl<'a, 'b> SomeTrait for AnonType<'a, 'b> { ... }`, so the plan is to hold off on this until we've got a better idea of what the interactions are here. cc #34511. Fixes #44727.