diff options
| author | bors <bors@rust-lang.org> | 2025-03-10 18:38:06 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-10 18:38:06 +0000 | 
| commit | 9fb94b32df38073bf63d009df77ed10cb1c989d0 (patch) | |
| tree | b95874b3300e1579fca2f78dfd200eb55ea1361c /tests/ui/asm/invalid-const-operand.rs | |
| parent | 2b285cd5f0877e30ad1d83e04f8cc46254e43391 (diff) | |
| parent | 44ec67fffbe9f7846d00cf8a0d457cfc681fea08 (diff) | |
| download | rust-9fb94b32df38073bf63d009df77ed10cb1c989d0.tar.gz rust-9fb94b32df38073bf63d009df77ed10cb1c989d0.zip | |
Auto merge of #138310 - matthiaskrgr:rollup-zvbpuei, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #137931 (Add remark for missing `llvm-tools` component re. `rustc_private` linker failures related to not finding LLVM libraries) - #138138 (Pass `InferCtxt` to `InlineAsmCtxt` to properly taint on error) - #138223 (Fix post-merge workflow) - #138268 (Handle empty test suites in GitHub job summary report) - #138278 (Delegation: fix ICE with invalid `MethodCall` generation) - #138281 (Fix O(tests) stack usage in edition 2024 mergeable doctests) - #138305 (Subtree update of `rust-analyzer`) - #138306 (Revert "Use workspace lints for crates in `compiler/` #138084") r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/asm/invalid-const-operand.rs')
| -rw-r--r-- | tests/ui/asm/invalid-const-operand.rs | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/tests/ui/asm/invalid-const-operand.rs b/tests/ui/asm/invalid-const-operand.rs index a688f5042db..bbf4001752a 100644 --- a/tests/ui/asm/invalid-const-operand.rs +++ b/tests/ui/asm/invalid-const-operand.rs @@ -14,7 +14,7 @@ global_asm!("{}", const 0f32); global_asm!("{}", const 0 as *mut u8); //~^ ERROR invalid type for `const` operand -fn main() { +fn test1() { unsafe { // Const operands must be integers and must be constants. @@ -27,7 +27,11 @@ fn main() { //~^ ERROR invalid type for `const` operand asm!("{}", const &0); //~^ ERROR invalid type for `const` operand + } +} +fn test2() { + unsafe { // Constants must be... constant let x = 0; @@ -47,3 +51,5 @@ fn main() { //~^ ERROR attempt to use a non-constant value in a constant } } + +fn main() {} | 
