Skip to content

Commit 3689c8c

Browse files
Merge #4652
4652: Upgrade Chalk r=kjeremy a=flodiebold Fixes #4072. Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2 parents 30658b2 + ab28f6c commit 3689c8c

File tree

3 files changed

+56
-22
lines changed

3 files changed

+56
-22
lines changed

Cargo.lock

Lines changed: 5 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ra_hir_ty/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ test_utils = { path = "../test_utils" }
2727

2828
scoped-tls = "1"
2929

30-
chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "5a3b871ca17529ab5aa5787594fabad1634936cb" }
31-
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "5a3b871ca17529ab5aa5787594fabad1634936cb" }
30+
chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "329b7f3fdd2431ed6f6778cde53f22374c7d094c" }
31+
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "329b7f3fdd2431ed6f6778cde53f22374c7d094c" }
3232

3333
[dev-dependencies]
3434
insta = "0.16.0"

crates/ra_hir_ty/src/tests/traits.rs

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,7 +2665,6 @@ fn test() {
26652665
Enum::Variant.test();
26662666
}
26672667
"#, true),
2668-
// wrong result, because the built-in Copy impl for fn defs doesn't exist in Chalk yet
26692668
@r###"
26702669
42..44 '{}': ()
26712670
61..62 'T': {unknown}
@@ -2674,13 +2673,13 @@ fn test() {
26742673
146..150 'self': &Self
26752674
202..282 '{ ...t(); }': ()
26762675
208..211 'foo': fn foo()
2677-
208..218 'foo.test()': {unknown}
2676+
208..218 'foo.test()': bool
26782677
224..227 'bar': fn bar<{unknown}>({unknown}) -> {unknown}
2679-
224..234 'bar.test()': {unknown}
2678+
224..234 'bar.test()': bool
26802679
240..246 'Struct': Struct(usize) -> Struct
2681-
240..253 'Struct.test()': {unknown}
2680+
240..253 'Struct.test()': bool
26822681
259..272 'Enum::Variant': Variant(usize) -> Enum
2683-
259..279 'Enum::...test()': {unknown}
2682+
259..279 'Enum::...test()': bool
26842683
"###
26852684
);
26862685
}
@@ -2754,3 +2753,48 @@ fn test() {
27542753
"###
27552754
);
27562755
}
2756+
2757+
#[test]
2758+
fn integer_range_iterate() {
2759+
let t = type_at(
2760+
r#"
2761+
//- /main.rs crate:main deps:std
2762+
fn test() {
2763+
for x in 0..100 { x<|>; }
2764+
}
2765+
2766+
//- /std.rs crate:std
2767+
pub mod ops {
2768+
pub struct Range<Idx> {
2769+
pub start: Idx,
2770+
pub end: Idx,
2771+
}
2772+
}
2773+
2774+
pub mod iter {
2775+
pub trait Iterator {
2776+
type Item;
2777+
}
2778+
2779+
pub trait IntoIterator {
2780+
type Item;
2781+
type IntoIter: Iterator<Item = Self::Item>;
2782+
}
2783+
2784+
impl<T> IntoIterator for T where T: Iterator {
2785+
type Item = <T as Iterator>::Item;
2786+
type IntoIter = Self;
2787+
}
2788+
}
2789+
2790+
trait Step {}
2791+
impl Step for i32 {}
2792+
impl Step for i64 {}
2793+
2794+
impl<A: Step> iter::Iterator for ops::Range<A> {
2795+
type Item = A;
2796+
}
2797+
"#,
2798+
);
2799+
assert_eq!(t, "i32");
2800+
}

0 commit comments

Comments
 (0)