Comments (6)
Amanda (and I, when I have a bit more time) will also look into this soon-ish to try and see where NLLs differ from the location-insensitive pass in this new situation.
from rust.
The problem is that NLL has an optimisation for computing loans out of scope that shortens the scope to skip the two final reborrows in the generated MIR body because borrowed_place.ignore_borrow()
returns true, but Polonius doesn't so the scope for NLL is slightly shorter while the Polonius kill happens at the start of the cleanup/return blocks.
from rust.
Regression in nightly-2024-06-05
#125667 🤔 cc @oli-obk
from rust.
I can narrow that down to specifically:
outlives_constraints = Default::default();
Looking into a work-around!
from rust.
This only happens when the "remove constraints" trick of @oli-obk's is engaged because liveness values are merged into SCCs during construction of RegionInferenceContext
, which happens after the constraints have been removed. This means that region liveness in Polonius still has the old view of the constraint graph via BorrowSet
while NLL considers the rewritten graph.
Ironically this means that NLL is now slightly context-sensitive in the sense that parts of the constraint graph disappears between MIR statements.
from rust.
I don't think I can safely convert the work-around to Polonius since I'd have to either move the liveness logic to a later stage of computation (design change) or undo parts of the computation of the BorrowSet
to exclude certain variables as holders of loans (scary, above my current power level).
from rust.
Related Issues (20)
- "rustc-LLVM ERROR: underestimated function size" on thumbv6m-none-eabi HOT 6
- `invalid_value` does not warn when transmuting from a unit struct to an uninhabited type
- Words in `<code></code>` in docs make machine translation even weirder than usual HOT 3
- ICE: `assert_eq!(alloc.mutability, mutability)` failed in `validity.rs` HOT 4
- Confusing "the caller chooses a type which can be different" [E308] HOT 4
- Async code causes error "one type is more general than the other" (expected `async` block, found that same `async` block) when demanding an `impl Send` HOT 1
- Extremely un-informative error when a future that capture the environment is used as Send
- Async code causes error "implementation of `FnOnce` is not general enough" when demanding an `impl Send`
- `tidy` requires `src/tools/rustc-perf`? HOT 2
- 1.79 regression in `const` temporary lifetime extension HOT 10
- diagnostic refers to the wrong object's lifetime
- compile fail when using async_drop HOT 2
- Compiler Error E0530 When Shadowing None with mut keyword HOT 2
- `remove_dir_all` fails removing directores (with subdirectories) on network drives (SFTP) under windows HOT 28
- Two subsequent labels and unnecessary `jmp` with `opt-level=s` HOT 3
- Can the rust/build/x86_64-unknown-linux-gnu/stage0 directory be generated without network? HOT 2
- Strange TcpStream TTL type implementation (set_ttl/ttl) HOT 8
- Lint against using `libc::c_*` types in std if they're also avaliable in `core::ffi`
- `std::process::exit` is not thread-safe HOT 88
- compiletest: `./x test <test-name>.stderr` (or existing non-`.rs` file) should warn or error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.