Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
6871d43d4cd1f7df246958af6c552911ef7a8933
rust/src/test/ui/array-slice-vec/array_const_index-1.rs

13 lines
266 B
Rust
Raw Normal View History

Add `// run-pass` annotations to all the tests under `ui/run-pass/`. (I may have accidentally added it to some auxilliary crates as well; my emacs-macro-based methodology was pretty crude.)
2018-08-30 14:18:55 +02:00
// run-pass
Add `#![allow(..)]` as necessary to get re-migrated run-pass tests compiling with clean stderr again. Most were added mechanically.
2018-09-25 23:51:35 +02:00
#![allow(dead_code)]
Add `#![allow(..)]` for a slew of lints of migrated run-pass tests, to silence stderr output.
2018-08-31 15:02:01 +02:00
#![allow(stable_features)]
Add `// run-pass` annotations to all the tests under `ui/run-pass/`. (I may have accidentally added it to some auxilliary crates as well; my emacs-macro-based methodology was pretty crude.)
2018-08-30 14:18:55 +02:00
add feature gate `const_indexing` tracking issue is #29947
2015-11-20 10:43:04 +01:00
#![feature(const_indexing)]
allow indexing into constant arrays
2015-11-18 10:57:52 +01:00
fn main() {
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
const IDX: usize = 3;
const VAL: i32 = ARR[IDX];
const BLUB: [i32; (ARR[0] - 41) as usize] = [5];
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2360ms 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