diff options
author | Jonas Schievink <[email protected]> | 2021-04-07 02:33:22 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-07 02:33:22 +0100 |
commit | 7c1c0e6feadc017f5919f789f974405635fc25e3 (patch) | |
tree | be2ec91cdd13c8125e560bb414a37866ae573642 /crates/hir_ty/src/tests/method_resolution.rs | |
parent | f04f38d3d79c3cc51956bc530a34e32945cdb294 (diff) |
Collect trait impls inside unnamed consts
Diffstat (limited to 'crates/hir_ty/src/tests/method_resolution.rs')
-rw-r--r-- | crates/hir_ty/src/tests/method_resolution.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs index 61f18b0d2..4b2c82b41 100644 --- a/crates/hir_ty/src/tests/method_resolution.rs +++ b/crates/hir_ty/src/tests/method_resolution.rs | |||
@@ -1292,3 +1292,25 @@ mod b { | |||
1292 | "#]], | 1292 | "#]], |
1293 | ) | 1293 | ) |
1294 | } | 1294 | } |
1295 | |||
1296 | #[test] | ||
1297 | fn impl_in_unnamed_const() { | ||
1298 | check_types( | ||
1299 | r#" | ||
1300 | struct S; | ||
1301 | |||
1302 | trait Tr { | ||
1303 | fn method(&self) -> u16; | ||
1304 | } | ||
1305 | |||
1306 | const _: () = { | ||
1307 | impl Tr for S {} | ||
1308 | }; | ||
1309 | |||
1310 | fn f() { | ||
1311 | S.method(); | ||
1312 | //^^^^^^^^^^ u16 | ||
1313 | } | ||
1314 | "#, | ||
1315 | ); | ||
1316 | } | ||