about summary refs log tree commit diff
path: root/tests/ui/associated-consts/assoc-const-eq-missing.rs
blob: f384927e4a34fd993aaa15834e0ff70da748a890 (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
#![feature(associated_const_equality)]
#![allow(unused)]

pub trait Foo {
  const N: usize;
}

pub struct Bar;

impl Foo for Bar {
  const N: usize = 3;
}

fn foo1<F: Foo<Z = 3>>() {}
//~^ ERROR associated constant `Z` not found for `Foo`
fn foo2<F: Foo<Z = usize>>() {}
//~^ ERROR associated type `Z` not found for `Foo`
fn foo3<F: Foo<Z = 5>>() {}
//~^ ERROR associated constant `Z` not found for `Foo`

fn main() {
  foo1::<Bar>();
  foo2::<Bar>();
  foo3::<Bar>();
}