@@ -94,11 +94,35 @@ We recommend that new APIs use these types instead of the previous type aliases
94
94
[ `BorrowedFd` ] : https://doc.rust-lang.org/stable/std/os/unix/io/struct.BorrowedFd.html
95
95
[ `OwnedFd` ] : https://doc.rust-lang.org/stable/std/os/unix/io/struct.OwnedFd.html
96
96
97
+ ### ` const ` Mutex, RwLock, Condvar initialization
98
+
99
+ The [ ` Condvar::new ` ] , [ ` Mutex::new ` ] , and [ ` RwLock::new ` ] functions are now
100
+ callable in ` const ` contexts, which allows avoiding the use of crates like
101
+ ` lazy_static ` for creating global statics with ` Mutex ` , ` RwLock ` , or ` Condvar `
102
+ values. This builds on the [ work in 1.62] to enable thinner and faster mutexes
103
+ on Linux.
104
+
105
+ [ work in 1.62 ] : https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html#thinner-faster-mutexes-on-linux
106
+
97
107
### Turbofish for generics in functions with ` impl Trait `
98
108
99
- The turbofish notation (` foo::<u32>() ` ) can be used to specify the types for explicit type
100
- parameters (` fn foo<T: Copy> ` ) even when ` impl Trait ` is used in the argument types.
101
- Specifying the type of an ` impl Trait ` argument via turbofish is still not possible.
109
+ For a function signature like ` fn foo<T>(value: T, f: impl FnOnce()) ` , it was an
110
+ error to specify the concrete type of ` T ` via turbofish: ` foo::<u32>(3, || {}) `
111
+ would fail with:
112
+
113
+ ``` text
114
+ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
115
+ --> src/lib.rs:4:11
116
+ |
117
+ 4 | foo::<u32>(3, 3);
118
+ | ^^^ explicit generic argument not allowed
119
+ |
120
+ = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
121
+ ```
122
+
123
+ In 1.63, this restriction is relaxed, and the explicit type of the generic can be specified.
124
+ However, the ` impl Trait ` parameter, despite desugaring to a generic, remains
125
+ opaque and cannot be specified via turbofish.
102
126
103
127
### Non-lexical lifetimes migration complete
104
128
0 commit comments