about summary refs log tree commit diff
path: root/src/librustc/traits
AgeCommit message (Collapse)AuthorLines
2019-12-10Deduplicate logicEsteban Küber-40/+32
2019-12-10Point at method call when type annotations are neededEsteban Küber-6/+20
2019-12-08async/await: correct diag note for `async move`David Wood-10/+11
This commit corrects the diagnostic note for `async move {}` so that `await` is mentioned, rather than `yield`. Signed-off-by: David Wood <david@davidtw.co>
2019-12-08async/await: more improvements to non-send errorsDavid Wood-83/+211
Signed-off-by: David Wood <david@davidtw.co>
2019-12-06Rollup merge of #67071 - estebank:issue-66868, r=davidtwcoMazdak Farrokhzad-0/+4
Do not ICE on closure typeck Tackle #66868. r? @davidtwco
2019-12-06Rename to `then_some` and `then`varkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-5/+1
2019-12-05Do not ICE on closure typeckEsteban Küber-0/+4
Tackle #66868.
2019-12-03Rollup merge of #66651 - Areredify:on-unimplemented-scope, r=davidtwcoMazdak Farrokhzad-14/+49
Add `enclosing scope` parameter to `rustc_on_unimplemented` Adds a new parameter to `#[rustc_on_unimplemented]`, `enclosing scope`, which highlights the function or closure scope with a message. The wip part refers to adding this annotation to `Try` trait to improve ergonomics (which I don't know how to do since I change both std and librustc) Closes #61709.
2019-12-02rustc: allow non-empty ParamEnv's in global trait select/eval caches.Eduard-Mihai Burtescu-8/+4
2019-12-02rustc: include ParamEnv in global trait select/eval cache keys.Eduard-Mihai Burtescu-16/+19
2019-11-29allow customising ty::TraitRef's printing behaviorMikhail Babenko-12/+14
fix clippy allow customising ty::TraitRef's printing behavior fix clippy stylistic fix
2019-11-29Auto merge of #66590 - Aaron1011:fix/real-impl-trait-coherence, r=varkorbors-15/+33
Apply proper commit from PR #63934 While working on PR #63934, I accidentally reverted to an older version of the PR while working on a rebase. The PR was then merged, not with the later, approved changes, but with earlier, unapproved changes. This PR applies the changes that were *suppoesd* to be mereged in PR #63934. All of the proper tests appear to have been merged in PR #63934, so this PR adds no new tests
2019-11-28review commentsEsteban Küber-1/+76
2019-11-28Deduplicate type param constraint suggestion codeEsteban Küber-65/+16
2019-11-28Apply proper commit from PR #63934Aaron Hill-15/+33
While working on PR #63934, I accidentally reverted to an older version of the PR while working on a rebase. The PR was then merged, not with the later, approved changes, but with earlier, unapproved changes. This PR applies the changes that were *suppoesd* to be mereged in PR #63934. All of the proper tests appear to have been merged in PR #63934, so this PR adds no new tests Fixes #66580
2019-11-27Rollup merge of #66798 - bwignall:typo, r=varkorTyler Mandry-3/+3
Fix spelling typos Should be non-semantic. Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
2019-11-27Rollup merge of #66700 - VirrageS:master, r=matthewjasperTyler Mandry-1/+1
Fix pointing at arg for fulfillment errors in function calls Closes: https://github.com/rust-lang/rust/issues/66258
2019-11-26Fix spelling typosBrian Wignall-3/+3
2019-11-25add `enclosing_scope` param to `rustc_on_unimplmented`Mikhail Babenko-14/+49
add ui test compute enclosing_scope_span on demand add scope test make tidy happy stylistic and typo fixes
2019-11-24Fix pointing at arg for fulfillment errors in function callsJanusz Marcinkiewicz-1/+1
2019-11-24fixup! Lowercase diagnostic message labelTimo Freiberg-1/+1
2019-11-24Add version mismatch help message for unimplemented traitTimo Freiberg-0/+39
Issue #22750 The error reporting for E0277 (the trait `X` is not implemented for `Foo`) now checks whether `Foo` implements a trait with the same path as `X`, which probably means that the programmer wanted to actually use only one version of the trait `X` instead of the two.
2019-11-21Applied suggestions from code review.Alexander Regueiro-79/+80
2019-11-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-229/+225
2019-11-19More HashStable.Camille GILLOT-61/+11
2019-11-19More HashStable.Camille GILLOT-31/+6
2019-11-19Auto merge of #66454 - cjgillot:lift, r=Zoxcbors-139/+16
Derive Lift using a proc-macro Based on #66384 r? @Zoxc
2019-11-19Rollup merge of #66239 - estebank:suggest-async-closure-call, r=CentrilMazdak Farrokhzad-62/+133
Suggest calling async closure when needed When using an async closure as a value in a place that expects a future, suggest calling the closure. Fix #65923.
2019-11-18review commentsEsteban Küber-33/+45
2019-11-18Retire EnumLiftImpl.Camille GILLOT-65/+7
2019-11-18Retire BraceStructLiftImpl.Camille GILLOT-74/+9
2019-11-18Auto merge of #65456 - estebank:trait-bound-borrow, r=matthewjasperbors-8/+90
Suggest borrowing when it would satisfy an unmet trait bound When there are multiple implementors for the same trait that is present in an unmet binding, modify the E0277 error to refer to the parent obligation and verify whether borrowing the argument being passed in would satisfy the unmet bound. If it would, suggest it. Fix #56368.
2019-11-17Auto merge of #66384 - cjgillot:typefoldable, r=Zoxcbors-262/+31
Derive TypeFoldable using a proc-macro A new proc macro is added in librustc_macros. It is used to derive TypeFoldable inside librustc and librustc_traits. For now, the macro uses the `'tcx` lifetime implicitly, and does not allow for a more robust selection of the adequate lifetime. The Clone-based TypeFoldable implementations are not migrated. Closes #65674
2019-11-16review commentsEsteban Küber-81/+91
2019-11-16Suggest calling async closure when neededEsteban Küber-52/+101
When using an async closure as a value in a place that expects a future, suggest calling the closure. Fix #65923.
2019-11-16review comments and fix rebaseEsteban Küber-3/+3
2019-11-16Account for `rustc_on_unimplemented`Esteban Küber-8/+12
2019-11-16Remove unnecessary noteEsteban Küber-11/+10
2019-11-16Modify primary label message to be inline with error messageEsteban Küber-0/+5
2019-11-16Suggest borrowing when it would satisfy an unmet trait boundEsteban Küber-2/+72
When there are multiple implementors for the same trait that is present in an unmet binding, modify the E0277 error to refer to the parent obligation and verify whether borrowing the argument being passed in would satisfy the unmet bound. If it would, suggest it.
2019-11-16Tweak code formattingEsteban Küber-6/+10
2019-11-15Correct `const_in_array_repeat_expressions` feature nameYuki Okushi-4/+4
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+8
2019-11-14Rollup merge of #66253 - ↵Yuki Okushi-2/+10
ohadravid:improve-errors-after-re-rebalance-coherence, r=estebank Improve errors after re rebalance coherence Following #65247, I noticed that some error messages should be updated to reflect the changes of `re_rebalance_coherence` (also there was a [note](https://rust-lang.github.io/rfcs/2451-re-rebalancing-coherence.html#teaching-users) in the RFC about it). First, error message `E0210` was updated to match the RFC, and I also tried to improve a little the error when the "order" of types is problematic. For code like this: ``` #![feature(re_rebalance_coherence)] // Now stable struct Wrap<T>(T); impl<T> From<Wrap<T>> for T { fn from(x: Wrap<T>) -> T { x.0 } } ``` The old error was: ``` error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`) --> src/lib.rs:5:6 | 5 | impl<T> From<Wrap<T>> for T { | ^ type parameter `T` must be used as the type parameter for some local type | = note: only traits defined in the current crate can be implemented for a type parameter ``` and the new error is: ``` error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Wrap<T>`) --> main.rs:66:6 | 66 | impl<T> From<Wrap<T>> for T { | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Wrap<T>`) | = note: implementing a foreign trait is only possible if at least one of the types for which is it implemented is local, and no uncovered type parameters appear before that first local type = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last ``` I tried to point at the uncovered `T`, but couldn't get something which was reliable (but I'll be happy to try if someone points me in the right direction). r? @estebank cc @nikomatsakis Fixes #65247
2019-11-13Use TypeFoldable derive macro.Camille GILLOT-262/+31
2019-11-10Improve coherence errors for wrong type orderOhad Ravid-2/+10
2019-11-10Merge hir::GeneratorMovability into ast::Movability.Camille GILLOT-2/+2
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-5/+5
2019-11-09Auto merge of #66242 - Centril:rollup-h73ztr1, r=Centrilbors-5/+15
Rollup of 6 pull requests Successful merges: - #65949 (Move promotion into its own pass) - #65994 (Point at where clauses where the associated item was restricted) - #66050 (Fix C aggregate-passing ABI on powerpc) - #66134 (Point at formatting descriptor string when it is invalid) - #66172 (Stabilize @file command line arguments) - #66226 (add link to unstable book for asm! macro) Failed merges: r? @ghost