2022-01-26 11:02:58 -06:00
|
|
|
#![feature(associated_const_equality)]
|
|
|
|
#![allow(unused)]
|
|
|
|
|
|
|
|
pub trait Foo {
|
|
|
|
const N: usize;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait FooTy {
|
|
|
|
type T;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Bar;
|
|
|
|
|
|
|
|
impl Foo for Bar {
|
|
|
|
const N: usize = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl FooTy for Bar {
|
|
|
|
type T = usize;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn foo<F: Foo<N=usize>>() {}
|
2022-07-29 00:48:40 -05:00
|
|
|
//~^ ERROR expected associated constant bound, found type
|
2022-01-26 11:02:58 -06:00
|
|
|
fn foo2<F: FooTy<T=3usize>>() {}
|
2022-07-29 00:48:40 -05:00
|
|
|
//~^ ERROR expected associated type bound, found constant
|
2022-01-26 11:02:58 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo::<Bar>();
|
|
|
|
foo2::<Bar>();
|
|
|
|
}
|