Enum generic_array::arr::doctests_only::DocTests
source · pub enum DocTests {}
Expand description
§With ellision
Testing that lifetimes aren’t transmuted when they’re ellided.
ⓘ
#[macro_use] extern crate generic_array;
fn main() {
fn unsound_lifetime_extension<'a, A>(a: &'a A) -> &'static A {
arr![&A; a][0]
}
}
#[macro_use] extern crate generic_array;
fn main() {
fn unsound_lifetime_extension<'a, A>(a: &'a A) -> &'a A {
arr![&A; a][0]
}
}
§Without ellision
Testing that lifetimes aren’t transmuted when they’re specified explicitly.
ⓘ
#[macro_use] extern crate generic_array;
fn main() {
fn unsound_lifetime_extension<'a, A>(a: &'a A) -> &'static A {
arr![&'a A; a][0]
}
}
ⓘ
#[macro_use] extern crate generic_array;
fn main() {
fn unsound_lifetime_extension<'a, A>(a: &'a A) -> &'static A {
arr![&'static A; a][0]
}
}
#[macro_use] extern crate generic_array;
fn main() {
fn unsound_lifetime_extension<'a, A>(a: &'a A) -> &'a A {
arr![&'a A; a][0]
}
}
Auto Trait Implementations§
impl Freeze for DocTests
impl RefUnwindSafe for DocTests
impl Send for DocTests
impl Sync for DocTests
impl Unpin for DocTests
impl UnwindSafe for DocTests
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more