Auto merge of #140646 - tgross35:rollup-z3hjbm6, r=tgross35

Rollup of 6 pull requests

Successful merges:

 - #137280 (stabilize ptr::swap_nonoverlapping in const)
 - #140457 (Use target-cpu=z13 on s390x codegen const vector test)
 - #140619 (Small adjustments to `check_attribute_safety` to make the logic more obvious)
 - #140625 (Suggest `retain_mut` over `retain` as `Vec::extract_if` alternative)
 - #140627 (Allow linking rustc and rustdoc against the same single tracing crate)
 - #140630 (Async drop source info fix for proxy-drop-coroutine)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-05-04 23:07:18 +00:00
commit 2958d8969c
16 changed files with 181 additions and 37 deletions

View file

@ -1,7 +1,5 @@
//@ compile-flags: -Z ui-testing=no
#![feature(const_swap_nonoverlapping)]
use std::{
mem::{self, MaybeUninit},
ptr,

View file

@ -1,11 +1,11 @@
error[E0080]: evaluation of constant value failed
--> $DIR/missing_span_in_backtrace.rs:16:9
--> $DIR/missing_span_in_backtrace.rs:14:9
|
16 | / ptr::swap_nonoverlapping(
17 | | &mut ptr1 as *mut _ as *mut MaybeUninit<u8>,
18 | | &mut ptr2 as *mut _ as *mut MaybeUninit<u8>,
19 | | mem::size_of::<&i32>(),
20 | | );
14 | / ptr::swap_nonoverlapping(
15 | | &mut ptr1 as *mut _ as *mut MaybeUninit<u8>,
16 | | &mut ptr2 as *mut _ as *mut MaybeUninit<u8>,
17 | | mem::size_of::<&i32>(),
18 | | );
| |_________^ unable to copy parts of a pointer from memory at ALLOC0
|
note: inside `swap_nonoverlapping::<MaybeUninit<u8>>`

View file

@ -0,0 +1,7 @@
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn safe(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}

View file

@ -0,0 +1,22 @@
//! Anti-regression test for `#[safe]` proc-macro attribute.
//@ revisions: unknown_attr proc_macro_attr
//@[proc_macro_attr] proc-macro: safe_attr.rs
//@[proc_macro_attr] check-pass
#![warn(unsafe_attr_outside_unsafe)]
#[cfg(proc_macro_attr)]
extern crate safe_attr;
#[cfg(proc_macro_attr)]
use safe_attr::safe;
#[safe]
//[unknown_attr]~^ ERROR cannot find attribute `safe` in this scope
fn foo() {}
#[safe(no_mangle)]
//[unknown_attr]~^ ERROR cannot find attribute `safe` in this scope
fn bar() {}
fn main() {}

View file

@ -0,0 +1,14 @@
error: cannot find attribute `safe` in this scope
--> $DIR/safe-proc-macro-attribute.rs:18:3
|
LL | #[safe(no_mangle)]
| ^^^^
error: cannot find attribute `safe` in this scope
--> $DIR/safe-proc-macro-attribute.rs:14:3
|
LL | #[safe]
| ^^^^
error: aborting due to 2 previous errors