Skip to content

Commit be32dde

Browse files
committed
Revert "fix(bind): wrap Default::default in a closure when passing to BindDefiner::init"
This reverts commit fd8a537. The upstream issue [rust-lang/rust#104155][1] was fixed. [1]: rust-lang/rust#104155
1 parent 9f99645 commit be32dde

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

doc/toolchain_limitations.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,6 @@ const fn identity<C: ~const Fn()>(x: C) -> C { x }
176176
const _: () = { identity(|| {}); };
177177
```
178178

179-
180-
### `[tag:passing_non_const_trait_fn_in_const_cx]` Passing a non-`const` trait function item to a `const fn` is disallowed in a constant context
181-
182-
*Upstream issue:* [rust-lang/rust#104155](https://github.com/rust-lang/rust/issues/104155)
183-
184-
```rust,compile_fail,E0277
185-
use core::mem::forget;
186-
pub const fn f<T: Default>() {
187-
// error[E0277]: the trait bound `T: Default` is not satisfied
188-
forget(T::default);
189-
forget(|| T::default());
190-
}
191-
```
192-
193179
### `[tag:false_unconstrained_generic_const_on_type_alias]` An unrelated generic parameter causes "unconstrained generic constant" when using a type alias including a generic constant
194180

195181
*Upstream issue:* [rust-lang/rust#89421](https://github.com/rust-lang/rust/issues/89421) (possibly related)

src/r3/src/bind/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,5 @@ where
233233
T: Default + 'static,
234234
C: ~const cfg::CfgStatic,
235235
{
236-
// Passing a closure instead of `Default::default` due to
237-
// [ref:passing_non_const_trait_fn_in_const_cx]
238-
Bind::define().init(|| Default::default()).finish(cfg)
236+
Bind::define().init(Default::default).finish(cfg)
239237
}

0 commit comments

Comments
 (0)