Auto merge of #140735 - GuillaumeGomez:rollup-dlhbxsg, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #139518 (Stabilize precise capture syntax in style guide)
 - #140398 (Fix backtrace for cygwin)
 - #140719 (fix typo in autorefs lint doc example)
 - #140724 (Update `compiler-builtins` to 0.1.158)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-05-07 09:31:15 +00:00
commit db0e836148
8 changed files with 26 additions and 25 deletions

View file

@ -15,9 +15,9 @@ declare_lint! {
///
/// ```rust
/// unsafe fn fun(ptr: *mut [u8]) -> *mut [u8] {
/// &raw mut (*ptr)[..16]
/// // ^^^^^^ this calls `IndexMut::index_mut(&mut ..., ..16)`,
/// // implicitly creating a reference
/// unsafe { &raw mut (*ptr)[..16] }
/// // ^^^^^^ this calls `IndexMut::index_mut(&mut ..., ..16)`,
/// // implicitly creating a reference
/// }
/// ```
///
@ -34,17 +34,17 @@ declare_lint! {
///
/// ```rust
/// unsafe fn fun(ptr: *mut [u8]) -> *mut [u8] {
/// &raw mut (&mut *ptr)[..16]
/// unsafe { &raw mut (&mut *ptr)[..16] }
/// }
/// ```
///
/// Otherwise try to find an alternative way to achive your goals using only raw pointers:
///
/// ```rust
/// use std::slice;
/// use std::ptr;
///
/// unsafe fn fun(ptr: *mut [u8]) -> *mut [u8] {
/// slice::from_raw_parts_mut(ptr.cast(), 16)
/// fn fun(ptr: *mut [u8]) -> *mut [u8] {
/// ptr::slice_from_raw_parts_mut(ptr.cast(), 16)
/// }
/// ```
pub DANGEROUS_IMPLICIT_AUTOREFS,

View file

@ -61,9 +61,9 @@ dependencies = [
[[package]]
name = "compiler_builtins"
version = "0.1.157"
version = "0.1.158"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74f103f5a97b25e3ed7134dee586e90bbb0496b33ba41816f0e7274e5bb73b50"
checksum = "164cdc689e4c6d69417f77a5f48be240c291e84fbef0b1281755dc754b19c809"
dependencies = [
"cc",
"rustc-std-workspace-core",

View file

@ -16,7 +16,7 @@ bench = false
[dependencies]
core = { path = "../core", public = true }
compiler_builtins = { version = "=0.1.157", features = ['rustc-dep-of-std'] }
compiler_builtins = { version = "=0.1.158", features = ['rustc-dep-of-std'] }
[features]
compiler-builtins-mem = ['compiler_builtins/mem']

@ -1 +1 @@
Subproject commit 9d2c34e7e63afe1e71c333b247065e3b7ba4d883
Subproject commit 6c882eb11984d737f62e85f36703effaf34c2453

View file

@ -18,7 +18,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
core = { path = "../core", public = true }
compiler_builtins = { version = "=0.1.157" }
compiler_builtins = { version = "=0.1.158" }
unwind = { path = "../unwind" }
hashbrown = { version = "0.15", default-features = false, features = [
'rustc-dep-of-std',
@ -57,7 +57,7 @@ object = { version = "0.36.0", default-features = false, optional = true, featur
'archive',
] }
[target.'cfg(windows)'.dependencies.windows-targets]
[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies.windows-targets]
path = "../windows_targets"
[dev-dependencies]

View file

@ -34,6 +34,7 @@ pub macro link {
}
#[cfg(not(feature = "windows_raw_dylib"))]
#[cfg(not(target_os = "cygwin"))] // Cygwin doesn't need these libs
#[cfg_attr(target_vendor = "win7", link(name = "advapi32"))]
#[link(name = "ntdll")]
#[link(name = "userenv")]

View file

@ -5,15 +5,3 @@ This chapter documents style and formatting for nightly-only syntax. The rest of
Style and formatting for nightly-only syntax should be removed from this chapter and integrated into the appropriate sections of the style guide at the time of stabilization.
There is no guarantee of the stability of this chapter in contrast to the rest of the style guide. Refer to the style team policy for nightly formatting procedure regarding breaking changes to this chapter.
### `feature(precise_capturing)`
A `use<'a, T>` precise capturing bound is formatted as if it were a single path segment with non-turbofished angle-bracketed args, like a trait bound whose identifier is `use`.
```
fn foo() -> impl Sized + use<'a> {}
// is formatted analogously to:
fn foo() -> impl Sized + Use<'a> {}
```

View file

@ -59,3 +59,15 @@ Box<
+ Debug
>
```
## Precise capturing bounds
A `use<'a, T>` precise capturing bound is formatted as if it were a single path segment with non-turbofished angle-bracketed args, like a trait bound whose identifier is `use`.
```rust
fn foo() -> impl Sized + use<'a> {}
// is formatted analogously to:
fn foo() -> impl Sized + Use<'a> {}
```