about summary refs log tree commit diff
path: root/src/librustc/traits
AgeCommit message (Collapse)AuthorLines
2020-01-07Move structural_match to rustc::traits.Camille GILLOT-0/+221
2020-01-07Move ty::wf to traits.Camille GILLOT-3/+752
2020-01-07Make traits::util::* free functions.Camille GILLOT-165/+174
2020-01-07Move subst_and_normalize_erasing_regionsto rustc::ty.Camille GILLOT-26/+0
2020-01-07Move normalize_erasing_regions to rustc::ty.Camille GILLOT-79/+0
2020-01-07Make ↵Camille GILLOT-46/+48
rustc::traits::object_safety::{astconv_object_safety_violations,is_vtable_safe_method,object_safety_violations} free functions.
2020-01-07Make ↵Camille GILLOT-55/+53
rustc::traits::error_reporting::{recursive_type_with_infinite_size_error, report_object_safety_error} free functions.
2020-01-07Remove private methods from TyCtxt impl block: rustc::trait::object_safety.Camille GILLOT-501/+508
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-22/+19
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
2020-01-06Rollup merge of #67906 - varkor:silence-toogeneric, r=nagisaDylan DPC-0/+6
Silence `TooGeneric` error This error may be produced during intermediate failed attempts at evaluation of a generic const, which may nevertheless succeed later. Fixes https://github.com/rust-lang/rust/issues/66962. r? @eddyb
2020-01-05Silence `TooGeneric` errorvarkor-0/+6
This error may be produced during intermediate failed attempts at evaluation of a generic const, which may nevertheless succeed later.
2020-01-05Correctly check for opaque types in `assoc_ty_def`Matthew Jasper-1/+1
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-22/+19
2020-01-05Auto merge of #67808 - Marwes:projection_normalization_recurse, r=nikomatsakisbors-0/+3
perf: Don't recurse into types that do not need normalizing A bit speculative at this stage but profiling shows that type folding takes up a substantial amount of time during normalization which may indicate that many types may be folded despite there being nothing to normalize
2020-01-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-2/+1
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-5/+6
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-7/+7
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-3/+3
2020-01-02perf: Don't recurse into types that do not need normalizingMarkus Westerlind-0/+3
A bit speculative at this stage but profiling shows that type folding takes up a substantial amount of time during normalization which may indicate that many types may be folded despite there being nothing to normalize
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-9/+9
2019-12-30discriminant -> scrutineeMazdak Farrokhzad-3/+3
2019-12-30Blame user type in pat type error.Mazdak Farrokhzad-3/+9
2019-12-30MatchExpressionArmPattern -> PatternMazdak Farrokhzad-6/+4
Current name is too specific for incoming changes.
2019-12-30Auto merge of #67631 - oli-obk:polymorphic_promotion, r=wesleywiserbors-0/+3
Work around a resolve bug in const prop r? @wesleywiser @anp This isn't exposed right now, but further changes to rustc may start causing bugs without this.
2019-12-27Syntax for hir::Ty.Camille GILLOT-2/+2
2019-12-27Fix `Instance::resolve()` incorrectly returning specialized instancesWesley Wiser-0/+3
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes #66901
2019-12-26Syntax for hir::Expr.Camille GILLOT-12/+13
2019-12-24x.py fmt after previous deignoreMark Rousskov-221/+232
2019-12-24Rollup merge of #67543 - JohnTitor:regression-tests, r=CentrilMazdak Farrokhzad-1/+1
Add regression tests for fixed ICEs Closes #61747 (fixed from 1.41.0-nightly (4007d4ef2 2019-12-01)) Closes #66205 (fixed from 1.41.0-nightly (4007d4ef2 2019-12-01)) Closes #66270 (fixed by #66246) Closes #67424 (fixed by #67160) Also picking a minor nit up from #67071 with 101dd7bad9432730fa2f625ae43afcc2929457d4 r? @Centril
2019-12-22Format the worldMark Rousskov-2766/+2480
2019-12-23Use `is_none` instead of `if let`Yuki Okushi-1/+1
2019-12-22Rollup merge of #66877 - skinny121:const-eval-entry-points, r=oli-obkMazdak Farrokhzad-38/+13
Add simpler entry points to const eval for common usages. I found the `tcx.const_eval` API to be complex/awkward to work with, because of the inherent complexity from all of the different situations it is called from. Though it mainly used in one of the following ways: - Evaluates the value of a constant without any substitutions, e.g. evaluating a static, discriminant, etc. - Evaluates the value of a resolved instance of a constant. this happens when evaluating unevaluated constants or normalising trait constants. - Evaluates a promoted constant. This PR adds three new functions `const_eval_mono`, `const_eval_resolve`, and `const_eval_promoted` to `TyCtxt`, which each cater to one of the three ways `tcx.const_eval` is normally used.
2019-12-22Add simpler entry points to const eval for common usages.Ben Lewis-38/+13
2019-12-21Rollup merge of #67160 - matthewjasper:gat-generics, r=nikomatsakisMazdak Farrokhzad-5/+45
Make GATs less ICE-prone. After this PR simple lifetime-generic associated types can now be used in a compiling program. There are two big limitations: * #30472 has not been addressed in any way (see src/test/ui/generic-associated-types/iterable.rs) * Using type- and const-generic associated types errors because bound types and constants aren't handled by trait solving. * The errors are technically non-fatal, but they happen in a [part of the compiler](https://github.com/rust-lang/rust/blob/4abb0ad2731e9ac6fd5d64d4cf15b7c82e4b5a81/src/librustc_typeck/lib.rs#L298) that fairly aggressively stops compiling on errors. closes #47206 closes #49362 closes #62521 closes #63300 closes #64755 closes #67089
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-5/+5
2. mir::Mutability -> ast::Mutability.
2019-12-20Use `delay_span_bug` less oftenMatthew Jasper-5/+21
2019-12-20Check associated type implementations for generic mismatchesMatthew Jasper-0/+24
2019-12-20Rollup merge of #67285 - ohadravid:indicate-origin-of-where-type-parameter, ↵Mazdak Farrokhzad-1/+1
r=estebank Indicate origin of where type parameter for uninferred types Based on #65951 (which is not merge yet), fixes #67277. This PR improves a little the diagnostic for code like: ``` async fn foo() { bar().await; } async fn bar<T>() -> () {} ``` by showing: ``` error[E0698]: type inside `async fn` body must be known in this context --> unresolved_type_param.rs:9:5 | 9 | bar().await; | ^^^ cannot infer type for type parameter `T` declared on the function `bar` | ... ``` (The ``` declared on the function `bar` ``` part is new) A small side note: `Vec` and `slice` seem to resist this change, because querying `item_name()` panics, and `get_opt_name()` returns `None`. r? @estebank
2019-12-15Rollup merge of #67289 - estebank:unnamed-closure, r=CentrilMazdak Farrokhzad-1/+1
Do not ICE on unnamed future Fix #67252.
2019-12-14Do not ICE on unnamed futureEsteban Küber-1/+1
2019-12-14Indicate origin of where type parameter for uninferred typesOhad Ravid-1/+1
2019-12-13Auto merge of #65951 - estebank:type-inference-error, r=nikomatsakisbors-34/+85
Point at method call when type annotations are needed - Point at method call instead of whole expression when type annotations are needed. - Suggest use of turbofish on function and methods. Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082. Fixes https://github.com/rust-lang/rust/issues/40015 r? @nikomatsakis
2019-12-12Auto merge of #67079 - nnethercote:optimize-shallow_resolve_changed, ↵bors-11/+19
r=nikomatsakis Optimize `shallow_resolve_changed` r? @nikomatsakis
2019-12-11Auto merge of #65345 - ↵bors-83/+223
davidtwco:issue-64130-async-send-sync-error-improvements, r=nikomatsakis async/await: improve not-send errors, part 2 Part of #64130. Fixes #65667. This PR improves the errors introduced in #64895 so that they have specialized messages for `Send` and `Sync`. r? @nikomatsakis
2019-12-11erase regions instead of using `builtin_deref`Nicholas Matsakis-7/+18
The reason we were invoking `builtin_deref` was to enable comparisons when the type was `&T`. For the reasons outlined in the comment, those comparisons failed because the regions disagreed.
2019-12-11Auto merge of #66821 - eddyb:global-trait-caching, r=nikomatsakisbors-24/+23
rustc: allow non-empty ParamEnv's in global trait select/eval caches. *Based on #66963* This appears to alleviate the symptoms of #65510 locally (without fixing WF directly), and is potentially easier to validate as sound (since it's a more ad-hoc version of queries we already have). I'm opening this PR primarily to test the effects on perf. r? @nikomatsakis cc @rust-lang/wg-traits
2019-12-11Change `PendingPredicateObligation::stalled_on`'s type.Nicholas Nethercote-11/+19
From a `Vec<Ty>` to a `Vec<InferTy>`, because that's a more restrictive type. This is a perf win because the ultra-hot function `shallow_resolve_changed` has less pattern-matching to do.
2019-12-10Avoid invalid suggestion by checking the snippet in const fn callEsteban Küber-1/+22
2019-12-10Suggest setting type param on function callEsteban Küber-0/+24
2019-12-10Fix rebaseEsteban Küber-6/+6