Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
300901b70509a0af2d971aa6f6104300da24212c
rust/tests/ui/associated-consts/assoc-const.rs

23 lines
252 B
Rust
Raw Normal View History

Continue work on assoc const eq
2022-01-27 14:40:38 +00:00
// run-pass
Update with final comments
2022-01-14 19:01:35 +00:00
#![feature(associated_const_equality)]
Continue work on assoc const eq
2022-01-27 14:40:38 +00:00
#![allow(unused)]
Update with final comments
2022-01-14 19:01:35 +00:00
add eq constraints on associated constants
2021-07-30 08:56:45 +00:00
pub trait Foo {
const N: usize;
}
pub struct Bar;
impl Foo for Bar {
const N: usize = 3;
}
Use Term in ProjectionPredicate ProjectionPredicate should be able to handle both associated types and consts so this adds the first step of that. It mainly just pipes types all the way down, not entirely sure how to handle consts, but hopefully that'll come with time.
2022-01-08 09:28:12 +00:00
const TEST:usize = 3;
Continue work on assoc const eq
2022-01-27 14:40:38 +00:00
fn foo<F: Foo<N=3usize>>() {}
Use Term in ProjectionPredicate ProjectionPredicate should be able to handle both associated types and consts so this adds the first step of that. It mainly just pipes types all the way down, not entirely sure how to handle consts, but hopefully that'll come with time.
2022-01-08 09:28:12 +00:00
Continue work on assoc const eq
2022-01-27 14:40:38 +00:00
fn main() {
foo::<Bar>()
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 515ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API