-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
170d6cb
commit 7b42f6e
Showing
42 changed files
with
172 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,27 @@ | ||
error[E0658]: referencing statics in constants is unstable | ||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block | ||
--> $DIR/type-check-4.rs:24:25 | ||
| | ||
LL | global_asm!("{}", const S); | ||
| ^ | ||
| ^ use of mutable static | ||
| | ||
= note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information | ||
= help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
= note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. | ||
= help: to fix this, the value can be extracted to a `const` and then used. | ||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior | ||
|
||
error[E0658]: referencing statics in constants is unstable | ||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block | ||
--> $DIR/type-check-4.rs:27:35 | ||
| | ||
LL | global_asm!("{}", const const_foo(S)); | ||
| ^ | ||
| ^ use of mutable static | ||
| | ||
= note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information | ||
= help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
= note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. | ||
= help: to fix this, the value can be extracted to a `const` and then used. | ||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior | ||
|
||
error[E0658]: referencing statics in constants is unstable | ||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block | ||
--> $DIR/type-check-4.rs:30:35 | ||
| | ||
LL | global_asm!("{}", const const_bar(S)); | ||
| ^ | ||
| ^ use of mutable static | ||
| | ||
= note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information | ||
= help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
= note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. | ||
= help: to fix this, the value can be extracted to a `const` and then used. | ||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. | ||
For more information about this error, try `rustc --explain E0133`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
//@ only-x86_64 | ||
//@ compile-flags: -C target-feature=+avx512f | ||
|
||
use std::arch::{asm, global_asm}; | ||
|
||
use std::arch::x86_64::{_mm256_setzero_ps, _mm_setzero_ps}; | ||
use std::arch::{asm, global_asm}; | ||
|
||
fn main() {} | ||
|
||
// Constants must be... constant | ||
|
||
static S: i32 = 1; | ||
static mut S: i32 = 1; | ||
const fn const_foo(x: i32) -> i32 { | ||
x | ||
} | ||
const fn const_bar<T>(x: T) -> T { | ||
x | ||
} | ||
global_asm!("{}", const S); | ||
//~^ ERROR referencing statics | ||
//~^ ERROR: use of mutable static is unsafe | ||
global_asm!("{}", const const_foo(0)); | ||
global_asm!("{}", const const_foo(S)); | ||
//~^ ERROR referencing statics | ||
//~^ ERROR: use of mutable static is unsafe | ||
global_asm!("{}", const const_bar(0)); | ||
global_asm!("{}", const const_bar(S)); | ||
//~^ ERROR referencing statics | ||
//~^ ERROR: use of mutable static is unsafe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,27 @@ | ||
error[E0658]: referencing statics in constants is unstable | ||
--> $DIR/type-check-4.rs:19:25 | ||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block | ||
--> $DIR/type-check-4.rs:16:25 | ||
| | ||
LL | global_asm!("{}", const S); | ||
| ^ | ||
| ^ use of mutable static | ||
| | ||
= note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information | ||
= help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
= note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. | ||
= help: to fix this, the value can be extracted to a `const` and then used. | ||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior | ||
|
||
error[E0658]: referencing statics in constants is unstable | ||
--> $DIR/type-check-4.rs:22:35 | ||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block | ||
--> $DIR/type-check-4.rs:19:35 | ||
| | ||
LL | global_asm!("{}", const const_foo(S)); | ||
| ^ | ||
| ^ use of mutable static | ||
| | ||
= note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information | ||
= help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
= note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. | ||
= help: to fix this, the value can be extracted to a `const` and then used. | ||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior | ||
|
||
error[E0658]: referencing statics in constants is unstable | ||
--> $DIR/type-check-4.rs:25:35 | ||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block | ||
--> $DIR/type-check-4.rs:22:35 | ||
| | ||
LL | global_asm!("{}", const const_bar(S)); | ||
| ^ | ||
| ^ use of mutable static | ||
| | ||
= note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information | ||
= help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
= note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. | ||
= help: to fix this, the value can be extracted to a `const` and then used. | ||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. | ||
For more information about this error, try `rustc --explain E0133`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.