rust/tests
Matthias Krüger a5caa989c9
Rollup merge of #107339 - aliemjay:covariant, r=lcnr
internally change regions to be covariant

Surprisingly, we consider the reference type `&'a T` to be contravaraint in its lifetime parameter. This is confusing and conflicts with the documentation we have in the reference, rustnomicon, and rustc-dev-guide. This also arguably not the correct use of terminology since we can use `&'static u8` in a place where `&' a u8` is expected, this implies that `&'static u8 <: &' a u8` and consequently `'static <: ' a`, hence covariance.

Because of this, when relating two types, we used to switch the argument positions in a confusing way:
`Subtype(&'a u8 <: &'b u8) => Subtype('b <: 'a) => Outlives('a: 'b) => RegionSubRegion('b <= 'a)`

The reason for the current behavior is probably that we wanted `Subtype('b <: 'a)` and `RegionSubRegion('b <= 'a)` to be equivalent, but I don' t think this is a good reason since these relations are sufficiently different in that the first is a relation in the subtyping lattice and is intrinsic to the type-systems, while the the second relation is an implementation detail of regionck.

This PR changes this behavior to use covariance, so..
`Subtype(&'a u8 <: &'b u8) => Subtype('a <: 'b) => Outlives('a: 'b) => RegionSubRegion('b <= 'a) `

Resolves #103676

r? `@lcnr`
2023-01-28 05:20:18 +01:00
..
assembly bump failing assembly & codegen tests from LLVM 14 to LLVM 15 2023-01-17 20:02:01 +01:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
codegen Rollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se 2023-01-28 05:20:15 +01:00
codegen-units Move /src/test to /tests 2023-01-11 09:32:08 +00:00
debuginfo Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incremental Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir-opt Bless mir-opt tests. 2023-01-27 22:01:47 +00:00
pretty Bless pretty tests. 2023-01-12 00:25:46 +01:00
run-make Make output_filenames a real query 2023-01-23 10:35:21 +00:00
run-make-fulldeps Rollup merge of #106904 - khuey:preserve_debuginfo_for_rlibs, r=davidtwco 2023-01-26 15:02:19 +01:00
run-pass-valgrind Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc Add regression test for #107350 2023-01-27 12:11:01 +01:00
rustdoc-gui Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, r=GuillaumeGomez 2023-01-27 12:57:57 +09:00
rustdoc-js rustdoc: update search test cases 2023-01-14 12:04:12 -07:00
rustdoc-js-std rustdoc: update search test cases 2023-01-14 12:04:12 -07:00
rustdoc-json Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc-ui Add drop_tracking_mir option. 2023-01-27 18:57:34 +00:00
ui Rollup merge of #107339 - aliemjay:covariant, r=lcnr 2023-01-28 05:20:18 +01:00
ui-fulldeps Bless ui-fulldeps. 2023-01-27 20:10:25 +00:00
COMPILER_TESTS.md Move /src/test to /tests 2023-01-11 09:32:08 +00:00