about summary refs log tree commit diff
path: root/tests/ui/coherence
AgeCommit message (Collapse)AuthorLines
2024-02-17move ty var instantiation into the generalize modulelcnr-8/+8
2024-02-16Use fulfillment in next trait solver coherenceMichael Goulet-0/+56
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-196/+196
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-6/+31
2024-02-09Avoid accessing the HIR in the happy path of `coherent_trait`Oli Scherer-12/+12
2024-02-08Auto merge of #120558 - oli-obk:missing_impl_item_ice, r=estebankbors-13/+128
Stop bailing out from compilation just because there were incoherent traits fixes #120343 but also has a lot of "type annotations needed" fallout. Some are fixed in the second commit.
2024-02-07Update testsr0cky-1/+1
2024-02-05Stop bailing out from compilation just because there were incoherent traitsOli Scherer-13/+128
2024-01-08Make inductive cycles in coherence ambiguous alwaysMichael Goulet-45/+8
2023-12-15Add higher_ranked to relate submoduleMichael Goulet-8/+8
2023-12-15Move type relations into submodule in rustc_inferMichael Goulet-8/+8
2023-12-14update use of feature flagslcnr-8/+8
2023-12-10remove redundant importssurechen-4/+0
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-05Continue folding if deep normalizer failsMichael Goulet-18/+17
2023-12-05Add deeply_normalize_for_diagnostics, use it in coherenceMichael Goulet-0/+50
2023-12-04rebaselcnr-11/+11
2023-12-04cleanup and commentslcnr-0/+144
2023-11-24Show number in error message even for one errorNilstrieb-70/+70
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-20Don't require intercrate mode for negative coherenceMichael Goulet-38/+3
2023-11-20Don't drop region constraints that come from plugging infer regions with ↵Michael Goulet-2/+6
placeholders
2023-11-19Rollup merge of #118000 - compiler-errors:placeholder-ty-outlives, r=aliemjayMichael Goulet-0/+25
Make regionck care about placeholders in outlives components Currently, we don't consider a placeholder type `!T` to be a type component when it comes to processing type-outlives obligations. This means that they are essentially treated like unit values with no sub-components, and always outlive any region. This is problematic for `non_lifetime_binders`, and even more problematic for `with_negative_coherence`, since negative coherence uses placeholders as universals. This PR adds `Component::Placeholder` which acts much like `Component::Param`. This currently causes a regression in some non-lifetime-binders tests because `for<T> T: 'static` doesn't imply itself when processing outlives obligations, so code like this will fail: ``` fn foo() where for<T> T: 'static { foo() //~ fails } ``` Since the where clause doesn't imply itself. This requires making the `MatchAgainstHigherRankedOutlives` relation smarter when it comes to binders. r? types
2023-11-19Ignore but do not assume region obligations from unifying headers in ↵Michael Goulet-0/+44
negative coherence
2023-11-19Make regionck care about placeholders in outlives componentsMichael Goulet-0/+25
2023-10-26Auto merge of #112875 - compiler-errors:negative-coherence-rework, r=lcnrbors-16/+89
Rework negative coherence to properly consider impls that only partly overlap This PR implements a modified negative coherence that handles impls that only have partial overlap. It does this by: 1. taking both impl trait refs, instantiating them with infer vars 2. equating both trait refs 3. taking the equated trait ref (which represents the two impls' intersection), and resolving any vars 4. plugging all remaining infer vars with placeholder types these placeholder-plugged trait refs can then be used normally with the new trait solver, since we no longer have to worry about the issue with infer vars in param-envs. We use the **new trait solver** to reason correctly about unnormalized trait refs (due to deferred projection equality), since this avoid having to normalize anything under param-envs with infer vars in them. This PR then additionally: * removes the `FnPtr` knowable hack by implementing proper negative `FnPtr` trait bounds for rigid types. --- An example: Consider these two partially overlapping impls: ``` impl<T, U> PartialEq<&U> for &T where T: PartialEq<U> {} impl<F> PartialEq<F> for F where F: FnPtr {} ``` Under the old algorithm, we would take one of these impls and replace it with infer vars, then try unifying it with the other impl under identity substitutions. This is not possible in either direction, since it either sets `T = U`, or tries to equate `F = &?0`. Under the new algorithm, we try to unify `?0: PartialEq<?0>` with `&?1: PartialEq<&?2>`. This gives us `?0 = &?1 = &?2` and thus `?1 = ?2`. The intersection of these two trait refs therefore looks like: `&?1: PartialEq<&?1>`. After plugging this with placeholders, we get a trait ref that looks like `&!0: PartialEq<&!0>`, with the first impl having substs `?T = ?U = !0` and the second having substs `?F = &!0`[^1]. Then we can take the param-env from the first impl, and try to prove the negated where clause of the second. We know that `&!0: !FnPtr` never holds, since it's a rigid type that is also not a fn ptr, we successfully detect that these impls may never overlap. [^1]: For the purposes of this example, I just ignored lifetimes, since it doesn't really matter.
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-2/+12
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-10-23nitsMichael Goulet-0/+12
2023-10-23coherence doesn't like region constraintsMichael Goulet-3/+37
2023-10-23Consider regionsMichael Goulet-0/+35
2023-10-23Make things work by using the new solverMichael Goulet-14/+6
2023-10-20Rename lots of files that had `generator` in their nameOli Scherer-1/+1
2023-10-20s/generator/coroutine/Oli Scherer-1/+1
2023-10-20s/Generator/Coroutine/Oli Scherer-7/+7
2023-10-18Bump COINDUCTIVE_OVERLAP_IN_COHERENCEMichael Goulet-0/+25
2023-10-09Extend impl's def_span to include where clausesMichael Goulet-19/+36
2023-09-21update testslcnr-7/+107
2023-09-10Point out if a local trait has no implementationsMichael Goulet-0/+5
2023-08-30Don't record spans for predicates in coherenceMichael Goulet-3/+1
2023-08-15more nitsMichael Goulet-3/+4
2023-08-15nitsMichael Goulet-1/+1
Co-authored-by: lcnr <rust@lcnr.de>
2023-08-15Implement lint against coinductive impl overlapMichael Goulet-0/+57
2023-07-18moved note as unspanned note, moved note to the bottom of the msgnxya-5/+1
2023-07-18added links as a notenxya-1/+1
2023-07-18add links to query documentation for E0391nxya-1/+1
2023-07-18added links as a notenxya-1/+6
2023-07-18add links to query documentation for E0391nxya-1/+1
2023-07-16Don't call predicate_must_hold during fulfillment in intercrateMichael Goulet-0/+36
2023-05-30remove unused revisionlcnr-17/+1
2023-04-26add known-bug test for unsound issue 74629whtahy-0/+41
2023-04-22add known-bug test for unsound issue 57893whtahy-0/+25
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-2/+0