Comments (4)
The reason is that the function expects a strong reference but you only have a mutable one. This (again) can be solved by implementing opening of mutable references (seeing a mutable reference as strong during the duration of the lifetime). Maybe I should add implementing this to my new year's resolutions.
Note that the signature fn(&mut FdMap[@dummy], k: usize)
is wrong because the function doesn't preserve the size of the vector, thus you could avoid the panic
by taking a strong reference and exposing the updated length in the ensures clause. Then, whether to take strong vs mutable references (provided that we implement opening of mutable references) is a matter of encapsulation, you either expose the length or not.
from flux.
from flux.
Yes, I always wanted to implement it so I never bother making it a user facing error.
from flux.
Ah, ok sounds good let me close. The thing that motivated this issue works, but the original problem still remains, namely:
ctx.fdmap.delete(...)
causes a
panicked at 'expected type at Some(src/wrappers.rs:98:5: 98:27 (#0))', flux-typeck/src/type_env/paths_tree.rs:568:23
which requires me to do make the delete
a method of ctx
and do ctx.fdmap_delete
... [update having a hard time replicating the problem in a small standalone test so will tell you about it offline...]
from flux.
Related Issues (20)
- Crash in flux-wave
- Lost index using `const` ?
- error[E0432]: unresolved import `time` HOT 9
- Encode record sorts as variant in SortCtor HOT 1
- Story for mutating traits HOT 4
- Oddities with Base kind HOT 1
- Generics in `impl` block for `extern_spec` HOT 5
- rustc just removed plugins HOT 1
- Fail to normalize `<Iter<'_, &str> as Iterator>::Item`
- ICE on implementation of `Option::map`
- Index out of bounds panic HOT 1
- bitwise not crashes verification HOT 1
- Global const cannot be referenced in refined function signature HOT 2
- Hex integer literals in refined function signature crash verification HOT 2
- Bug when using `.iter()` over a reference HOT 1
- Remove return type from variant specification HOT 2
- Unsound to use fresh KVar for generics with bound HOT 2
- Check that `impl` satisfies `trait` specs HOT 1
- Check Associate-Pred signatures HOT 5
- Introduce an equate judgment 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 flux.