about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-trait
AgeCommit message (Collapse)AuthorLines
2023-12-14update use of feature flagslcnr-2/+2
2023-12-07recurse into refs when comparing tys for diagnosticsjyn-2/+2
2023-11-25Don't ICE when encountering placeholders in implied bounds computationMichael Goulet-0/+14
2023-11-24Show number in error message even for one errorNilstrieb-27/+27
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-04fallback for `construct_generic_bound_failure`bohan-0/+25
2023-11-02Add all RPITITs when augmenting param-env with GAT bounds in check_type_boundsMichael Goulet-0/+11
2023-10-29On object safety error, mention new enum as alternativeEsteban Küber-0/+5
When we encounter a `dyn Trait` that isn't object safe, look for its implementors. If there's one, mention using it directly If there are less than 9, mention the possibility of creating a new enum and using that instead. Account for object unsafe `impl Trait on dyn Trait {}`. Make a distinction between public and sealed traits. Fix #80194.
2023-10-24Remove incomplete features from RPITIT/AFIT testsMichael Goulet-37/+19
2023-10-18Tweak wording of type errors involving type paramsEsteban Küber-2/+2
Fix #78206.
2023-10-16Fix outlives suggestion for GAT in RPITITMichael Goulet-0/+41
2023-10-13Test that RPITITs have RPIT scope and not impl-wide scopeMichael Goulet-0/+38
2023-10-13Stabilize AFIT and RPITITMichael Goulet-118/+69
2023-10-11Rollup merge of #116219 - compiler-errors:relate-alias-ty-with-variance, r=lcnrMatthias Krüger-0/+14
Relate alias ty with variance In the new solver, turns out that the subst-relate branch of the alias-relate predicate was relating args invariantly even for opaques, which have variance :skull:. This change is a bit more invasive, but I'd rather not special-case it [here](https://github.com/rust-lang/rust/blob/aeaa5c30e5c9041264a2e8314b68ad84c2dc3169/compiler/rustc_trait_selection/src/solve/alias_relate.rs#L171-L190) and then have it break elsewhere. I'm doing a perf run to see if the extra call to `def_kind` is that expensive, if it is, I'll reconsider. r? ``@lcnr``
2023-10-05Rollup merge of #116296 - compiler-errors:default-return, r=estebankJubilee-2/+2
More accurately point to where default return type should go When getting the "default return type" span, instead of pointing to the low span of the next token, point to the high span of the previous token. This: 1. Makes forming return type suggestions more uniform, since we expect them all in the same place. 2. Arguably makes labels easier to understand, since we're pointing to where the implicit `-> ()` would've gone, rather than the starting brace or the semicolon. r? ```@estebank```
2023-10-05Auto merge of #116273 - compiler-errors:refine2, r=tmandrybors-0/+11
Only trigger `refining_impl_trait` lint on reachable traits Public but unreachable traits don't matter 😸 r? `@tmandry`
2023-10-04Point to where missing return type should goMichael Goulet-2/+2
2023-10-04Relate AliasTy considering varianceMichael Goulet-0/+14
2023-10-03Bless testsMichael Goulet-3/+13
2023-09-29Only trigger refine lint on reachable traitsMichael Goulet-0/+11
2023-09-26Anonymize binders for refining_impl_trait checkMichael Goulet-0/+13
2023-09-22Need to use hybrid param-env to make sure implication is not circularMichael Goulet-0/+42
2023-09-22Use placeholders to prevent using inferred RPITIT types to imply their own ↵Michael Goulet-0/+39
WF-ness
2023-09-07Add noteMichael Goulet-0/+5
2023-09-07Don't emit refining_impl_trait for private itemsMichael Goulet-43/+66
2023-09-07Use self instead of the actual self tyMichael Goulet-2/+2
2023-09-07Implement refinement lint for RPITITMichael Goulet-13/+133
2023-09-02Do not require associated types with Self: Sized to uphold bounds when ↵Michael Goulet-1/+17
confirming object candidate
2023-09-02RPITITs are considered object-safe, they're always on Self:Sized methodsMichael Goulet-18/+29
2023-08-30Capture lifetimes for associated type bounds destined to be lowered to opaquesMichael Goulet-0/+19
2023-08-28Auto merge of #115326 - matthiaskrgr:rollup-qsoa8ar, r=matthiaskrgrbors-1/+0
Rollup of 8 pull requests Successful merges: - #115164 (MIR validation: reject in-place argument/return for packed fields) - #115240 (codegen_llvm/llvm_type: avoid matching on the Rust type) - #115294 (More precisely detect cycle errors from type_of on opaque) - #115310 (Document panic behavior across editions, and improve xrefs) - #115311 (Revert "Suggest using `Arc` on `!Send`/`!Sync` types") - #115317 (Devacationize oli-obk) - #115319 (don't use SnapshotVec in Graph implementation, as it looks unused; use Vec instead) - #115322 (Tweak output of `to_pretty_impl_header` involving only anon lifetimes) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-28Revert "Suggest using `Arc` on `!Send`/`!Sync` types"David Tolnay-1/+0
This reverts commit 9de1a472b68ed85f396b2e2cc79c3ef17584d6e1.
2023-08-28Better error message for object type with GATMichael Goulet-6/+12
2023-08-28Test variances of opaque capturesMichael Goulet-0/+46
2023-08-28Bless testsMichael Goulet-9/+32
2023-08-28RPITITs capture all their lifetimesMichael Goulet-58/+20
2023-08-09Suggest using `Arc` on `!Send`/`!Sync` typesEsteban Kuber-0/+1
2023-08-08Remove dangling testsMichael Goulet-800/+0
2023-08-08Install bidirectional outlives predicates for RPITITs (and RPITs) correctlyMichael Goulet-0/+11
2023-08-02Rollup merge of #114301 - ↵Matthias Krüger-0/+35
compiler-errors:dont-error-on-missing-region-outlives, r=spastorino Don't check unnecessarily that impl trait is RPIT We have this random `return_type_impl_trait` function to detect if a function returns an RPIT which is used in outlives suggestions, but removing it doesn't actually change any diagnostics. Let's just remove it. Also, suppress a spurious outlives error from a ReError. Fixes #114274
2023-08-01Suppress unnecessary outlivesMichael Goulet-18/+2
2023-07-31Don't check unnecessarily that impl trait is RPITMichael Goulet-0/+51
2023-07-31Rollup merge of #114267 - compiler-errors:rpitit-opaque-bounds, r=spastorinoMatthias Krüger-25/+1
Map RPITIT's opaque type bounds back from projections to opaques An RPITIT in a program's AST is eventually translated into both a projection GAT and an opaque. The opaque is used for default trait methods, like: ``` trait Foo { fn bar() -> impl Sized { 0i32 } } ``` The item bounds for both the projection and opaque are identical, and both have a *projection* self ty. This is mostly okay, since we can normalize this projection within the default trait method body to the opaque, but it does two things: 1. it leads to bugs in places where we don't normalize item bounds, like `deduce_future_output_from_obligations` 2. it leads to extra match arms that are both suspicious looking and also easy to miss This PR maps the opaque type bounds of the RPITIT's *opaque* back to the opaque's self type to avoid this quirk. Then we can fix the UI test for #108304 (1.) and also remove a bunch of match arms (2.). Fixes #108304 r? `@spastorino`
2023-07-30Don't install default projection bound for RPITITsMichael Goulet-0/+26
2023-07-30Remap explicit item bounds of RPITIT's opaque back to ty::OpaqueMichael Goulet-25/+1
2023-07-29some nits, bless testMichael Goulet-16/+2
2023-07-29Implement assumed_wf_types for RPITITs' implementationsMichael Goulet-0/+29
2023-07-29Take RPITITs inherit the assumed_wf_types of their parent fnMichael Goulet-4/+0
2023-07-28Rollup merge of #114147 - compiler-errors:missing-rpitits, r=spastorinoMatthias Krüger-0/+27
Insert RPITITs that were shadowed by missing ADTs that resolve to [type error] Comment inline explains how this can happen. Fixes #113903
2023-07-27Add additional testMichael Goulet-0/+44
2023-07-27Insert RPITITs that were shadowed by missing ADTs that resolve to type errorMichael Goulet-0/+27