You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling this code gives you an error message, but not the right one. I get
reference is not valid outside of its lifetime, &self
which suggests that some substitution is not occuring, as I would expect &self to be replaced with the free & region defined in the callback. Maybe the same bug as @catamorphism diagnosed regarding the replacement of ty params with tyvars in the vtable code.
iface deref {
fn get() -> int;
}
impl of deref for &int {
fn get() -> int {
*self
}
}
fn with<R: deref>(f: fn(x: &int) -> R) -> int {
f(&3).get()
}
fn return_it() -> int {
with(|o| o)
}
fn main() {
let x = return_it();
#debug["foo=%d", x];
}
The text was updated successfully, but these errors were encountered:
This change adds "unused_mut" to the list of suppressed lints for
wrappers generated by the contracts macros. This will get rid of
spurious errors caused by mutable parameters to functions.
This fixes the example from
model-checking/kani#3010 .
It can be tested by adding the example from the issues to
tests/expected/test_macros/gcd.rs, creating a file
tests/expected/test_macros/gcd.expected, then running
```bash
cargo build-dev
RUST_BACKTRACE=1 cargo run -p compiletest -- --logfile logfile.txt --suite expected --mode expected --ignored --no-fail-fast --src-base tests/expected/test_macros
```
RESOLVESrust-lang#3010
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
---------
Co-authored-by: Jacob Salzberg <[email protected]>
Compiling this code gives you an error message, but not the right one. I get
which suggests that some substitution is not occuring, as I would expect &self to be replaced with the free & region defined in the callback. Maybe the same bug as @catamorphism diagnosed regarding the replacement of ty params with tyvars in the vtable code.
The text was updated successfully, but these errors were encountered: