about summary refs log tree commit diff
path: root/src/librustc_trait_selection/traits
AgeCommit message (Collapse)AuthorLines
2020-04-17record await span inside GeneratorInteriorTypeCausecsmoe-12/+18
2020-04-16mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.Eduard-Mihai Burtescu-3/+12
2020-04-16Rollup merge of #71179 - matthiaskrgr:cl6ppy, r=Dylan-DPCDylan DPC-13/+13
fix more clippy warnings
2020-04-16Rollup merge of #71141 - Duddino:master, r=estebankDylan DPC-1/+22
Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa Fixes #71089
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-11/+11
2020-04-15Fix clippy warningsMatthias Krüger-2/+2
clippy::{filter_next,single_char_pattern,unit_arg,identity_conversion,nonminimal_bool}
2020-04-15Provide better compiler output when using `?` on `Option` in fn returning ↵Duddino-2/+2
`Result` and vice-versa
2020-04-14Provide better compiler output when using `?` on `Option` in fn returning ↵Duddino-1/+22
`Result` and vice-versa
2020-04-14traits/query/normalize: add some `debug!` logging for the result.Eduard-Mihai Burtescu-2/+13
2020-04-14Auto merge of #70679 - tmandry:issue-68112, r=nikomatsakisbors-82/+162
Improve async-await/generator obligation errors in some cases Fixes #68112. This change is best read one commit at a time (I add a test at the beginning and update it in each change after). The `test2` function is a case I found while writing the test that we don't handle with this code yet. I don't attempt to fix it in this PR, but it's a good candidate for future work. r? @davidtwco, @nikomatsakis
2020-04-13Incorporate feedback into diagnosticsTyler Mandry-26/+18
2020-04-13Fix style nitsTyler Mandry-45/+37
2020-04-13Include type info when available for awaited exprTyler Mandry-6/+8
2020-04-13rustfmtTyler Mandry-26/+33
2020-04-13Don't double-annotate the same SpanTyler Mandry-1/+3
2020-04-13Use clearer message when obligation is caused by await exprTyler Mandry-34/+108
2020-04-13Use "generator" instead of "future" when appropriateTyler Mandry-16/+13
2020-04-13Don't annotate type when type is opaqueTyler Mandry-1/+6
2020-04-13Improve span labelTyler Mandry-10/+18
2020-04-13Use inner/outer generator naming instead of first/lastTyler Mandry-12/+13
I personally find this clearer.
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-7/+7
Rename fn_has_self_argument to fn_has_self_parameter Rename AssocItemKind::Method to AssocItemKind::Fn Refine has_no_input_arg Refine has_no_input_arg Revert has_no_input_arg Refine suggestion_descr Move as_def_kind into AssocKind Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Fix tidy check issue Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-12Remove usage of `DUMMY_HIR_ID` in calls to `ObligationClause::misc`marmeladema-12/+6
Use `ObligationClause::dummy()` when appropriate or replace `hir::DUMMY_HIR_ID` by `hir::CRATE_HIR_ID`, as used in `ObligationClause::dummy()`.
2020-04-11review commentsEsteban Küber-8/+8
2020-04-11review commentsEsteban Küber-2/+30
2020-04-11Try to use the first char in the trait name as type paramEsteban Küber-2/+2
2020-04-11Account for existing names when suggesting adding a type paramEsteban Küber-4/+5
2020-04-11Account for type params with boundsEsteban Küber-5/+6
2020-04-11review commentsEsteban Küber-92/+85
2020-04-11review commentsEsteban Küber-130/+139
2020-04-11Handle `impl Trait` where `Trait` has an assoc type with missing boundsEsteban Küber-21/+131
Fix #69638.
2020-04-11Auto merge of #70161 - cjgillot:query-arena, r=nikomatsakisbors-4/+8
Allocate some query results on an arena This avoids a cloning few `Lrc` and `Vec`s in the queries.
2020-04-10Auto merge of #70986 - marmeladema:issue70853/librustc_middle-local-def-id, ↵bors-1/+2
r=eddyb rustc_middle: return `LocalDefId` where possible in hir::map module This changes the return type of the following functions to return a `LocalDefId` instead of a `DefId`: * opt_local_def_id_from_node_id * opt_local_def_id * body_owner_def_id * local_def_id_from_node_id * get_parent_id This is another step in the right direction for #70853 This pull request will be followed by another (substantial one) which changes the return type of `local_def_id` function but this change being more invasive, we might want to wait for #70956 or #70961 (or some other form it) to land first.
2020-04-10Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddybMazdak Farrokhzad-20/+36
Use `PredicateObligation`s instead of `Predicate`s Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations. Subset of #69709. r? @eddyb
2020-04-10librustc_middle: return LocalDefId instead of DefId in body_owner_def_idmarmeladema-3/+3
2020-04-10librustc_middle: return LocalDefId instead of DefId in opt_local_def_idmarmeladema-1/+2
2020-04-08Small tweaks to required bound spanEsteban Küber-4/+12
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-18/+26
Keep more information about trait binding failures.
2020-04-08do_normalize_predicates: add delay_span_bugBastian Kauschke-1/+1
2020-04-08replace `has_local_value` with `needs_infer`Bastian Kauschke-7/+7
2020-04-08Rollup merge of #70892 - lcnr:interators_are_nice, r=nikomatsakisDylan DPC-155/+151
wf: refactor `compute_trait_ref` moves `extend_cause_with_original_assoc_item_obligation` out of `compute_trait_ref` and changes `trait_assoc_items` to an iterator. This saves us from building an unnecessary `Vec<_>` r? @eddyb i guess
2020-04-07wf: refactor `compute_trait_ref`Bastian Kauschke-155/+151
2020-04-07Rollup merge of #70857 - faern:use-assoc-int-float-consts, r=dtolnayDylan DPC-7/+3
Don't import integer and float modules, use assoc consts 2 Follow up to #70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :) r? @dtolnay
2020-04-07Auto merge of #70164 - eddyb:walk-generic-arg, r=nikomatsakisbors-114/+181
ty/walk: iterate `GenericArg`s instead of `Ty`s. Before this PR, `Ty::walk` only iterated over `Ty`s, but that's becoming an increasing problem with `const` generics, as `ty::Const`s in `Substs` are missed by it. By working with `GenericArg` instead, we can handle both `Ty`s and `ty::Const`s, but also `ty::Region`s, which used to require ad-hoc mechanisms such as `push_regions`. I've also removed `TraitRef::input_types`, as it's both long obsolete, and easy to misuse.
2020-04-07Use assoc integer constants in librustc_*Linus Färnstrand-7/+3
2020-04-07Rollup merge of #70821 - rkuhn:expose_suggestions_InferCtxtExt, r=eddybDylan DPC-1/+2
expose suggestions::InferCtxtExt for clippy This is very useful to do good async/await diagnostic reporting, for example for https://github.com/rust-lang/rust-clippy/pull/5423.
2020-04-06ty: remove `{Existential,}Trait{Ref,Predicate}::input_types`.Eduard-Mihai Burtescu-23/+39
2020-04-06ty: switch `Ty::walk` from `Ty` to `GenericArg`.Eduard-Mihai Burtescu-74/+94
2020-04-06traits/coherence: stop using `Ty::walk_shallow`.Eduard-Mihai Burtescu-19/+50
2020-04-06Update src/librustc_trait_selection/traits/error_reporting/suggestions.rsRoland Kuhn-1/+1
Co-Authored-By: varkor <github@varkor.com>
2020-04-05expose suggestions::InferCtxtExt for clippyRoland Kuhn-1/+2