Skip to content

Commit

Permalink
fix expand & expand_mut in nightly (#42)
Browse files Browse the repository at this point in the history
`cve-rs` does not compile in nightly due to
rust-lang/rust#129021 and this change will be
landed in Rust 1.83. This PR fixes it.
  • Loading branch information
Bright-Shard authored Oct 22, 2024
2 parents a4d3538 + e0a25af commit 80d3a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lifetime_expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn lifetime_translator_mut<'a, 'b, T: ?Sized>(
///
/// Safety? What's that?
pub fn expand<'a, 'b, T: ?Sized>(x: &'a T) -> &'b T {
let f: fn(_, &'a T) -> &'b T = lifetime_translator;
let f: for<'x> fn(_, &'x T) -> &'b T = lifetime_translator;
f(STATIC_UNIT, x)
}

Expand All @@ -54,7 +54,7 @@ pub fn expand<'a, 'b, T: ?Sized>(x: &'a T) -> &'b T {
///
/// Safety? What's that?
pub fn expand_mut<'a, 'b, T: ?Sized>(x: &'a mut T) -> &'b mut T {
let f: fn(_, &'a mut T) -> &'b mut T = lifetime_translator_mut;
let f: for<'x> fn(_, &'x mut T) -> &'b mut T = lifetime_translator_mut;
f(STATIC_UNIT, x)
}

Expand Down

0 comments on commit 80d3a0e

Please sign in to comment.