charon icon indicating copy to clipboard operation
charon copied to clipboard

Normalization binder error

Open R1kM opened this issue 5 months ago • 1 comments

The following code

pub struct S;

impl S {
  pub fn f<'a>(&'a self) -> Option<(&'a u8, &'a u8)>
    { None }
}

crashes on Charon version 8fe7c7311 with the following error message

Compilation failed: thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/normalize.rs:151:9:
Normalizing &'^1_0.Named(test_crate::{impl#0}::f::'a, "'a") u8 without wrapping in a `Binder`

Note, replacing the return type by, e.g., Option<&'a u8>, or not annotating the self borrow with lifetime 'a solves this error

R1kM avatar Sep 23 '24 13:09 R1kM