Commit bcfdfe4
committed
use the closure def-id in returns, but closure-base def-id in locals
Using the `closure_base_def_id` indiscriminantely, as we were doing
before, winds up "going wrong" if the closure type includes the `impl
Trait` from the parent. The problem arises because the return value
for closures is inferred and meant to treat the return
type *opaquely*, so we don't want to be "desugaring" it into the
underlying type.1 parent c7df1f5 commit bcfdfe4
File tree
3 files changed
+37
-5
lines changed- src
- librustc_mir/borrow_check/nll/type_check
- test/ui/impl-trait
3 files changed
+37
-5
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
886 | 890 | | |
887 | 891 | | |
888 | 892 | | |
| |||
892 | 896 | | |
893 | 897 | | |
894 | 898 | | |
895 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
896 | 904 | | |
897 | 905 | | |
898 | 906 | | |
| |||
940 | 948 | | |
941 | 949 | | |
942 | 950 | | |
| 951 | + | |
943 | 952 | | |
944 | 953 | | |
945 | 954 | | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
946 | 961 | | |
947 | 962 | | |
948 | 963 | | |
949 | | - | |
| 964 | + | |
950 | 965 | | |
951 | 966 | | |
952 | 967 | | |
| |||
957 | 972 | | |
958 | 973 | | |
959 | 974 | | |
960 | | - | |
| 975 | + | |
961 | 976 | | |
962 | 977 | | |
963 | 978 | | |
| |||
978 | 993 | | |
979 | 994 | | |
980 | 995 | | |
981 | | - | |
982 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
983 | 1000 | | |
984 | 1001 | | |
985 | 1002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments