Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

region inference doesn't capture all dependencies between regions #3148

Closed
nikomatsakis opened this issue Aug 8, 2012 · 1 comment
Closed
Assignees
Labels
A-lifetimes Area: lifetime related
Milestone

Comments

@nikomatsakis
Copy link
Contributor

In this test case (src/test/run-pass/region-return-interior-of-option-in-self.rs):

// xfail-test 

struct cell<T> {
    value: T;
}

struct cells<T> {
    vals: ~[option<cell<T>>];
}

impl<T> &cells<T> {
    fn get(idx: uint) -> &self/T {
        match self.vals[idx] {
          some(ref v) => &v.value,
          none => fail
        }
    }
}

fn main() {}

an error is reported. The reason is that the region R for v is inferred to be too narrow, because it doesn't realize R must be as wide as the region for &v.value.

nikomatsakis added a commit that referenced this issue Aug 8, 2012
@ghost ghost assigned nikomatsakis Aug 9, 2012
@nikomatsakis
Copy link
Contributor Author

I've been putting in various FIXME's. I've discovered you CAN supply a hint to the inference engine to workaround this problem (search for some of the FIXME's to see what I mean).

nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Jan 25, 2013
contents of other borrowed pointers to the lifetimes of the
borrowed value.  Fixes rust-lang#3148.
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Jan 26, 2013
nikomatsakis added a commit that referenced this issue Jan 28, 2013
RalfJung pushed a commit to RalfJung/rust that referenced this issue Nov 4, 2023
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Release notes are the following:

### Major Changes
* Fix compilation issue with proc_macro2  (v1.0.80+) and Kani v0.49.0
(model-checking/kani#3138).

### What's Changed
* Implement valid value check for `write_bytes` by @celinval in
model-checking/kani#3108
* Rust toolchain upgraded to 2024-04-15 by @tautschnig @celinval

**Full Changelog**:
model-checking/kani@kani-0.49.0...kani-0.50.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: lifetime related
Projects
None yet
Development

No branches or pull requests

1 participant