1
Fork 0

Rename ~const Drop to ~const Destruct

This commit is contained in:
Deadbeef 2022-03-21 16:52:41 +11:00
parent 4df2a28aee
commit 1f3ee7f32e
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9
32 changed files with 296 additions and 192 deletions

View file

@ -3,7 +3,9 @@
#![feature(const_trait_impl)]
#![feature(const_precise_live_drops)]
const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Drop {
use std::marker::Destruct;
const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct {
match res {
Ok(t) => Some(t),
Err(_e) => None,
@ -12,7 +14,7 @@ const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Drop {
pub struct Foo<T>(T);
const fn baz<T: ~const Drop, E: ~const Drop>(res: Result<Foo<T>, Foo<E>>) -> Option<Foo<T>> {
const fn baz<T: ~const Destruct, E: ~const Destruct>(res: Result<Foo<T>, Foo<E>>) -> Option<Foo<T>> {
foo(res)
}