rust/compiler/rustc_borrowck/src
Dylan DPC 6cb13585d0
Rollup merge of #110454 - oli-obk:limited_impl_trait_in_assoc_type, r=compiler-errors
Require impl Trait in associated types to appear in method signatures

This implements the limited version of TAIT that was proposed in https://github.com/rust-lang/rust/issues/107645#issuecomment-1477899536

Similar to `impl Trait` in return types, `impl Trait` in associated types may only be used within the impl block which it is a part of. To make everything simpler and forward compatible to getting desugared to a plain type alias impl trait in the future, we're requiring that any associated functions or constants that want to register hidden types must be using the associated type in their signature (type of the constant or argument/return type of the associated method. Where bounds mentioning the associated type are ignored).

We have preexisting tests checking that this works transitively across multiple associated types in situations like

```rust
impl Foo for Bar {
    type A = impl Trait;
    type B = impl Iterator<Item = Self::A>;
    fn foo() -> Self::B { ...... }
}
```
2023-05-13 11:05:32 +05:30
..
constraints Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
diagnostics Rollup merge of #110583 - Ezrashaw:tweak-make-mut-spans, r=estebank 2023-05-09 12:33:45 +05:30
region_infer Require impl Trait in associated types to appear in method signatures 2023-05-12 10:24:03 +00:00
type_check Make NonUseContext::AscribeUserTy carry ty::Variance 2023-05-10 09:54:56 +03:00
util Move some utils out of rustc_const_eval 2023-04-16 12:05:54 +02:00
borrow_set.rs Remove ToRegionVid. 2023-04-13 12:20:41 +10:00
borrowck_errors.rs Add #[track_caller] to struct_span_err_with_code (drive-by cleanup) 2023-04-19 19:10:37 +00:00
constraint_generation.rs Remove ToRegionVid. 2023-04-13 12:20:41 +10:00
consumers.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
dataflow.rs Reduce BitSet size used in Borrows dataflow analysis 2023-05-09 18:50:13 +02:00
def_use.rs Make NonUseContext::AscribeUserTy carry ty::Variance 2023-05-10 09:54:56 +03:00
facts.rs Various minor Idx-related tweaks 2023-04-16 02:42:50 -07:00
invalidation.rs Box AssertKind 2023-05-01 23:12:41 -04:00
lib.rs remove inside_canonicalization_ctxt flag 2023-05-03 21:03:19 +02:00
location.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
member_constraints.rs remove unused muts 2023-04-28 20:19:48 +02:00
nll.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
path_utils.rs Move mir::Fieldabi::FieldIdx 2023-03-28 22:22:37 -07:00
place_ext.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
places_conflict.rs Removed various double spaces in compiler source comments. 2023-01-14 17:34:59 +01:00
prefixes.rs lint auto pass 2022-11-09 20:42:16 +08:00
renumber.rs check array type of repeat exprs is wf 2023-05-04 11:22:40 +01:00
session_diagnostics.rs Don't call await a method 2023-04-27 17:18:12 +00:00
universal_regions.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
used_muts.rs Rollup merge of #108856 - Zeegomo:remove-drop-and-rep, r=tmiasko 2023-03-08 21:26:51 +01:00