aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-29 20:33:52 +0100
committerGitHub <[email protected]>2020-05-29 20:33:52 +0100
commit3689c8c3f67ed8ed63674ef50c6022fc91db2e13 (patch)
tree25027a80f19cfb9ce218a2877ce6f39d5cae7734
parent30658b25d2bb00ec495e0f3396de772141482081 (diff)
parentab28f6c24909f2424c6f1d85d1518fa4269fbaae (diff)
Merge #4652
4652: Upgrade Chalk r=kjeremy a=flodiebold Fixes #4072. Co-authored-by: Florian Diebold <[email protected]>
-rw-r--r--Cargo.lock20
-rw-r--r--crates/ra_hir_ty/Cargo.toml4
-rw-r--r--crates/ra_hir_ty/src/tests/traits.rs54
3 files changed, 56 insertions, 22 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 1159d0f1d..def4ed45e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -112,17 +112,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
112checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 112checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
113 113
114[[package]] 114[[package]]
115name = "chalk-base"
116version = "0.10.1-dev"
117source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb"
118dependencies = [
119 "lazy_static",
120]
121
122[[package]]
123name = "chalk-derive" 115name = "chalk-derive"
124version = "0.10.1-dev" 116version = "0.10.1-dev"
125source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb" 117source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
126dependencies = [ 118dependencies = [
127 "proc-macro2", 119 "proc-macro2",
128 "quote", 120 "quote",
@@ -133,9 +125,8 @@ dependencies = [
133[[package]] 125[[package]]
134name = "chalk-engine" 126name = "chalk-engine"
135version = "0.10.1-dev" 127version = "0.10.1-dev"
136source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb" 128source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
137dependencies = [ 129dependencies = [
138 "chalk-base",
139 "chalk-derive", 130 "chalk-derive",
140 "chalk-ir", 131 "chalk-ir",
141 "rustc-hash", 132 "rustc-hash",
@@ -144,18 +135,17 @@ dependencies = [
144[[package]] 135[[package]]
145name = "chalk-ir" 136name = "chalk-ir"
146version = "0.10.1-dev" 137version = "0.10.1-dev"
147source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb" 138source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
148dependencies = [ 139dependencies = [
149 "chalk-base",
150 "chalk-derive", 140 "chalk-derive",
141 "lazy_static",
151] 142]
152 143
153[[package]] 144[[package]]
154name = "chalk-solve" 145name = "chalk-solve"
155version = "0.10.1-dev" 146version = "0.10.1-dev"
156source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb" 147source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
157dependencies = [ 148dependencies = [
158 "chalk-base",
159 "chalk-derive", 149 "chalk-derive",
160 "chalk-engine", 150 "chalk-engine",
161 "chalk-ir", 151 "chalk-ir",
diff --git a/crates/ra_hir_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml
index 6afed58a1..4b8dcdc07 100644
--- a/crates/ra_hir_ty/Cargo.toml
+++ b/crates/ra_hir_ty/Cargo.toml
@@ -27,8 +27,8 @@ test_utils = { path = "../test_utils" }
27 27
28scoped-tls = "1" 28scoped-tls = "1"
29 29
30chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "5a3b871ca17529ab5aa5787594fabad1634936cb" } 30chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "329b7f3fdd2431ed6f6778cde53f22374c7d094c" }
31chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "5a3b871ca17529ab5aa5787594fabad1634936cb" } 31chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "329b7f3fdd2431ed6f6778cde53f22374c7d094c" }
32 32
33[dev-dependencies] 33[dev-dependencies]
34insta = "0.16.0" 34insta = "0.16.0"
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs
index 0419bc751..e8778d419 100644
--- a/crates/ra_hir_ty/src/tests/traits.rs
+++ b/crates/ra_hir_ty/src/tests/traits.rs
@@ -2665,7 +2665,6 @@ fn test() {
2665 Enum::Variant.test(); 2665 Enum::Variant.test();
2666} 2666}
2667"#, true), 2667"#, true),
2668 // wrong result, because the built-in Copy impl for fn defs doesn't exist in Chalk yet
2669 @r###" 2668 @r###"
2670 42..44 '{}': () 2669 42..44 '{}': ()
2671 61..62 'T': {unknown} 2670 61..62 'T': {unknown}
@@ -2674,13 +2673,13 @@ fn test() {
2674 146..150 'self': &Self 2673 146..150 'self': &Self
2675 202..282 '{ ...t(); }': () 2674 202..282 '{ ...t(); }': ()
2676 208..211 'foo': fn foo() 2675 208..211 'foo': fn foo()
2677 208..218 'foo.test()': {unknown} 2676 208..218 'foo.test()': bool
2678 224..227 'bar': fn bar<{unknown}>({unknown}) -> {unknown} 2677 224..227 'bar': fn bar<{unknown}>({unknown}) -> {unknown}
2679 224..234 'bar.test()': {unknown} 2678 224..234 'bar.test()': bool
2680 240..246 'Struct': Struct(usize) -> Struct 2679 240..246 'Struct': Struct(usize) -> Struct
2681 240..253 'Struct.test()': {unknown} 2680 240..253 'Struct.test()': bool
2682 259..272 'Enum::Variant': Variant(usize) -> Enum 2681 259..272 'Enum::Variant': Variant(usize) -> Enum
2683 259..279 'Enum::...test()': {unknown} 2682 259..279 'Enum::...test()': bool
2684 "### 2683 "###
2685 ); 2684 );
2686} 2685}
@@ -2754,3 +2753,48 @@ fn test() {
2754 "### 2753 "###
2755 ); 2754 );
2756} 2755}
2756
2757#[test]
2758fn integer_range_iterate() {
2759 let t = type_at(
2760 r#"
2761//- /main.rs crate:main deps:std
2762fn test() {
2763 for x in 0..100 { x<|>; }
2764}
2765
2766//- /std.rs crate:std
2767pub mod ops {
2768 pub struct Range<Idx> {
2769 pub start: Idx,
2770 pub end: Idx,
2771 }
2772}
2773
2774pub 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
2790trait Step {}
2791impl Step for i32 {}
2792impl Step for i64 {}
2793
2794impl<A: Step> iter::Iterator for ops::Range<A> {
2795 type Item = A;
2796}
2797"#,
2798 );
2799 assert_eq!(t, "i32");
2800}