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
b60f7b51a27dfd9cbc5ecaa56ee679cd1b67f4c4
rust/tests/codegen/noalias-box-off.rs

12 lines
258 B
Rust
Raw Normal View History

Add flag to configure `noalias` on `Box<T>` To aid making an informed decision about the aliasing rules of box, give users an option to remove `noalias` from box.
2022-07-18 18:17:27 +02:00
// compile-flags: -O -Z box-noalias=no
#![crate_type = "lib"]
// CHECK-LABEL: @box_should_not_have_noalias_if_disabled(
make noalias-box-off filecheck more precise The CHECK, -NOT, -SAME pattern ensures that the `CHECK-NOT: noalias` is limited to only one line, and won't match unrelated lines further down in the file. Explicit drop call added to preserve the `foo` argument name, since names of unused arguments are not preserved.
2023-05-20 19:41:28 -04:00
// CHECK-NOT: noalias
// CHECK-SAME: %foo)
Add flag to configure `noalias` on `Box<T>` To aid making an informed decision about the aliasing rules of box, give users an option to remove `noalias` from box.
2022-07-18 18:17:27 +02:00
#[no_mangle]
make noalias-box-off filecheck more precise The CHECK, -NOT, -SAME pattern ensures that the `CHECK-NOT: noalias` is limited to only one line, and won't match unrelated lines further down in the file. Explicit drop call added to preserve the `foo` argument name, since names of unused arguments are not preserved.
2023-05-20 19:41:28 -04:00
pub fn box_should_not_have_noalias_if_disabled(foo: Box<u8>) {
drop(foo);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 568ms Template: 4ms
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