Move trait prototype - #161457
Conversation
it should give some info tho...
|
Thanks for the pull request, and welcome! The Rust Project has assigned @lcnr (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
|
A quick |
Oh wow that got done with A LOT of tests
wow that were a lot of them. looks like the next batch is a bunch of |
This comment has been minimized.
This comment has been minimized.
|
looking at the errors, there is also a bunch of Those are all checks going around the That sure raises a question - can we handle them now? ummm - putting this aside in favour of lower hanging fruits |
This is one of the two options, the other being break ABI. I suspect we can do it, Rust not having a stable one (?)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mostly to avoid adding to every single dynamic symbol the `+ Move`
the output uses the debug print and parses it with regex fixed the regex to fetch the first trait, instead of Move
33dfdac to
30609e6
Compare
This comment has been minimized.
This comment has been minimized.
429ec3c to
a068654
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0acfa71 to
c51c5c0
Compare
This comment has been minimized.
This comment has been minimized.
…eature is" This reverts commit eda1c34.
handled Move as an additional bound instead of removing it from the gathered explicit clauses addressed an old FIXME that gave me the direction reverted the changes of a couple of tests that now see the Move
This comment has been minimized.
This comment has been minimized.
| {T: PointeeSized + ?Move} *mut T, | ||
| {T: PointeeSized + ?Move} &T, | ||
| {T: PointeeSized + ?Move} &mut T, | ||
| {T: PointeeSized + ?Move} PhantomData<T>, |
There was a problem hiding this comment.
Apologies for the drive-by, but it's surprising to me that PhantomData would unconditionally implement Move, rather than implementing it only when T: Move. Other marker trait impls for PhantomData are conditional on T: https://doc.rust-lang.org/std/marker/struct.PhantomData.html#synthetic-implementations
There was a problem hiding this comment.
ummm...
I often saw phantomdata as a way to maintain pointer type info, so having &'a T be somewhat equivalent to (*const (), PhantomData<&'a T>). Wouldn't not implementing Move for it make this kind of pointers immovable? The moveability of the pointer should not be related to the one of the pointee
There was a problem hiding this comment.
generally I see in the future a proliferation of Phantom* types (like #135806) to represent different aspects you want to inherit from the type
| result.clauses = tcx.arena.alloc_from_iter(result.clauses.iter().copied().filter(|p| { | ||
| !p.0.as_trait_clause().is_some_and(|p| { | ||
| p.polarity() == ClausePolarity::Positive | ||
| && matches!(tcx.as_lang_item(p.def_id()), Some(LangItem::Move)) |
There was a problem hiding this comment.
for perf reasons, it might actually be faster to do
if !tcx.features().move_trait() {
let move_trait = tcx.get_lang_item(LangItem::Move);
// filter_by_comparing to that :>
}might be worth another perf run with that change 😁
There was a problem hiding this comment.
Oh that's a get for each clause - totally missed that. I guess that T: Move clause would be common enough to make caching that at least equal in performance
You should call the perf run right? Also need to check diesel as I am hopefully almost done with fixing the tests
This comment has been minimized.
This comment has been minimized.
9496de0 to
38b990c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Again, not very sure of this. I don't really know the itanium c++ stuff, but looks like Send and Sync are there so it should contains it? And removing it in favour of `?Move` makes a ton of other tests fail. So I guess i'll let it like this and let it breaks later if it does
This comment has been minimized.
This comment has been minimized.
|
The job Click to see the possible cause of the failure (guessed by this bot)Important For more information how to resolve CI failures of this job, visit this link. |
View all comments
Finishing the work started by @nia-e in #156018 :
TODO
feature(move_trait)MoveMoveMoveboundsdyn MovePhantomData<T>: MoveandT: Movedieselregressesr? lcnr