summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2015-08-03Auto merge of #26783 - eddyb:methrec, r=huonwbors-36/+21
After #26694, the overloaded operator and "impl not known at method lookup time" cases started triggering the lint. I've also added checks for overloaded autoderef and method calls via paths (i.e. `T::method()`). All new 8 test cases did not trigger the lint before #26694. r? @huonw
2015-08-04rustc: replace def::MethodProvenance with ty::ImplOrTraitItemContainer.Eduard Burtescu-36/+21
2015-07-30Implement Win64 eh_personality natively.Vadim Chugunov-0/+6
2015-07-30Rollup merge of #26778 - jawline:master, r=pnkfelixManish Goregaokar-8/+8
Print the error message and then what is expected by the repeat count so the output makes more sense when there is an error in the const expression
2015-07-29Modified to add 'found' to error message closes #26485Blake Loring-8/+8
2015-07-29Replace illegal with invalid in most diagnosticsSimonas Kazlauskas-2/+1
2015-07-28Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddybbors-49/+36
this has quite some fallout. but also made lots of stuff more readable imo [breaking-change] for plugin authors
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-49/+36
2015-07-28rustc and rustc::borrowck: pass fragment info down into trans.Felix S. Klock II-0/+39
2015-07-28Auto merge of #26914 - alexcrichton:deprecate-easy, r=aturonbors-1/+0
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * box_heap * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-1/+0
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-26Auto merge of #27297 - mitaa:cleanup_E0005, r=alexcrichtonbors-18/+19
This does two things: * removes ast::LocalSource, where only one variant was used because for-loop expansion has changed. One reason that this slipped into here is because the code in `check_local` which checks for `LocalSource::LocalFor` would report the same error as in `check_exhaustive` while using the wrong error code (E0005 instead of E0297). * silences the warning about already used diagnostic code E0005 (fixes #27279) passes `make check` locally.
2015-07-26Sidestep warning about repeated E0005 `span_err!` invocation.mitaa-12/+19
Fixes #27279
2015-07-26Remove `ast::LocalSource` with only one used variantmitaa-7/+1
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-25Address tidyJared Roesch-7/+11
2015-07-25Rework cross crate error messagesJared Roesch-12/+43
2015-07-25Fix error message spansJared Roesch-26/+12
2015-07-25Correctly subst defaults with the in-scope substsJared Roesch-20/+30
2015-07-25Rebase fixesJared Roesch-10/+10
2015-07-25Refactor the default type parameter algorithmJared Roesch-22/+62
The algorithm was not correctly detecting conflicts after moving defaults into TypeVariableValue. The updated algorithm correctly detects and reports conflicts with information about where the conflict occured and which items the defaults were introduced by. The span's for said items are not being correctly attached and still need to be patched.
2015-07-25Fix bug with defaults not being restoredJared Roesch-10/+13
2015-07-25Remove defaults table and attach defaults directly to tyvarsJared Roesch-26/+73
2015-07-25Fix tidyJared Roesch-3/+4
2015-07-25Implement Default TyParam fallbackJared Roesch-6/+92
This patch allows type parameter defaults to influence type inference. This is a possible breaking change since it effects the way type inference works and will have different behavior when mixing defaults and literal fallback.
2015-07-25Auto merge of #27258 - nikomatsakis:issue-26952, r=eddybbors-31/+47
Correct regression in type-inference caused by failing to reconfirm that the object trait matches the required trait during trait selection. The existing code was checking that the object trait WOULD match (in a probe), but never executing the match outside of a probe. This corrects various regressions observed in the wild, including issue #26952. Fixes #26952. r? @eddyb cc @frankmcsherry
2015-07-25Auto merge of #26630 - eefriedman:recursive-static, r=pnkfelixbors-3/+23
***Edit: Fixed now.*** I'm pretty sure the way I'm using LLVMReplaceAllUsesWith here is unsafe... but before I figure out how to fix that, I'd like a reality-check: is this actually useful?
2015-07-24Add static_recursion feature gate.Eli Friedman-4/+26
2015-07-24Allow recursive static variables.Eli Friedman-3/+1
There isn't any particularly good reason for this restriction, so just get rid of it, and fix trans to handle this case.
2015-07-25Auto merge of #26963 - Manishearth:improve-diag, r=steveklabnikbors-1/+1
I'll be adding more commits to this PR as the weekend progresses. Was hoping to make this a mega-PR, but getting some eyes on this early would be nice too. r? @steveklabnik r? @eddyb on the object safety bits cc @michaelsproul Part of #24407
2015-07-24Auto merge of #27265 - steveklabnik:rollup, r=steveklabnikbors-0/+3
- Successful merges: #27137, #27145, #27177, #27193, #27212, #27220, #27229, #27235, #27238, #27244, #27251 - Failed merges:
2015-07-24Rollup merge of #27244 - Detegr:master, r=eddybSteve Klabnik-0/+3
Hi all. This is my first contribution to Rust and fixes an issue causing an invalid error message to be presented to the user when using unit struct as length of a repeat expression, issue #27008. The solution is based on suggestions by @oli-obk, but as I'm a complete newbie to this, I have no clue if I got them right :) The biggest concern I have is that if the `NodeId` I'm returning is the correct one or not (it's not meaningful in this case but I think it would be nice to get it right).
2015-07-24Auto merge of #27087 - nikomatsakis:closure-exploration, r=nrcbors-175/+286
Refactors the "desugaring" of closures to expose the types of the upvars. This is necessary to be faithful with how actual structs work. The reasoning of the particular desugaring that I chose is explained in a fairly detailed comment. As a side-effect, recursive closure types are prohibited unless a trait object intermediary is used. This fixes #25954 and also eliminates concerns about unrepresentable closure types that have infinite size, I believe. I don't believe this can cause regressions because of #25954. (As for motivation, besides #25954 etc, this work is also intended as refactoring in support of incremental compilation, since closures are one of the thornier cases encountered when attempting to split node-ids into item-ids and within-item-ids. The goal is to eliminate the "internal def-id" distinction in astdecoding. However, I have to do more work on trans to really make progress there.) r? @nrc
2015-07-24Correct regression in type-inference caused by failing to reconfirm thatNiko Matsakis-31/+47
the object trait matches the required trait during trait selection. The existing code was checking that the object trait WOULD match (in a probe), but never executing the match outside of a probe. This corrects various regressions observed in the wild, including issue #26952. Fixes #26952.
2015-07-24Auto merge of #27215 - pnkfelix:fsk-placer-take-5-just-in, r=nikomatsakisbors-10/+46
Macro desugaring of `in PLACE { BLOCK }` into "simpler" expressions following the in-development "Placer" protocol. Includes Placer API that one can override to integrate support for `in` into one's own type. (See [RFC 809].) [RFC 809]: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-and-in-for-stdlib.md Part of #22181 Replaced PR #26180. Turns on the `in PLACE { BLOCK }` syntax, while leaving in support for the old `box (PLACE) EXPR` syntax (since we need to support that at least until we have a snapshot with support for `in PLACE { BLOCK }`. (Note that we are not 100% committed to the `in PLACE { BLOCK }` syntax. In particular I still want to play around with some other alternatives. Still, I want to get the fundamental framework for the protocol landed so we can play with implementing it for non `Box` types.) ---- Also, this PR leaves out support for desugaring-based `box EXPR`. We will hopefully land that in the future, but for the short term there are type-inference issues injected by that change that we want to resolve separately.
2015-07-24nitsNiko Matsakis-10/+5
2015-07-24Unify the upvar variables found in closures with the actual types of theNiko Matsakis-140/+87
upvars after analysis is done. Remove the `closure_upvars` helper and just consult this list of type variables directly.
2015-07-24Don't be so eager to call unresolved inference variables an error. MCNiko Matsakis-1/+9
is being used now before the final regionck stage and in some cases SOME amount of unresolved inference is OK. In fact, we could probably just allow inference variables as well with only minimal pain.
2015-07-24Add some debugging to help identify when errors get reported.Niko Matsakis-2/+11
2015-07-24Introduce ClosureSubsts rather than just having random fields in theNiko Matsakis-56/+185
TyClosure variant; thread this through wherever closure substitutions are expected, which leads to a net simplification. Simplify trans treatment of closures in particular.
2015-07-24introduce a Vec<Ty> to TyClosure for storing upvar typesNiko Matsakis-31/+54
2015-07-24Auto merge of #26583 - eefriedman:lint-ffi, r=nrcbors-124/+12
Makes the lint a bit more accurate, and improves the quality of the diagnostic messages by explicitly returning an error message.
2015-07-23Rewrite the improper_ctypes lint.Eli Friedman-124/+12
Makes the lint a bit more accurate, and improves the quality of the diagnostic messages by explicitly returning an error message. The new lint is also a little more aggressive: specifically, it now rejects tuples, and it recurses into function pointers.
2015-07-23review feedback: Use checked-arith instead of saturated-arith for ↵Felix S. Klock II-2/+2
`push_unsafe!` and `pop_unsafe!`.
2015-07-23eval_const_expr_partial now returns ConstVal::Struct instead of None for ↵Antti Keränen-0/+3
unit-struct path expressions. Fixes #27008
2015-07-23Move E0006 into E0005Manish Goregaokar-1/+1
2015-07-22Resolve lifetime parameters for foreign functions.Eli Friedman-1/+24
Pretty straightforward; just need to make sure to explicitly handle the generic parameters of each ast::ForeignItemFn. Fixes #26587.
2015-07-22Rollup merge of #27127 - AlisdairO:diagnostics172, r=ManishearthSteve Klabnik-1/+1
As title :-) Part of #24407. r? @Manishearth
2015-07-22Instrumentation in effort to understand treatment of `allow_internal_unstable`.Felix S. Klock II-2/+12
It is all `debug!` instrumentation so it should not impose a cost on non-debug builds.
2015-07-22prototype Placer protocol for unstable overloaded-box and placement-in.Felix S. Klock II-0/+5
2015-07-22Hack for "unsafety hygiene" -- `push_unsafe!` and `pop_unsafe!`.Felix S. Klock II-8/+29
Even after expansion, the generated expressions still track depth of such pushes (i.e. how often you have "pushed" without a corresponding "pop"), and we add a rule that in a context with a positive `push_unsafe!` depth, it is effectively an `unsafe` block context. (This way, we can inject code that uses `unsafe` features, but still contains within it a sub-expression that should inherit the outer safety checking setting, outside of the injected code.) This is a total hack; it not only needs a feature-gate, but probably should be feature-gated forever (if possible). ignore-pretty in test/run-pass/pushpop-unsafe-okay.rs