about summary refs log tree commit diff
path: root/tests/ui/coherence
AgeCommit message (Collapse)AuthorLines
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
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-2/+4
2023-03-08Rollup merge of #108884 - compiler-errors:tweak-illegal-copy-impl-message, ↵Matthias Krüger-5/+5
r=WaffleLapkin Tweak illegal `Copy` impl message The phrase "may not" can both mean "is not able to" and "possibly does not". Disambiguate this by just using "cannot". ``@Lokathor`` expressed being annoyed by this [here](https://twitter.com/Lokathor/status/1633200313544089602?s=20). Also drive-by fix for this extremely noisy message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6a37275bc810f7846bfe191845b7d11d. r? diagnostics
2023-03-08Suppress copy impl error when post-normalized type references errorsMichael Goulet-0/+25
2023-03-08may not => cannotMichael Goulet-5/+5
2023-03-06Bless the remaining ui testsMu42-4/+36
2023-02-13Tighter spans for bad inherent impl typesMichael Goulet-4/+4
2023-02-03Disallow impl autotrait for trait objectDavid Tolnay-26/+104
2023-01-19Don't treat closures from other crates as localOli Scherer-2/+8
2023-01-12Point at impl self type for impl wf obligationsMichael Goulet-2/+2