Skip to content
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

fix: borrow checker errors with isolate and object wrap usage #970

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented Nov 19, 2024

error[E0308]: mismatched types
   --> ext/webstorage/lib.rs:55:1
    |
55  | #[op2]
    | ^^^^^^
    | |
    | expected `&mut HandleScope<'_, ()>`, found `&mut &mut Isolate`
    | arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut HandleScope<'_, ()>`
               found mutable reference `&mut &mut Isolate`
note: associated function defined here
   --> /Users/divy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-130.0.1/src/string.rs:368:10
    |
368 |   pub fn new_from_one_byte<'s>(
    |          ^^^^^^^^^^^^^^^^^
    = note: this error originates in the attribute macro `op2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
   --> ext/webstorage/lib.rs:55:1
    |
55  | #[op2]
    | ^^^^^^
    | |
    | expected `&mut HandleScope<'_>`, found `&mut &mut Isolate`
    | arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut HandleScope<'_>`
               found mutable reference `&mut &mut Isolate`
note: associated function defined here
   --> /Users/divy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-130.0.1/src/exception.rs:368:10
    |
368 |   pub fn type_error<'s>(
    |          ^^^^^^^^^^
    = note: this error originates in the attribute macro `op2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `throw_exception` found for mutable reference `&mut Isolate` in the current scope
  --> ext/webstorage/lib.rs:55:1
   |
55 | #[op2]
   | ^^^^^^ method not found in `&mut Isolate`
   |
note: there's an earlier shadowed binding `scope` of type `CallbackScope<'_>` that has method `throw_exception` available
  --> ext/webstorage/lib.rs:55:1
   |
55 | #[op2]
   | ^^^^^^
   | |
   | `scope` of type `CallbackScope<'_>` that has method `throw_exception` defined earlier here
   | earlier `scope` shadowed here with type `&mut Isolate`
   = note: this error originates in the attribute macro `op2` (in Nightly builds, run with -Z macro-backtrace for more info)

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.52%. Comparing base (0c7f83e) to head (414a515).
Report is 170 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #970      +/-   ##
==========================================
+ Coverage   81.43%   81.52%   +0.08%     
==========================================
  Files          97       98       +1     
  Lines       23877    25379    +1502     
==========================================
+ Hits        19445    20690    +1245     
- Misses       4432     4689     +257     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants