about summary refs log tree commit diff
path: root/src/test/ui/traits
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-18174/+0
2023-01-09update test for inductive canonical cycleslcnr-43/+58
2023-01-09Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnrbors-2/+2
Improve spans of non-WF implied bound types Fixes #60980
2023-01-08Normalize assumed_wf_types after wfchecking is complete, for better spansMichael Goulet-2/+2
2023-01-08Mention signature rather than fn pointers when comparing impl/trait methodsMichael Goulet-20/+20
2023-01-04Rollup merge of #106478 - estebank:tweak-fn-mismatch, r=compiler-errorsMichael Goulet-1/+1
Tweak wording of fn call with wrong number of args
2023-01-05Tweak wording of fn call with wrong number of argsEsteban Küber-1/+1
2023-01-04Move testsCaio-0/+49
2023-01-01reduce spans for `unsafe impl` errorsLukas Markeffsky-8/+4
2022-12-30Rollup merge of #106248 - dtolnay:revertupcastlint, r=jackh726Michael Goulet-24/+0
Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint" This is a clean revert of #105484. I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** https://github.com/rust-lang/rust/issues/106247#issuecomment-1367174384 has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe. FYI `@nbdd0121` `@compiler-errors`
2022-12-29Rollup merge of #106202 - estebank:trim-paths, r=NilstriebMatthias Krüger-4/+4
Trim more paths in obligation types
2022-12-29Revert "Add tests"David Tolnay-24/+0
This reverts commit b656e2413022de1863b9ea8db87454477b816042.
2022-12-28Rollup merge of #105484 - nbdd0121:upcast, r=compiler-errorsfee1-dead-0/+24
Implement allow-by-default `multiple_supertrait_upcastable` lint The lint detects when an object-safe trait has multiple supertraits. Enabled in libcore and liballoc as they are low-level enough that many embedded programs will use them. r? `@nikomatsakis`
2022-12-27Trim more paths in obligation typesEsteban Küber-4/+4
2022-12-19implement the skeleton of the updated trait solverlcnr-0/+54
2022-12-16Auto merge of #104334 - compiler-errors:ufcs-sugg-wrong-def-id, r=estebankbors-2/+2
Use impl's def id when calculating type to specify in UFCS Fixes #104327 Fixes #104328 Also addresses https://github.com/rust-lang/rust/pull/102670#discussion_r987381197
2022-12-15Rollup merge of #105727 - estebank:use-impl-trait, r=oli-obkMatthias Krüger-0/+4
Tweak output for bare `dyn Trait` in arguments Fix #35825.
2022-12-15Use `with_forced_trimmed_paths` moreEsteban Küber-2/+2
2022-12-14Tweak output for bare `dyn Trait` in argumentsEsteban Küber-0/+4
Fix #35825.
2022-12-14Highlight conflicting param-env candidates, againMichael Goulet-4/+8
2022-12-14drive-by: Fix path spansMichael Goulet-2/+2
2022-12-14Rollup merge of #105595 - TaKO8Ki:suggest-dereferencing-receiver-argument, ↵Matthias Krüger-0/+43
r=compiler-errors Suggest dereferencing receiver arguments properly Fixes #105429
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-1/+12
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-14suggest dereferencing receiver arguments properlyTakayuki Maeda-0/+43
fix a stderr
2022-12-13Mention implementations that satisfy the traitEsteban Küber-1/+12
2022-12-13Avoid rendering empty annotationsOli Scherer-3/+0
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-63/+18
available
2022-12-13Rollup merge of #105332 - estebank:iterator-chains, r=oli-obkMatthias Krüger-4/+2
Point out the type of associated types in every method call of iterator chains Partially address #105184 by pointing out the type of associated types in every method call of iterator chains: ``` note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@src/test/ui/iterators/invalid-iterator-chain.rs:12:18: 12:21]>` --> src/test/ui/iterators/invalid-iterator-chain.rs:12:14 | 10 | vec![0, 1] | ---------- this expression has type `Vec<{integer}>` 11 | .iter() | ------ associated type `std::iter::Iterator::Item` is `&{integer}` here 12 | .map(|x| { x; }) | ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here ``` We also reduce the number of impls we mention when any of the candidates is an "exact match". This benefits the output of cases with numerics greatly. Outstanding work would be to provide a structured suggestion for appropriate changes, like in this case detecting the spurious `;` in the closure.
2022-12-11Point at method call when it is the source of the bound errorEsteban Küber-4/+2
2022-12-11Move testsCaio-0/+141
2022-12-11Rollup merge of #105546 - JohnTitor:issue-44454, r=compiler-errorsMatthias Krüger-0/+115
Add some regression tests for #44454 Closes #44454 r? ``@compiler-errors`` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-11Add some regression tests for #44454Yuki Okushi-0/+115
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-10Introduce `with_forced_trimmed_paths`Esteban Küber-4/+4
2022-12-09Tweak `rustc_must_implement_one_of` diagnostic outputEsteban Küber-28/+28
2022-12-09Add testsGary Guo-0/+24
2022-12-08Rollup merge of #104922 - estebank:fur-elize, r=oli-obkMatthias Krüger-1/+1
Detect long types in E0308 and write them to disk On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-12-05Tweak "the following other types implement trait"Esteban Küber-4/+1
When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types. fix fmt
2022-11-30Add a regression test for #104322Georg Semmler-0/+80
2022-11-28Detect long types in E0308 and write them to diskEsteban Küber-1/+1
On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-11-26Revert "Do not need to account for overflow in predicate_can_apply"Michael Goulet-27/+0
This reverts commit cbe932801892da06688b53638622be1c8a1c8974.
2022-11-24Rollup merge of #104742 - WaffleLapkin:forbidden-SUPER-deref, r=compiler-errorsMatthias Krüger-6/+11
Make `deref_into_dyn_supertrait` lint the impl and not the usage Proposed by ``@compiler-errors`` in https://github.com/rust-lang/rust/issues/89460#issuecomment-1320806785 r? ``@crlf0710``
2022-11-23Use nicer spans for `deref_into_dyn_supertrait`Maybe Waffle-10/+7
2022-11-23Make `deref_into_dyn_supertrait` lint the impl and not the usageMaybe Waffle-6/+14
2022-11-23Rollup merge of #104269 - compiler-errors:hang-in-where-clause-sugg, r=lcnrDylan DPC-0/+27
Fix hang in where-clause suggestion with `predicate_can_apply` Using `predicate_may_hold` during error reporting causes an evaluation overflow, which (because we use `evaluate_obligation_no_overflow`) then causes the predicate to need to be re-evaluated locally, which results in a hang. ... but since the "add a where clause" suggestion is best-effort, just throw any overflow errors. No need for 100% accuracy. r? `@lcnr` who has been thinking about overflows... Let me know if you want more context about this issue, and as always, feel free to reassign. Fixes #104225
2022-11-23Do not need to account for overflow in predicate_can_applyMichael Goulet-0/+27
2022-11-22Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnrManish Goregaokar-14/+1
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes #99840
2022-11-22Rollup merge of #104597 - ↵Matthias Krüger-2/+2
compiler-errors:need_migrate_deref_output_trait_object-msg, r=eholk Probe + better error messsage for `need_migrate_deref_output_trait_object` 1. Use `InferCtxt::probe` in `need_migrate_deref_output_trait_object` -- that normalization *could* technically do type inference as a side-effect, and this is a lint, so it should have no side-effects. 2. Return the trait-ref so we format the error message correctly. See the UI test change -- `(dyn A + 'static)` is not a trait.
2022-11-21Allow opaque types in trait impl headers and rely on coherence to reject ↵Oli Scherer-14/+1
unsound cases
2022-11-19Probe + better error messsage for need_migrate_deref_output_trait_objectMichael Goulet-2/+2
2022-11-18Only use `...` instead of `_` for type elisionEsteban Küber-1/+1
`_` might confuse people into believing that the type isn't known, while `...` is not used anywhere else for types and is not valid syntax, making it more likely to convey the right understanding.