about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-10 12:09:58 +0100
committerGitHub <noreply@github.com>2022-02-10 12:09:58 +0100
commitf3f41d76ad3f64ffc5ff22cb510bfd64c50e8d79 (patch)
tree8d7be9344d6da4a253c0ff93fcdad23205b80efb /src
parent584948d1be47178a10841e5d59dc0eecc8022ffe (diff)
parent76c562f3b30e0d033902d004fdb0069d5584d78a (diff)
downloadrust-f3f41d76ad3f64ffc5ff22cb510bfd64c50e8d79.tar.gz
rust-f3f41d76ad3f64ffc5ff22cb510bfd64c50e8d79.zip
Rollup merge of #93802 - lcnr:mcg-woops, r=BoxyUwU
fix oversight in the `min_const_generics` checks

r? `@BoxyUwU`
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs15
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr14
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs
new file mode 100644
index 00000000000..e1cf7b579aa
--- /dev/null
+++ b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs
@@ -0,0 +1,15 @@
+trait AlwaysApplicable {
+    type Assoc;
+}
+impl<T: ?Sized> AlwaysApplicable for T {
+    type Assoc = usize;
+}
+
+trait BindsParam<T> {
+    type ArrayTy;
+}
+impl<T> BindsParam<T> for <T as AlwaysApplicable>::Assoc {
+    type ArrayTy = [u8; Self::MAX]; //~ ERROR generic `Self` types
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr
new file mode 100644
index 00000000000..bda88597006
--- /dev/null
+++ b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr
@@ -0,0 +1,14 @@
+error: generic `Self` types are currently not permitted in anonymous constants
+  --> $DIR/forbid-self-no-normalize.rs:12:25
+   |
+LL |     type ArrayTy = [u8; Self::MAX];
+   |                         ^^^^
+   |
+note: not a concrete type
+  --> $DIR/forbid-self-no-normalize.rs:11:27
+   |
+LL | impl<T> BindsParam<T> for <T as AlwaysApplicable>::Assoc {
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+