aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests/regression.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-07 10:49:37 +0000
committerGitHub <[email protected]>2020-12-07 10:49:37 +0000
commit403ed489ff51e4b1d9b1bbde1ddb6f765ebcbd1f (patch)
tree29c3c7ffa25d23582972d58afea77da75e6a2b50 /crates/hir_ty/src/tests/regression.rs
parenta0fa522fdaf25daff6a2a9794214f0e0bedc5c24 (diff)
parent78dd5482438b1ba13b4aa2eaa9a7c443a3342ce4 (diff)
Merge #6597
6597: Upgrade Chalk r=flodiebold a=flodiebold Also make overflow depth and max type size configurable through env variables. This can be helpful at least for debugging. Tests currently fail because of rust-lang/chalk#656, so we'll need to wait for the next update to merge this. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/tests/regression.rs')
-rw-r--r--crates/hir_ty/src/tests/regression.rs43
1 files changed, 43 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs
index 94d86b0d1..8cf4e7012 100644
--- a/crates/hir_ty/src/tests/regression.rs
+++ b/crates/hir_ty/src/tests/regression.rs
@@ -840,3 +840,46 @@ fn issue_4966() {
840 "#]], 840 "#]],
841 ); 841 );
842} 842}
843
844#[test]
845fn issue_6628() {
846 check_infer(
847 r#"
848 #[lang = "fn_once"]
849 pub trait FnOnce<Args> {
850 type Output;
851 }
852
853 struct S<T>();
854 impl<T> S<T> {
855 fn f(&self, _t: T) {}
856 fn g<F: FnOnce(&T)>(&self, _f: F) {}
857 }
858 fn main() {
859 let s = S();
860 s.g(|_x| {});
861 s.f(10);
862 }
863 "#,
864 expect![[r#"
865 105..109 'self': &S<T>
866 111..113 '_t': T
867 118..120 '{}': ()
868 146..150 'self': &S<T>
869 152..154 '_f': F
870 159..161 '{}': ()
871 174..225 '{ ...10); }': ()
872 184..185 's': S<i32>
873 188..189 'S': S<i32>() -> S<i32>
874 188..191 'S()': S<i32>
875 197..198 's': S<i32>
876 197..209 's.g(|_x| {})': ()
877 201..208 '|_x| {}': |&i32| -> ()
878 202..204 '_x': &i32
879 206..208 '{}': ()
880 215..216 's': S<i32>
881 215..222 's.f(10)': ()
882 219..221 '10': i32
883 "#]],
884 );
885}