-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Borrowck doesn't correctly handle lifetime of ~rvalue #2977
Labels
A-lifetimes
Area: Lifetimes / regions
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone
Comments
ghost
assigned nikomatsakis
Jul 26, 2012
IMO this should not make it past borrow checking. Niko? |
Indeed, it should not! I can see why it's happening though. Interesting problem. |
I updated the title to more accurately reflect the problem. Or at least a problem, I would expect a failure at runtime, not in LLVM. So in fact I think there are two bugs here. I will file some follow-up issues. |
nikomatsakis
added a commit
that referenced
this issue
Jul 30, 2012
What we now do is to create a region variable for each & expression (and also each borrow). The lifetime of this variable will be checked by borrowck to ensure it is not greater than the lifetime of the underlying data. This both leads to shorter lifetimes in some cases but also longer in others, such as taking the address to the interior of unique boxes tht are rooted in region pointers (e.g., returning a pointer to the interior of a sendable map). This may lead to issue #2977 if the rvalue is not POD, because we may drop the data in trans sooner than borrowck expects us to. Need to work out precisely where that fix ought to occur.
nikomatsakis
added a commit
that referenced
this issue
Aug 17, 2012
this will require more temporaries, but is probably less magical. also, it means that borrowck matches trans better, so fewer crashes. bonus. Finally, stop warning about implicit copies when we are actually borrowing. Also, one test (vec-res-add) stopped failing due to #2587, and hence I added an xfail-test. Fixes #3217, #2977, #3067
Fixed in the above commit. |
nikomatsakis
added a commit
that referenced
this issue
Aug 18, 2012
RalfJung
pushed a commit
to RalfJung/rust
that referenced
this issue
Jul 14, 2023
celinval
pushed a commit
to celinval/rust-dev
that referenced
this issue
Jun 4, 2024
logging is required when handling errors.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-lifetimes
Area: Lifetimes / regions
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
good day. the following intentionally buggy program crashes rustc:
here is the result of "rustc buggy.rs":
rustc version is:
rustc 0.3 (6081eb7 2012-07-15 05:41:24 -0700)
host: i686-unknown-linux-gnu
The text was updated successfully, but these errors were encountered: