about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-01-07Rollup merge of #57290 - mark-i-m:remove-outdated-comment, r=michaelwoeristerPietro Albini-3/+0
remove outdated comment https://github.com/rust-lang/rust/issues/44234 was closed, apparently solved by #45353 r? @michaelwoerister
2019-01-06Make sure feature gate errors are recoverable (take 2)Vadim Petrochenkov-3/+1
2019-01-05Rollup merge of #57343 - Xanewok:querify-access-levels, r=nikomatsakiskennytm-3/+0
Calculate privacy access only via query Initially converted to query in https://github.com/rust-lang/rust/commit/a9f6babcda1479f4e5566d1aadbf9a0d99aa3182 and then changed to respect dependencies https://github.com/rust-lang/rust/commit/8281e883dd12260f00ce650aa8824507d9c447af. I did this as an effort to prune `CrateAnalysis` from librustc_save_analysis, with the only thing remaining being the glob map (`name` is unused, existing `crate_name` is exposed in the compiler passes, instead). Since calculating the glob map is opt-in, it'd be great if we could calculate that on-demand. However, it seems that it'd require converting resolution to queries, which I'm not sure how to do yet. In an effort to get rid of `CrateAnalysis` altogether, could we try unconditionally calculating the glob_map in the resolver, thus completely removing `CrateAnalysis` struct, and doing a perf run? r? @nikomatsakis cc @petrochenkov do you have any idea how/if at all could we querify the resolver? I've stumbled upon a comment that's ~3? years old at the moment, so I'm guessing things might have changed and it actually may be feasible now. https://github.com/rust-lang/rust/blob/fe0c10019d7ee96909cc42cc265ef999a6b5dd70/src/librustc_driver/driver.rs#L589-L593
2019-01-05Rollup merge of #57314 - wiktorkuchta:master, r=Centrilkennytm-1/+1
Fix repeated word typos Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo ](https://github.com/e-maxx-eng/e-maxx-eng/pull/389) Not a stupid `sed`, I actually tried to fix case by case.
2019-01-05Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdaviskennytm-1/+1
Fix 'be be' constructs I noticed a duplicated "be" somewhere in the code. A search for it manifested a couple more locations with the same problem. This change removes one of the "be"s.
2019-01-05Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakisbors-72/+184
Add support for trait-objects without a principal The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate. Fixes #33140. Fixes #57057. r? @nikomatsakis
2019-01-04Remove unused name from CrateAnalysisIgor Matuszewski-1/+0
2019-01-04Replace CrateAnalysis::access_levels with queryIgor Matuszewski-2/+0
2019-01-04Update src/librustc/ty/fold.rsArtem Varaksa-1/+1
Co-Authored-By: wiktorkuchta <35867657+wiktorkuchta@users.noreply.github.com>
2019-01-04Auto merge of #56723 - oli-obk:lazy_const, r=nikomatsakisbors-350/+191
Don't emit `Unevaluated` from `const_eval` cc @eddyb @RalfJung
2019-01-04implement a hack to make traitobject 0.1.0 compileAriel Ben-Yehuda-2/+123
2019-01-04Revert "add coherence future-compat warnings for marker-only trait objects"Ariel Ben-Yehuda-55/+7
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
2019-01-04add comment to <List<ExistentialPredicates>>::principalAriel Ben-Yehuda-1/+25
2019-01-04avoid giving a principal to marker-only trait objectsAriel Ben-Yehuda-1/+1
Fixes #33140.
2019-01-04add support for principal-less trait object typesAriel Ben-Yehuda-14/+29
should be a pure refactoring.
2019-01-03Forbid impl Trait from referring to unnamable recursive typesMatthew Jasper-2/+72
There is no type T, such that `T = [T; 2]`, we should not allow this to be circumvented by impl Trait.
2019-01-03Fix repeated word typosWiktor Kuchta-1/+1
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-02Fix 'be be' constructsDaniel Mueller-1/+1
I noticed a duplicated "be" somewhere in the code. A search for it manifested a couple more locations with the same problem. This change removes one of the "be"s.
2019-01-02rename `type_moves_by_default` to `type_is_copy_modulo_regions`Niko Matsakis-10/+10
2019-01-02pacify the mercilous eddyb ;)Niko Matsakis-2/+4
2019-01-02add some comments about lifetimes etcNiko Matsakis-0/+18
2019-01-02improve handling for subtypeNiko Matsakis-23/+14
Still not great, but good enough to land this PR.
2019-01-02make evaluation track whether outlives relationships matteredNiko Matsakis-15/+21
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.
2019-01-02remove outdated commentMark Mansi-3/+0
2019-01-02Auto merge of #57250 - codeworm96:tyerr_msg, r=varkorbors-2/+2
Improve type mismatch error messages Closes #56115. Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing. TODO the book and clippy needs to be changed accordingly later. r? @varkor
2019-01-01Check the correct arenaOliver Scherer-1/+1
2019-01-01Remove unused functionOliver Scherer-8/+0
2019-01-01Macrofy more `Lift` implsOliver Scherer-200/+48
2019-01-01Properly lift `Allocations`Oliver Scherer-9/+2
2019-01-01what is going on?Oliver Scherer-7/+7
2019-01-01Git is drunkOliver Scherer-7/+7
2019-01-01rebase falloutOliver Scherer-6/+1
2019-01-01`<&'tcx ty::Const as Deref>::deref`Oliver Scherer-71/+50
2019-01-01Add `unwrap_usize` to `LazyConst`, tooOliver Scherer-9/+7
2019-01-01Mingw is special wrt type sizesOliver Scherer-1/+1
2019-01-01Move the `Unevaluated` constant arm upwards in the type structureOliver Scherer-91/+127
2019-01-01Auto merge of #55937 - davidtwco:issue-54943, r=pnkfelixbors-84/+117
NLL: User type annotations refactor, associated constant patterns and ref bindings. Fixes #55511 and Fixes #55401. Contributes to #54943. This PR performs a large refactoring on user type annotations, checks user type annotations for associated constants in patterns and that user type annotations for `ref` bindings are respected. r? @nikomatsakis
2018-12-31Improve type mismatch error messagesYuning Zhang-2/+2
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-31Clean up and optimize OpenTask / read_indexJohn Kåre Alsaker-6/+6
2018-12-31Auto merge of #57035 - Zoxc:query-pref9, r=michaelwoeristerbors-23/+34
Uninline some debugging code and use unlikely! macro r? @michaelwoerister
2018-12-30Stop well-formedness checking unreachable code.David Wood-23/+8
This commit stops well-formedness checking applying to unreachable code and therefore stops some of the ICEs that the intended solution taken by this PR causes. By disabling these checks, we can land the other fixes and larger refactors that this PR includes.
2018-12-30Always check well-formedness.David Wood-2/+22
This commit uses the map introduced by the previous commit to ensure that types are always checked for well-formedness by the NLL type check. Previously, without the map introduced by the previous commit, types would not be checked for well-formedness if the `AscribeUserType` statement that would trigger that check was removed as unreachable code.
2018-12-30Refactor `UserTypeAnnotation`.David Wood-81/+109
This commit refactors the `UserTypeAnnotation` type to be referred to by an index within `UserTypeProjection`. `UserTypeAnnotation` is instead kept in an `IndexVec` within the `Mir` struct. Further, instead of `UserTypeAnnotation` containing canonicalized types, it now contains normal types and the entire `UserTypeAnnotation` is canonicalized. To support this, the type was moved from the `rustc::mir` module to `rustc::ty` module.
2018-12-30Auto merge of #57158 - estebank:as-ref, r=zackmdavisbors-14/+14
Suggest `.as_ref()` when appropriate for `Option` and `Result` Fix #55198.
2018-12-29Auto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkovbors-12/+10
Implement RFC 2338, "Type alias enum variants" This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following. ```rust #![feature(type_alias_enum_variants)] enum Foo { Bar(i32), Baz { i: i32 }, } type Alias = Foo; fn main() { let t = Alias::Bar(0); let t = Alias::Baz { i: 0 }; match t { Alias::Bar(_i) => {} Alias::Baz { i: _i } => {} } } ``` Since `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern. Fixes issues #56199 and #56611. N.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible. ```rust Option::<u8>::None; // OK Option::None::<u8>; // OK, but lint in near future (hard error next edition?) Alias::<u8>::None; // OK Alias::None::<u8>; // Error ``` I do not know if this will need an FCP, but let's start one if so.
2018-12-29Use `same_type` instead of duplicating logicEsteban Küber-14/+14
2018-12-28Auto merge of #57118 - Zoxc:query-stats, r=wesleywiserbors-2/+106
Add a command line flag to print some query stats r? @michaelwoerister
2018-12-27Set a `def_id` in `ParamEnv` only with `-Z chalk`scalexm-1/+1
2018-12-27Integrate chalk enginescalexm-0/+17
2018-12-27Fix replacement of escaping bound typesscalexm-5/+12
Multiple references to the same `BoundTy` were not using the same result.