Skip to content

Rollup of 4 pull requests #140735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions compiler/rustc_lint/src/autorefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// }
/// ```
///
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions library/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions library/windows_targets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
12 changes: 0 additions & 12 deletions src/doc/style-guide/src/nightly.md
Original file line number Diff line number Diff line change
Expand Up @@ -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> {}
```
12 changes: 12 additions & 0 deletions src/doc/style-guide/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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> {}
```
Loading