Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 7c43d03

Browse files
committed
Update to nightly-2020-12-19
Rustup to rust-lang/rust#79945
1 parent 714fb0d commit 7c43d03

File tree

3 files changed

+63
-52
lines changed

3 files changed

+63
-52
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ repository and compiled from source or installed from
2727
of the nightly toolchain is supported at any given time.
2828

2929
<!-- NOTE: Keep in sync with nightly date on rust-toolchain. -->
30-
It's recommended to use `nightly-2020-12-14` toolchain.
31-
You can install it by using `rustup install nightly-2020-12-14` if you already have rustup.
30+
It's recommended to use `nightly-2020-12-19` toolchain.
31+
You can install it by using `rustup install nightly-2020-12-19` if you already have rustup.
3232
Then you can do:
3333

3434
```sh
3535
$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2020-11-19
36-
$ cargo +nightly-2020-12-14 install --git https://github.com/rust-lang/rust-semverver
36+
$ cargo +nightly-2020-12-19 install --git https://github.com/rust-lang/rust-semverver
3737
```
3838

3939
You'd also need `cmake` for some dependencies, and a few common libraries (if you hit

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# NOTE: Keep in sync with nightly date on README
22
[toolchain]
3-
channel = "nightly-2020-12-14"
3+
channel = "nightly-2020-12-19"
44
components = ["llvm-tools-preview", "rustc-dev"]

src/translate.rs

Lines changed: 59 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -211,61 +211,72 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
211211
let res: Vec<_> = preds
212212
.iter()
213213
.map(|p| {
214-
match p.skip_binder() {
215-
Trait(existential_trait_ref) => {
216-
let trait_ref = Binder::bind(existential_trait_ref)
217-
.with_self_ty(self.tcx, dummy_self);
218-
let did = trait_ref.skip_binder().def_id;
219-
let substs = trait_ref.skip_binder().substs;
220-
221-
// TODO: here, the substs could also be already translated
222-
if let Some((target_def_id, target_substs)) =
223-
self.translate_orig_substs(index_map, did, substs)
224-
{
225-
let target_trait_ref = TraitRef {
226-
def_id: target_def_id,
227-
substs: target_substs,
228-
};
229-
Trait(ExistentialTraitRef::erase_self_ty(
230-
self.tcx,
231-
target_trait_ref,
232-
))
233-
} else {
234-
success.set(false);
235-
err_pred
214+
p.map_bound(|p| {
215+
match p {
216+
Trait(existential_trait_ref) => {
217+
let trait_ref = Binder::bind(existential_trait_ref)
218+
.with_self_ty(self.tcx, dummy_self);
219+
let did = trait_ref.skip_binder().def_id;
220+
let substs = trait_ref.skip_binder().substs;
221+
222+
// TODO: here, the substs could also be already translated
223+
if let Some((target_def_id, target_substs)) =
224+
self.translate_orig_substs(index_map, did, substs)
225+
{
226+
let target_trait_ref = TraitRef {
227+
def_id: target_def_id,
228+
substs: target_substs,
229+
};
230+
Trait(ExistentialTraitRef::erase_self_ty(
231+
self.tcx,
232+
target_trait_ref,
233+
))
234+
} else {
235+
success.set(false);
236+
err_pred
237+
}
236238
}
237-
}
238-
Projection(existential_projection) => {
239-
let projection_pred = Binder::bind(existential_projection)
240-
.with_self_ty(self.tcx, dummy_self);
241-
let item_def_id =
242-
projection_pred.skip_binder().projection_ty.item_def_id;
243-
let substs =
244-
projection_pred.skip_binder().projection_ty.substs;
245-
246-
// TODO: here, the substs could also be already translated
247-
if let Some((target_def_id, target_substs)) = self
248-
.translate_orig_substs(index_map, item_def_id, substs)
249-
{
250-
Projection(ExistentialProjection {
251-
item_def_id: target_def_id,
252-
// TODO: should be it's own method in rustc
253-
substs: self.tcx.intern_substs(&target_substs[1..]),
254-
ty,
255-
})
256-
} else {
257-
success.set(false);
258-
err_pred
239+
Projection(existential_projection) => {
240+
let projection_pred =
241+
Binder::bind(existential_projection)
242+
.with_self_ty(self.tcx, dummy_self);
243+
let item_def_id = projection_pred
244+
.skip_binder()
245+
.projection_ty
246+
.item_def_id;
247+
let substs =
248+
projection_pred.skip_binder().projection_ty.substs;
249+
250+
// TODO: here, the substs could also be already translated
251+
if let Some((target_def_id, target_substs)) = self
252+
.translate_orig_substs(
253+
index_map,
254+
item_def_id,
255+
substs,
256+
)
257+
{
258+
Projection(ExistentialProjection {
259+
item_def_id: target_def_id,
260+
// TODO: should be it's own method in rustc
261+
substs: self
262+
.tcx
263+
.intern_substs(&target_substs[1..]),
264+
ty,
265+
})
266+
} else {
267+
success.set(false);
268+
err_pred
269+
}
259270
}
271+
AutoTrait(did) => AutoTrait(self.translate_orig(did)),
260272
}
261-
AutoTrait(did) => AutoTrait(self.translate_orig(did)),
262-
}
273+
})
263274
})
264275
.collect();
265276

266277
if success.get() {
267-
let target_preds = self.tcx.mk_existential_predicates(res.iter());
268-
self.tcx.mk_dynamic(Binder::bind(target_preds), region)
278+
let target_preds = self.tcx.mk_poly_existential_predicates(res.iter());
279+
self.tcx.mk_dynamic(target_preds, region)
269280
} else {
270281
ty
271282
}

0 commit comments

Comments
 (0)