Repository navigation
loader: Plugin<K> is !Clone; shared holders hold Arc<Plugin<K>> - #986
Open
MattJackson wants to merge 4 commits into
Open
MattJackson wants to merge 4 commits into
MattJackson wants to merge 4 commits into
Conversation
…Arc<Plugin<K>> THE DESIGN C.1 (BUSBAR-1.6.0.md l.3868): "Plugin<K> is !Clone". The Clone impl is deleted. PlaneInstance and OutboundInstance hold Arc<Plugin<K>> (their constructors take impl Into<Arc<Plugin<K>>>); the root's DoorPlane is Arc<Plugin<Plane>>, so compose_planes' PlaneInstance and DoorApply share the boot's instance; the auth door's tick schedule and the hook door's live/trial state share theirs; the conformance folds that hand a plugin on by value read its crossing gate through the instance. RED: dispatch_tests::a_plugin_handle_is_not_clone (does not compile while Plugin<K>: Clone).
Collaborator
Author
|
Rule 20 note from #1030 (row 155): disjoint hunk in crates/busbar/tests/plane_driver.rs ( |
Collaborator
Author
|
Rule 20 note from #1031 (row 155, draft): one test appended to crates/busbar/src/root/tests/door_steps.rs. A test merge is clean. |
…lready gives (clippy::explicit_auto_deref)
…(Clone implies Sized; clippy::needless_maybe_sized)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CONTRACT-ABI lane:
Plugin<K>is!Clone.THE DESIGN C.1 (
docs/design/BUSBAR-1.6.0.mdl.3864-3868, "Compiled-in uses the same table, Types"):Plugin<K>is!Clone. On predevcrates/plugin-loader/src/dispatch/plugin.rs:1278implementedClone, documented as "cheap to clone; every clone is the same instance". That impl is deleted. A holder that shares an instance now shares anArc<Plugin<K>>.Call sites (every one that cloned a handle):
dispatch/plane_calls.rsPlaneInstanceanddispatch/auth_outbound.rsOutboundInstanceholdArc<Plugin<K>>. Their constructors takeimpl Into<Arc<Plugin<K>>>, so a caller that hands its plugin over owned is unchanged. They stayClonebecause they clone theArc;OpenOncehands them out.busbarrootboot.rs:DoorPlaneisArc<Plugin<Plane>>, wrapped once atload_door_planes.serve.rscompose_planes_overshares the boot's instance into the generation'sPlaneInstanceand itsDoorApply, at the twoplugin.clone()sites l.1427 and l.1571.auth_door.rs: the instance's tick schedule (auth_ticks::spawn, which now takesArc<Plugin<Auth>>) and itsSharedhold oneArc. Before,plugin.clone()was at l.648.hook_door.rs:State::LiveholdsArc<Plugin<Hook>>, solive()/trial()hand out the shared instance (before,p.clone()at l.230 and l.292), andSubmittedholds it.conformance/mod.rsred_readyandconformance/store.rsfoldhand their store plugin toLoadedStore::openby value and keep reading its crossing gate through the instance (crossings_of(&p.inner)), with no copy of the handle.plane_driver.rs,hook_parity_driver/rig.rs,dispatch_tests.rs(the two hung-call REDs), and the rootserve_*/door_stepsrigs that build aDoorPlane.Generic dispatcher calls on a now-shared handle pass
&*plugin.RED:
plugin-loadertests::dispatch_tests::a_plugin_handle_is_not_clone. It is an ambiguity probe (theassert_not_impl_anyconstruction) that does not compile whilePlugin<K>: Clone, so it is red on predev and green here.Shared files (rule 20):
git merge-treeis clean against predev and against every non-draft open PR that edits these files: #946, #943, #922, #921, #913, #910, #887, #876, #848, #841, #833, #805, and the lane's own #952/#968. None of those PRs adds aPluginclone, aDoorPlaneor aPlaneInstancesite that this change would break.No dependency change. No behaviour change: every clone was the same instance before, and the
Arcis that same instance.