-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Use registries of Weak<Extension>
s when doing resolution
#1781
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1781 +/- ##
==========================================
- Coverage 86.64% 86.58% -0.07%
==========================================
Files 186 187 +1
Lines 34145 34208 +63
Branches 31020 31083 +63
==========================================
+ Hits 29586 29619 +33
- Misses 2883 2912 +29
- Partials 1676 1677 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
207ae65
to
ca0a956
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much use remains for a normal registry now?
|
||
/// The equivalent to an [`ExtensionRegistry`] that only contains weak references. | ||
/// | ||
/// This is used to resolve extensions pointers while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while what?
@@ -111,13 +103,14 @@ pub enum ExtensionResolutionError { | |||
available_extensions: Vec<ExtensionId>, | |||
}, | |||
#[display( | |||
"Type {ty} in {node} requires extension {missing_extension}, but it could not be found in the extension list used during resolution. The available extensions are: {}", | |||
"Type {ty}{} requires extension {missing_extension}, but it could not be found in the extension list used during resolution. The available extensions are: {}", | |||
node.map(|n| format!(" in {}", n)).unwrap_or_default(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the default behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a node: "Type Unit in Node(4) requires..."
If there's no node: "Type Unit requires ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah sorry misread, thanks
@@ -20,13 +20,16 @@ use crate::Node; | |||
/// When a pointer is replaced, the extension is added to the | |||
/// `used_extensions` registry. | |||
/// | |||
/// Returns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returns what?
That's for the last PR in the chain! #1784 |
@@ -21,6 +21,15 @@ pub struct WeakExtensionRegistry { | |||
} | |||
|
|||
impl WeakExtensionRegistry { | |||
/// Create a new empty extension registry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't look empty....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the hundred typos 🤦
We'll need this to resolve extension references inside an extension that's being created.
drive-by: Make "node" optional in resolution errors.
BREAKING CHANGE:
::extension::resolve
operations now useWeakExtensionRegistry
es.