Skip to content

Commit db0e836

Browse files
committed
Auto merge of rust-lang#140735 - GuillaumeGomez:rollup-dlhbxsg, r=GuillaumeGomez
Rollup of 4 pull requests Successful merges: - rust-lang#139518 (Stabilize precise capture syntax in style guide) - rust-lang#140398 (Fix backtrace for cygwin) - rust-lang#140719 (fix typo in autorefs lint doc example) - rust-lang#140724 (Update `compiler-builtins` to 0.1.158) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f76c736 + aca12a8 commit db0e836

File tree

8 files changed

+26
-25
lines changed

8 files changed

+26
-25
lines changed

compiler/rustc_lint/src/autorefs.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ declare_lint! {
1515
///
1616
/// ```rust
1717
/// unsafe fn fun(ptr: *mut [u8]) -> *mut [u8] {
18-
/// &raw mut (*ptr)[..16]
19-
/// // ^^^^^^ this calls `IndexMut::index_mut(&mut ..., ..16)`,
20-
/// // implicitly creating a reference
18+
/// unsafe { &raw mut (*ptr)[..16] }
19+
/// // ^^^^^^ this calls `IndexMut::index_mut(&mut ..., ..16)`,
20+
/// // implicitly creating a reference
2121
/// }
2222
/// ```
2323
///
@@ -34,17 +34,17 @@ declare_lint! {
3434
///
3535
/// ```rust
3636
/// unsafe fn fun(ptr: *mut [u8]) -> *mut [u8] {
37-
/// &raw mut (&mut *ptr)[..16]
37+
/// unsafe { &raw mut (&mut *ptr)[..16] }
3838
/// }
3939
/// ```
4040
///
4141
/// Otherwise try to find an alternative way to achive your goals using only raw pointers:
4242
///
4343
/// ```rust
44-
/// use std::slice;
44+
/// use std::ptr;
4545
///
46-
/// unsafe fn fun(ptr: *mut [u8]) -> *mut [u8] {
47-
/// slice::from_raw_parts_mut(ptr.cast(), 16)
46+
/// fn fun(ptr: *mut [u8]) -> *mut [u8] {
47+
/// ptr::slice_from_raw_parts_mut(ptr.cast(), 16)
4848
/// }
4949
/// ```
5050
pub DANGEROUS_IMPLICIT_AUTOREFS,

library/Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ dependencies = [
6161

6262
[[package]]
6363
name = "compiler_builtins"
64-
version = "0.1.157"
64+
version = "0.1.158"
6565
source = "registry+https://github.com/rust-lang/crates.io-index"
66-
checksum = "74f103f5a97b25e3ed7134dee586e90bbb0496b33ba41816f0e7274e5bb73b50"
66+
checksum = "164cdc689e4c6d69417f77a5f48be240c291e84fbef0b1281755dc754b19c809"
6767
dependencies = [
6868
"cc",
6969
"rustc-std-workspace-core",

library/alloc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bench = false
1616

1717
[dependencies]
1818
core = { path = "../core", public = true }
19-
compiler_builtins = { version = "=0.1.157", features = ['rustc-dep-of-std'] }
19+
compiler_builtins = { version = "=0.1.158", features = ['rustc-dep-of-std'] }
2020

2121
[features]
2222
compiler-builtins-mem = ['compiler_builtins/mem']

library/std/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
1818
panic_unwind = { path = "../panic_unwind", optional = true }
1919
panic_abort = { path = "../panic_abort" }
2020
core = { path = "../core", public = true }
21-
compiler_builtins = { version = "=0.1.157" }
21+
compiler_builtins = { version = "=0.1.158" }
2222
unwind = { path = "../unwind" }
2323
hashbrown = { version = "0.15", default-features = false, features = [
2424
'rustc-dep-of-std',
@@ -57,7 +57,7 @@ object = { version = "0.36.0", default-features = false, optional = true, featur
5757
'archive',
5858
] }
5959

60-
[target.'cfg(windows)'.dependencies.windows-targets]
60+
[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies.windows-targets]
6161
path = "../windows_targets"
6262

6363
[dev-dependencies]

library/windows_targets/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub macro link {
3434
}
3535

3636
#[cfg(not(feature = "windows_raw_dylib"))]
37+
#[cfg(not(target_os = "cygwin"))] // Cygwin doesn't need these libs
3738
#[cfg_attr(target_vendor = "win7", link(name = "advapi32"))]
3839
#[link(name = "ntdll")]
3940
#[link(name = "userenv")]

src/doc/style-guide/src/nightly.md

-12
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,3 @@ This chapter documents style and formatting for nightly-only syntax. The rest of
55
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.
66

77
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.
8-
9-
### `feature(precise_capturing)`
10-
11-
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`.
12-
13-
```
14-
fn foo() -> impl Sized + use<'a> {}
15-
16-
// is formatted analogously to:
17-
18-
fn foo() -> impl Sized + Use<'a> {}
19-
```

src/doc/style-guide/src/types.md

+12
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,15 @@ Box<
5959
+ Debug
6060
>
6161
```
62+
63+
## Precise capturing bounds
64+
65+
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`.
66+
67+
```rust
68+
fn foo() -> impl Sized + use<'a> {}
69+
70+
// is formatted analogously to:
71+
72+
fn foo() -> impl Sized + Use<'a> {}
73+
```

0 commit comments

Comments
 (0)