Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/traits.rs')
-rw-r--r--crates/hir-ty/src/tests/traits.rs26
1 files changed, 25 insertions, 1 deletions
diff --git a/crates/hir-ty/src/tests/traits.rs b/crates/hir-ty/src/tests/traits.rs
index 87f488f7aa..eb4ae5ec8a 100644
--- a/crates/hir-ty/src/tests/traits.rs
+++ b/crates/hir-ty/src/tests/traits.rs
@@ -349,7 +349,6 @@ fn test() {
#[test]
fn trait_default_method_self_bound_implements_trait() {
- cov_mark::check!(trait_self_implements_self);
check(
r#"
trait Trait {
@@ -5032,3 +5031,28 @@ fn main() {
"#]],
);
}
+
+#[test]
+fn implicit_sized_bound_on_param() {
+ check(
+ r#"
+//- minicore: sized
+struct PBox<T, A>(T, A);
+
+impl<T, A> PBox<T, A> {
+ fn token_with(self) {}
+}
+
+trait MoveMessage {
+ fn token<A>(self, alloc: A)
+ where
+ Self: Sized,
+ {
+ let b = PBox::<Self, A>(self, alloc);
+ b.token_with();
+ // ^^^^^^^^^^^^^^ type: ()
+ }
+}
+ "#,
+ );
+}