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
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/associated-consts/associated-const-array-len.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
174 B
Rust
Raw Normal View History

Support generic associated consts
2015-08-03 22:16:24 -04:00
trait Foo {
const ID: usize;
Catch associated consts that depend on type parameters in type checking. Constants with values that depend on generic parameters or `Self` cause ICEs in `check_const`, and are not yet accepted via RFC, so we need to throw a proper error in these cases.
2015-05-04 01:39:10 -06:00
}
rustc_const_eval: always demand typeck_tables for evaluating constants.
2017-02-15 15:00:20 +02:00
const X: [i32; <i32 as Foo>::ID] = [0, 1, 2];
//~^ ERROR the trait bound `i32: Foo` is not satisfied
Catch associated consts that depend on type parameters in type checking. Constants with values that depend on generic parameters or `Self` cause ICEs in `check_const`, and are not yet accepted via RFC, so we need to throw a proper error in these cases.
2015-05-04 01:39:10 -06:00
Support generic associated consts
2015-08-03 22:16:24 -04:00
fn main() {
assert_eq!(1, X);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2803ms Template: 3ms
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