blob: 7211637659bd390adbda31f683698b31258f23e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#![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>>() {}
//~^ ERROR expected constant, found type
fn foo2<F: FooTy<T = 3usize>>() {}
//~^ ERROR expected type, found constant
fn main() {
foo::<Bar>();
foo2::<Bar>();
}
|