Comments (5)
Understood, so we could rename UnindexedRangeLen::len
to something else to avoid the ambiguity. However, this also suggests that the change would need to happen at an edition boundary, i.e. be opt-in and we should be fine as long as build against the current edition.
from rayon.
we assume Range and Range does not implement ExactSizeIterator.
I would say it is the other way around: We do not assume that they do implement ExactSizeIterator
.
I am not sure what you mean by "break" if such an implementation was added to the standard library? From my understanding, Rayon would just not automatically take advantage of it, but everything should continue to work as it does now, shouldn't it?
In any case, we should not move here before the std does, i.e. there is not just a decision, but the feature is published and available in Rayon's MSRV.
from rayon.
One can check this failed action once we add the implementation it will gives a compile error.
from rayon.
Ambiguous method resolution is a risk for any standard library addition. I don't think it's fair to call that "unrobust" here, because the only perfect way to defend against it is to use fully-qualified syntax for all trait method calls. This risk is acknowledged as a "minor change" in the API evolution RFC, and the Rust Project uses its crater tool to judge the practical impact -- though it's more obvious when it breaks a library used by the toolchain itself, as you found.
However, this also suggests that the change would need to happen at an edition boundary,
AIUI, the compiler has no ability to consider editions during trait/method resolution. I don't know if that's a fundamental limitation, or just something that hasn't been implemented or would be very difficult. So in the current situation, the library team will weigh the benefit of such additions against the crater impact and decide all or nothing.
I'm not totally opposed to renaming internal implementation details like UnindexedRangeLen::len
, but I'm pretty skeptical that the upstream API team will want to add these new ExactSizedIterator
impls at all.
from rayon.
I see. So this proposal is under discussion in rust-lang/libs-team#369 because I'm afraid of there are more example that "implicitly" "assume some trait are not implemented".
from rayon.
Related Issues (20)
- Potential to fix memory ordering for value HOT 2
- a broadcast that only gets executed on idle threads
- `in_place_scope` documentation is confusing/unclear HOT 14
- use_current_thread and the global thread pool HOT 2
- Why does ThreadPool block until a operation is finished? HOT 1
- A way to hook before/after job execution (and/or a way to see a number of tasks in the processing queue)
- Function dependencies with Rayon without blocking the thread / Rayon synchronization primitives?
- Add synchronization guarantees for `ParallelIterator::for_each*` HOT 1
- Par bridge with optional buffering IO handling HOT 2
- Thread pool without work stealing HOT 6
- Question about return types from .map() HOT 4
- Terribly inefficient design and possible solution HOT 5
- [Discussion] Is it possible to impl `IntoIterator` for `ParallelIterator`? HOT 3
- Yield locks HOT 1
- the method `par_iter` exists for struct `ChunkByMut<'_, BinF32, {[email protected]:207:78}>`, but its trait bounds were not satisfied HOT 5
- Unupdated crossbeam dependency makes MIRI angry HOT 1
- help: How to implement memoized chunks for parallel iterator? HOT 2
- wrong repo, issue deleted HOT 3
- Comparison with Spice HOT 1
- Switching par_iter makes memory usage explode (40x) HOT 3
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 rayon.