about summary refs log tree commit diff
path: root/tests/ui/dropck/dropck-only-error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/dropck/dropck-only-error.rs')
-rw-r--r--tests/ui/dropck/dropck-only-error.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/dropck/dropck-only-error.rs b/tests/ui/dropck/dropck-only-error.rs
new file mode 100644
index 00000000000..e85eeb82e00
--- /dev/null
+++ b/tests/ui/dropck/dropck-only-error.rs
@@ -0,0 +1,23 @@
+// Test that we don't ICE for a typeck error that only shows up in dropck
+// issue #135039
+
+pub trait AuthUser {
+    type Id;
+}
+
+pub trait AuthnBackend {
+    type User: AuthUser;
+}
+
+pub struct AuthSession<Backend: AuthnBackend> {
+    data: Option<<<Backend as AuthnBackend>::User as AuthUser>::Id>,
+}
+
+pub trait Authz: Sized {
+    type AuthnBackend: AuthnBackend<User = Self>;
+}
+
+pub fn run_query<User: Authz>(auth: AuthSession<User::AuthnBackend>) {}
+//~^ ERROR the trait bound `User: AuthUser` is not satisfied [E0277]
+
+fn main() {}