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
55b6f649024b372af901b3412a6d36c4284ccf3d
rust/tests/ui/static/issue-18118-2.rs

7 lines
141 B
Rust
Raw Normal View History

move const block checks before lowering step this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet).
2016-01-15 13:16:54 +01:00
pub fn main() {
const z: &'static isize = {
static p: isize = 3;
Clarify suggestion for E0013
2020-01-10 13:31:36 +00:00
&p //~ ERROR constants cannot refer to statics
move const block checks before lowering step this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet).
2016-01-15 13:16:54 +01:00
};
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2691ms 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