diff options
author | Laurențiu Nicola <[email protected]> | 2020-07-20 20:01:09 +0100 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2020-07-20 20:01:09 +0100 |
commit | b8e09b7f4e2ae868a5877c39216a2eadb1b42824 (patch) | |
tree | fa97381d2f01da2f7923026562e0f3c772be6528 /crates/ra_hir_ty/src/tests.rs | |
parent | 3b6979be77dcce37edd5f29607c5fd41252e312d (diff) |
Inline lang items in coercion tests
Diffstat (limited to 'crates/ra_hir_ty/src/tests.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index 5eaf25a77..59a21092e 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -346,22 +346,8 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() { | |||
346 | } | 346 | } |
347 | } | 347 | } |
348 | 348 | ||
349 | // Infer with some common definitions and impls. | ||
350 | fn check_infer(ra_fixture: &str, expect: Expect) { | 349 | fn check_infer(ra_fixture: &str, expect: Expect) { |
351 | let defs = r#" | 350 | let mut actual = infer(ra_fixture); |
352 | #[lang = "sized"] | ||
353 | pub trait Sized {} | ||
354 | #[lang = "unsize"] | ||
355 | pub trait Unsize<T: ?Sized> {} | ||
356 | #[lang = "coerce_unsized"] | ||
357 | pub trait CoerceUnsized<T> {} | ||
358 | |||
359 | impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {} | ||
360 | impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {} | ||
361 | "#; | ||
362 | |||
363 | // Append to the end to keep positions unchanged. | ||
364 | let mut actual = infer(&format!("{}{}", ra_fixture, defs)); | ||
365 | actual.push('\n'); | 351 | actual.push('\n'); |
366 | expect.assert_eq(&actual); | 352 | expect.assert_eq(&actual); |
367 | } | 353 | } |