about summary refs log tree commit diff
path: root/src/librustc/infer
AgeCommit message (Collapse)AuthorLines
2019-01-02make evaluation track whether outlives relationships matteredNiko Matsakis-1/+1
Previously, evaluation ignored outlives relationships. Since we using evaluation to skip the "normal" trait selection (which enforces outlives relationships) this led to incorrect results in some cases.
2018-12-29Use `same_type` instead of duplicating logicEsteban Küber-19/+12
2018-12-28Suggest `.as_ref()` when appropriate for `Option` and `Result`Esteban Küber-0/+74
2018-12-27Use `TraitEngine` in `enter_canonical_trait_query`scalexm-8/+12
2018-12-27Integrate chalk enginescalexm-3/+36
2018-12-25Remove licensesMark Rousskov-390/+0
2018-12-20Auto merge of #56219 - arielb1:never-coerce-box, r=nikomatsakisbors-0/+4
trigger unsized coercions keyed on Sized bounds This PR causes unsized coercions to not be disabled by `$0: Unsize<dyn Object>` coercion obligations when we have an `$0: Sized` obligation somewhere. This should be mostly backwards-compatible, because in these cases not doing the unsize coercion should have caused the `$0: Sized` obligation to fail. Note that `X: Unsize<dyn Object>` obligations can't fail *as obligations* if `X: Sized` holds, so this still maintains some version of monotonicity (I think that an unsized coercion can't be converted to no coercion by unifying type variables). Fixes #49593 (unblocking never_type). r? @eddyb cc @nikomatsakis
2018-12-19Auto merge of #54252 - arielb1:deref-query, r=nikomatsakisbors-0/+25
process nested obligations in autoderef Fixes #53843. r? @nikomatsakis
2018-12-19Auto merge of #56601 - Zoxc:lifetime-killer, r=nikomatsakisbors-2/+7
Make the 'a lifetime on TyCtxt useless cc @rust-lang/compiler r? @nikomatsakis
2018-12-18Auto merge of #56481 - arielb1:dynamic-order, r=nikomatsakisbors-4/+55
add coherence future-compat warnings for marker-only trait objects The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. Note: this lint should be made to default-warn before we merge. It is deny only for the crater run. r? @nikomatsakis / @scalexm . cc @Centril & @alexreg.
2018-12-17trigger unsized coercions keyed on Sized boundsAriel Ben-Yehuda-0/+4
This PR causes unsized coercions to not be disabled by `$0: Unsize<dyn Object>` coercion obligations when we have an `$0: Sized` obligation somewhere. Note that `X: Unsize<dyn Object>` obligations can't fail *as obligations* if `X: Sized` holds, so this still maintains some version of monotonicity (I think that an unsized coercion can't be converted to no coercion by unifying type variables). Fixes #49593 (unblocking never_type).
2018-12-16Rollup merge of #56742 - ljedrz:remove_query_response_box, r=oli-obkMazdak Farrokhzad-26/+25
infer: remove Box from a returned Iterator
2018-12-15address review commentsAriel Ben-Yehuda-3/+1
2018-12-15implement "isolated" autoderef using the Canonical mechanismAriel Ben-Yehuda-0/+27
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-4/+55
The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. It should be possible to revert this commit when we're done with the warnings.
2018-12-13Some changesJohn Kåre Alsaker-0/+2
2018-12-13Make the 'a lifetime on TyCtxt uselessJohn Kåre Alsaker-2/+5
2018-12-12Account for `impl Trait` when suggesting lifetimeEsteban Küber-11/+20
2018-12-12infer: remove Box from a returned Iteratorljedrz-26/+25
2018-12-08Auto merge of #56578 - alexreg:cosmetic-1, r=alexregbors-21/+21
Various minor/cosmetic improvements to code r? @Centril 😄
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-21/+21
2018-12-07Auto merge of #56258 - euclio:fs-read-write, r=eucliobors-3/+2
use top level `fs` functions where appropriate This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-07use top level `fs` functions where appropriateAndy Russell-3/+2
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-40/+40
2018-12-01Rollup merge of #56214 - scalexm:unification, r=nikomatsakiskennytm-96/+226
Implement chalk unification routines `ResolventOps` and `AggregateOps` are mostly straightforwardly translated from chalk. I had caught a few bugs already in my `chalk` branch and backported fixes to this branch, but there may be other ones left. EDIT: I hope there are none left now :) Fixes #54935.
2018-11-29Add inline attributes and add unit to CommonTypesJohn Kåre Alsaker-0/+2
2018-11-29Correctly generalize inference variables in `nll_relate`scalexm-11/+6
2018-11-29Fix doc commentsscalexm-5/+5
2018-11-29Handle inference variables in `nll_relate` and use it for chalkscalexm-96/+231
2018-11-29Rollup merge of #56257 - mark-i-m:rustc-guide-links, r=nikomatsakisGuillaume Gomez-11/+11
rustc-guide has moved to rust-lang/ r? @nikomatsakis
2018-11-26rustc-guide has movedMark Mansi-11/+11
2018-11-26Put all existential ty vars in the `ROOT` universescalexm-6/+12
2018-11-25Auto merge of #55906 - nnethercote:rm-OpenSnapshot-CommittedSnapshot, ↵bors-51/+44
r=nikomatsakis Clean up and streamline snapshot data structures These commits clean up the snapshot structures a bit, so they are more consistent with each other and with the `ena` crate. They also remove the `OpenSnapshot` and `CommittedSnapshot` entries in the undo log, just like I did for the `ena` crate in https://github.com/rust-lang-nursery/ena/pull/14. This PR in combination with that `ena` PR reduces instruction counts by up to 6% on benchmarks. r? @nikomatsakis. Note that this isn't quite ready for landing, because the `ena` dependency in the first commit needs to be updated once https://github.com/rust-lang-nursery/ena/pull/14 lands. But otherwise it should be good.
2018-11-25Remove `OpenSnapshot` and `CommittedSnapshot` markers from ↵Nicholas Nethercote-42/+32
`RegionConstraintCollector`. They're not strictly necessary, and they result in the `Vec` being allocated even for the trivial (and common) case where a `start_snapshot` is immediately followed by a `commit` or `rollback_to`. The commit also removes a now-unnecessary argument of `pop_placeholders()`.
2018-11-25Introduce `in_snapshot` and `assert_open_snapshot` methods.Nicholas Nethercote-4/+7
This makes the two snapshot implementations more consistent with each other and with crate `ena`.
2018-11-25Make `commit` and `rollback_to` methods take ownership of the snapshots.Nicholas Nethercote-1/+1
Because they shouldn't be reused. This provides consistency with the `ena` crate.
2018-11-25Rename `UndoLogEntry` as `UndoLog`.Nicholas Nethercote-6/+6
So that it matches `librustc_data_structures/snapshot_map/mod.rs` and the `ena` crate.
2018-11-24Move `BoundTy` debruijn index to the `TyKind` enum variantscalexm-8/+8
2018-11-24Instantiate all bound vars universallyscalexm-19/+30
2018-11-24Handle placeholder types in canonicalizationscalexm-20/+83
2018-11-24Add `HAS_TY_PLACEHOLDER` flagscalexm-2/+6
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-3/+4
2018-11-24Distinguish between placeholder kindsscalexm-7/+7
2018-11-21rustc: implement and use Default on more types.Eduard-Mihai Burtescu-11/+3
2018-11-21rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.Eduard-Mihai Burtescu-1/+1
2018-11-19Rollup merge of #56043 - nikomatsakis:issue-55756-via-outlives, r=eddybPietro Albini-7/+23
remove "approx env bounds" if we already know from trait Alternative to https://github.com/rust-lang/rust/pull/55988 that fixes #55756 -- smaller fix that I cannot see having (correctness) repercussions beyond the test at hand, and hence better for backporting. (Famous last words, I know.) r? @eddyb
2018-11-19Rollup merge of #55953 - blitzerr:master, r=nikomatsakisPietro Albini-3/+3
#53488 Refactoring UpvarId
2018-11-18remove "approx env bounds" if we already know from traitNiko Matsakis-7/+23
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-9/+9
fix various typos in doc comments
2018-11-15Rollup merge of #55778 - nnethercote:LrcPreds, r=eddybPietro Albini-2/+2
Wrap some query results in `Lrc`. So that the frequent clones in `try_get` are cheaper.