test use in libcore
This commit is contained in:
parent
b0aa859c24
commit
ca1eb4309e
3 changed files with 18 additions and 10 deletions
|
@ -1234,17 +1234,23 @@ where
|
||||||
F: ~const Destruct,
|
F: ~const Destruct,
|
||||||
K: ~const Destruct,
|
K: ~const Destruct,
|
||||||
{
|
{
|
||||||
const fn imp<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(
|
cfg_if! {
|
||||||
f: &mut F,
|
if #[cfg(bootstrap)] {
|
||||||
(v1, v2): (&T, &T),
|
const fn imp<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(
|
||||||
) -> Ordering
|
f: &mut F,
|
||||||
where
|
(v1, v2): (&T, &T),
|
||||||
T: ~const Destruct,
|
) -> Ordering
|
||||||
K: ~const Destruct,
|
where
|
||||||
{
|
T: ~const Destruct,
|
||||||
f(v1).cmp(&f(v2))
|
K: ~const Destruct,
|
||||||
|
{
|
||||||
|
f(v1).cmp(&f(v2))
|
||||||
|
}
|
||||||
|
min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp))
|
||||||
|
} else {
|
||||||
|
min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compares and returns the maximum of two values.
|
/// Compares and returns the maximum of two values.
|
||||||
|
|
|
@ -191,6 +191,7 @@
|
||||||
#![feature(cfg_sanitize)]
|
#![feature(cfg_sanitize)]
|
||||||
#![feature(cfg_target_has_atomic)]
|
#![feature(cfg_target_has_atomic)]
|
||||||
#![feature(cfg_target_has_atomic_equal_alignment)]
|
#![feature(cfg_target_has_atomic_equal_alignment)]
|
||||||
|
#![cfg_attr(not(bootstrap), feature(const_closures))]
|
||||||
#![feature(const_fn_floating_point_arithmetic)]
|
#![feature(const_fn_floating_point_arithmetic)]
|
||||||
#![feature(const_mut_refs)]
|
#![feature(const_mut_refs)]
|
||||||
#![feature(const_precise_live_drops)]
|
#![feature(const_precise_live_drops)]
|
||||||
|
|
|
@ -126,6 +126,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
|
||||||
g(ExprKind::Closure(Box::new(Closure {
|
g(ExprKind::Closure(Box::new(Closure {
|
||||||
binder: ClosureBinder::NotPresent,
|
binder: ClosureBinder::NotPresent,
|
||||||
capture_clause: CaptureBy::Value,
|
capture_clause: CaptureBy::Value,
|
||||||
|
constness: Const::No,
|
||||||
asyncness: Async::No,
|
asyncness: Async::No,
|
||||||
movability: Movability::Movable,
|
movability: Movability::Movable,
|
||||||
fn_decl: decl.clone(),
|
fn_decl: decl.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue