Skip to content

Conversation

@sagudev
Copy link
Member

@sagudev sagudev commented Dec 27, 2025

Continuation of #41520 to use more safe cx in promises, now by passing &mut CurrentRealm in callbacks. Most callback implementations still do conversions to old SafeJSContext, so there are some low hanging stuff for follow ups.

Testing: Should be covered by existing WPT tests.
try run: https://github.com/sagudev/servo/actions/runs/20540030020
Part of #40600

most callback implementations still do conversions to old cx

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev sagudev requested a review from gterzian as a code owner December 27, 2025 14:05
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 27, 2025
@sagudev sagudev mentioned this pull request Dec 27, 2025
1 task
@sagudev sagudev requested review from jdm and removed request for gterzian December 27, 2025 15:08
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Dec 27, 2025
@jdm jdm added this pull request to the merge queue Dec 27, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 27, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 27, 2025
@sagudev
Copy link
Member Author

sagudev commented Dec 27, 2025

Newer rust compiler is smarter (then our MSRV) apparently:

error[E0716]: temporary value dropped while borrowed
   --> components/script/dom/readablestream.rs:219:39
    |
219 |         let realm = InRealm::Already(&cx.into());
    |                                       ^^^^^^^^^ - temporary value is freed at the end of this statement
    |                                       |
    |                                       creates a temporary value which is freed while still in use
...
274 |         self.check_and_propagate_errors_forward(cx, &global, realm, can_gc);
    |                                                              ----- borrow later used here
    |
help: consider using a `let` binding to create a longer lived value
    |
219 ~         let binding = cx.into();
220 ~         let realm = InRealm::Already(&binding);
    |

f
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Dec 27, 2025
@sagudev sagudev enabled auto-merge December 27, 2025 16:27
@sagudev sagudev added this pull request to the merge queue Dec 27, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 27, 2025
Merged via the queue into servo:main with commit d7324d7 Dec 27, 2025
32 checks passed
@sagudev sagudev deleted the promise_me_callback branch December 27, 2025 17:05
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants