Skip to content

Commit

Permalink
Fix insufficient covariance detection
Browse files Browse the repository at this point in the history
  • Loading branch information
steffahn committed Nov 9, 2023
1 parent 98bdf38 commit ba804d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ macro_rules! _covariant_access {
(covariant, $Vis:vis, $Dependent:ident) => {
/// Borrows dependent.
$Vis fn borrow_dependent<'_q>(&'_q self) -> &'_q $Dependent<'_q> {
fn _assert_covariance<'x: 'y, 'y>(x: $Dependent<'x>) -> $Dependent<'y> {
fn _assert_covariance<'x: 'y, 'y>(x: &'y $Dependent<'x>) -> &'y $Dependent<'y> {
// This function only compiles for covariant types.
x // Change the macro invocation to not_covariant.
}
Expand Down

0 comments on commit ba804d9

Please sign in to comment.