Rollup merge of #93802 - lcnr:mcg-woops, r=BoxyUwU

fix oversight in the `min_const_generics` checks

r? `@BoxyUwU`
This commit is contained in:
Matthias Krüger 2022-02-10 12:09:58 +01:00 committed by GitHub
commit f3f41d76ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 3 deletions

View file

@ -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() {}

View file

@ -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