Commit 9fd0972
authored
Rollup merge of rust-lang#133798 - lcnr:nested-bodies-opaques, r=compiler-errors
stop replacing bivariant args with `'static` when computing closure requirements
It is unnecessary, these get constrained when checking that the opaque type is well-formed.
It also results in the opaque type no longer being well formed. If you've got `fn foo<'a>() -> impl Sized + 'a` the opaque is `type Opaque<'a, 'aDummy> where 'a: 'aDummy, 'aDummy: 'a` where `'aDummy` is bivariant. If we call `foo::<'b>()` inside of a closure and its return type ends up in a type test, we start out with the WF `Opaque<'b, 'b>`, and then replace the bivariant `'b` with `'static`. `Opaque<'b, 'static>` is no longer well-formed. Given how these type tests are used, I don't think this caused any practical issues.
r? typesFile tree
6 files changed
+70
-46
lines changed- compiler/rustc_borrowck/src/region_infer
- tests/ui/nll
- closure-requirements
- ty-outlives
6 files changed
+70
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
976 | | - | |
977 | | - | |
| 976 | + | |
978 | 977 | | |
979 | 978 | | |
980 | 979 | | |
981 | 980 | | |
982 | 981 | | |
983 | 982 | | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
| 983 | + | |
988 | 984 | | |
989 | 985 | | |
990 | 986 | | |
991 | 987 | | |
992 | 988 | | |
993 | 989 | | |
994 | | - | |
995 | 990 | | |
996 | 991 | | |
997 | 992 | | |
| |||
1004 | 999 | | |
1005 | 1000 | | |
1006 | 1001 | | |
1007 | | - | |
| 1002 | + | |
1008 | 1003 | | |
1009 | 1004 | | |
1010 | 1005 | | |
| |||
1031 | 1026 | | |
1032 | 1027 | | |
1033 | 1028 | | |
1034 | | - | |
| 1029 | + | |
1035 | 1030 | | |
1036 | 1031 | | |
1037 | 1032 | | |
1038 | 1033 | | |
1039 | | - | |
| 1034 | + | |
1040 | 1035 | | |
1041 | 1036 | | |
1042 | 1037 | | |
| |||
1049 | 1044 | | |
1050 | 1045 | | |
1051 | 1046 | | |
1052 | | - | |
| 1047 | + | |
1053 | 1048 | | |
1054 | 1049 | | |
1055 | | - | |
| 1050 | + | |
1056 | 1051 | | |
1057 | 1052 | | |
1058 | 1053 | | |
| |||
1063 | 1058 | | |
1064 | 1059 | | |
1065 | 1060 | | |
1066 | | - | |
| 1061 | + | |
1067 | 1062 | | |
1068 | 1063 | | |
1069 | 1064 | | |
1070 | 1065 | | |
1071 | 1066 | | |
1072 | 1067 | | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | 1068 | | |
1103 | | - | |
1104 | 1069 | | |
1105 | 1070 | | |
1106 | 1071 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments