Skip to content

Commit 9b1da9c

Browse files
authored
Rollup merge of #104378 - compiler-errors:chalk-up, r=jackh726
Bump chalk to v0.87 1. Removes `ReEmpty` from chalk 2. Adds support for the `std::marker::Tuple` trait
2 parents 0a48a45 + 36a1068 commit 9b1da9c

File tree

9 files changed

+32
-125
lines changed

9 files changed

+32
-125
lines changed

Cargo.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ dependencies = [
502502

503503
[[package]]
504504
name = "chalk-derive"
505-
version = "0.80.0"
505+
version = "0.87.0"
506506
source = "registry+https://github.com/rust-lang/crates.io-index"
507-
checksum = "d0001adf0cf12361e08b65e1898ea138f8f77d8f5177cbf29b6b3b3532252bd6"
507+
checksum = "d552b2fa341f5fc35c6b917b1d289d3c3a34d0b74e579390ea6192d6152a8cdb"
508508
dependencies = [
509509
"proc-macro2",
510510
"quote",
@@ -514,9 +514,9 @@ dependencies = [
514514

515515
[[package]]
516516
name = "chalk-engine"
517-
version = "0.80.0"
517+
version = "0.87.0"
518518
source = "registry+https://github.com/rust-lang/crates.io-index"
519-
checksum = "c44ee96f2d67cb5193d1503f185db1abad9933a1c6e6b4169c176f90baecd393"
519+
checksum = "7e54ac43048cb31c470d7b3e3acd409090ef4a5abddfe02455187aebc3d6879f"
520520
dependencies = [
521521
"chalk-derive",
522522
"chalk-ir",
@@ -527,9 +527,9 @@ dependencies = [
527527

528528
[[package]]
529529
name = "chalk-ir"
530-
version = "0.80.0"
530+
version = "0.87.0"
531531
source = "registry+https://github.com/rust-lang/crates.io-index"
532-
checksum = "92d8a95548f23618fda86426e4304e563ec2bb7ba0216139f0748d63c107b5f1"
532+
checksum = "43aa55deff4e7fbdb09fa014543372f2c95a06835ac487b9ce57b5099b950838"
533533
dependencies = [
534534
"bitflags",
535535
"chalk-derive",
@@ -538,9 +538,9 @@ dependencies = [
538538

539539
[[package]]
540540
name = "chalk-solve"
541-
version = "0.80.0"
541+
version = "0.87.0"
542542
source = "registry+https://github.com/rust-lang/crates.io-index"
543-
checksum = "f37f492dacfafe2e21319b80827da2779932909bb392f0cc86b2bd5c07c1b4e1"
543+
checksum = "61213deefc36ba265ad01c4d997e18bcddf7922862a4594a47ca4575afb3dab4"
544544
dependencies = [
545545
"chalk-derive",
546546
"chalk-ir",

compiler/rustc_middle/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ doctest = false
88

99
[dependencies]
1010
bitflags = "1.2.1"
11-
chalk-ir = "0.80.0"
11+
chalk-ir = "0.87.0"
1212
either = "1.5.0"
1313
gsgdt = "0.1.2"
1414
polonius-engine = "0.13.0"

compiler/rustc_traits/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ rustc_hir = { path = "../rustc_hir" }
1212
rustc_index = { path = "../rustc_index" }
1313
rustc_ast = { path = "../rustc_ast" }
1414
rustc_span = { path = "../rustc_span" }
15-
chalk-ir = "0.80.0"
16-
chalk-engine = "0.80.0"
17-
chalk-solve = "0.80.0"
15+
chalk-ir = "0.87.0"
16+
chalk-engine = "0.87.0"
17+
chalk-solve = "0.87.0"
1818
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
1919
rustc_infer = { path = "../rustc_infer" }
2020
rustc_trait_selection = { path = "../rustc_trait_selection" }

compiler/rustc_traits/src/chalk/db.rs

+3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
142142
Some(CoerceUnsized)
143143
} else if lang_items.dispatch_from_dyn_trait() == Some(def_id) {
144144
Some(DispatchFromDyn)
145+
} else if lang_items.tuple_trait() == Some(def_id) {
146+
Some(Tuple)
145147
} else {
146148
None
147149
};
@@ -570,6 +572,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
570572
CoerceUnsized => lang_items.coerce_unsized_trait(),
571573
DiscriminantKind => lang_items.discriminant_kind_trait(),
572574
DispatchFromDyn => lang_items.dispatch_from_dyn_trait(),
575+
Tuple => lang_items.tuple_trait(),
573576
};
574577
def_id.map(chalk_ir::TraitId)
575578
}

compiler/rustc_traits/src/chalk/lowering.rs

-3
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,6 @@ impl<'tcx> LowerInto<'tcx, Region<'tcx>> for &chalk_ir::Lifetime<RustInterner<'t
507507
name: ty::BoundRegionKind::BrAnon(p.idx as u32, None),
508508
}),
509509
chalk_ir::LifetimeData::Static => return interner.tcx.lifetimes.re_static,
510-
chalk_ir::LifetimeData::Empty(_) => {
511-
bug!("Chalk should not have been passed an empty lifetime.")
512-
}
513510
chalk_ir::LifetimeData::Erased => return interner.tcx.lifetimes.re_erased,
514511
chalk_ir::LifetimeData::Phantom(void, _) => match *void {},
515512
};

src/test/ui/chalkify/closure.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// known-bug: unknown
2-
// FIXME(chalk): Chalk needs support for the Tuple trait
31
// compile-flags: -Z chalk
42

53
fn main() -> () {
@@ -26,7 +24,7 @@ fn main() -> () {
2624
let mut c = b;
2725

2826
c();
29-
b(); // FIXME: reenable when this is fixed ~ ERROR
27+
b(); //~ ERROR
3028

3129
// FIXME(chalk): this doesn't quite work
3230
/*

src/test/ui/chalkify/closure.stderr

+15-73
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,22 @@
1-
error[E0277]: `()` is not a tuple
2-
--> $DIR/closure.rs:7:5
3-
|
4-
LL | t();
5-
| ^^^ the trait `Tuple` is not implemented for `()`
6-
|
7-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
8-
|
9-
LL | fn main() -> () where (): Tuple {
10-
| +++++++++++++++
11-
12-
error[E0277]: `()` is not a tuple
13-
--> $DIR/closure.rs:13:5
14-
|
15-
LL | b();
16-
| ^^^ the trait `Tuple` is not implemented for `()`
17-
|
18-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
19-
|
20-
LL | fn main() -> () where (): Tuple {
21-
| +++++++++++++++
22-
23-
error[E0277]: `()` is not a tuple
24-
--> $DIR/closure.rs:17:5
25-
|
26-
LL | c();
27-
| ^^^ the trait `Tuple` is not implemented for `()`
28-
|
29-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
30-
|
31-
LL | fn main() -> () where (): Tuple {
32-
| +++++++++++++++
33-
34-
error[E0277]: `()` is not a tuple
35-
--> $DIR/closure.rs:18:5
1+
error[E0382]: borrow of moved value: `b`
2+
--> $DIR/closure.rs:27:5
363
|
4+
LL | let mut c = b;
5+
| - value moved here
6+
...
377
LL | b();
38-
| ^^^ the trait `Tuple` is not implemented for `()`
39-
|
40-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
41-
|
42-
LL | fn main() -> () where (): Tuple {
43-
| +++++++++++++++
44-
45-
error[E0277]: `()` is not a tuple
46-
--> $DIR/closure.rs:24:5
47-
|
48-
LL | b();
49-
| ^^^ the trait `Tuple` is not implemented for `()`
50-
|
51-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
52-
|
53-
LL | fn main() -> () where (): Tuple {
54-
| +++++++++++++++
55-
56-
error[E0277]: `()` is not a tuple
57-
--> $DIR/closure.rs:28:5
58-
|
59-
LL | c();
60-
| ^^^ the trait `Tuple` is not implemented for `()`
61-
|
62-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
63-
|
64-
LL | fn main() -> () where (): Tuple {
65-
| +++++++++++++++
66-
67-
error[E0277]: `()` is not a tuple
68-
--> $DIR/closure.rs:29:5
8+
| ^ value borrowed here after move
699
|
70-
LL | b(); // FIXME: reenable when this is fixed ~ ERROR
71-
| ^^^ the trait `Tuple` is not implemented for `()`
10+
note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `a` out of its environment
11+
--> $DIR/closure.rs:20:9
7212
|
73-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
13+
LL | a = 1;
14+
| ^
15+
help: consider mutably borrowing `b`
7416
|
75-
LL | fn main() -> () where (): Tuple {
76-
| +++++++++++++++
17+
LL | let mut c = &mut b;
18+
| ++++
7719

78-
error: aborting due to 7 previous errors
20+
error: aborting due to previous error
7921

80-
For more information about this error, try `rustc --explain E0277`.
22+
For more information about this error, try `rustc --explain E0382`.

src/test/ui/chalkify/trait-objects.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// known-bug: unknown
2-
// FIXME(chalk): Chalk needs support for the Tuple trait
1+
// check-pass
32
// compile-flags: -Z chalk
43

54
use std::fmt::Display;

src/test/ui/chalkify/trait-objects.stderr

-32
This file was deleted.

0 commit comments

Comments
 (0)