Skip to content

script bindings: Fix warning about unused span.#42850

Merged
sagudev merged 1 commit intoservo:mainfrom
jschwe:fix_Warning
Feb 25, 2026
Merged

script bindings: Fix warning about unused span.#42850
sagudev merged 1 commit intoservo:mainfrom
jschwe:fix_Warning

Conversation

@jschwe
Copy link
Copy Markdown
Member

@jschwe jschwe commented Feb 25, 2026

The span needs to be assigned to a variable, so that it drops at the end of scope.
This was introduced in #42715.
Additionally also switch tho the profile_traits macro to simplify the statement.

Testing: Manually verified the warning is fixed.

The span needs to be assigned to a variable, so that it drops at the
end of scope.
Additionally also switch tho the profile_traits macro to simplify the
statement.

Signed-off-by: Jonathan Schwender <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Feb 25, 2026
pub fn run_a_script<D: DomTypes, R>(global: &D::GlobalScope, f: impl FnOnce() -> R) -> R {
let settings_stack = <D as DomHelpers<D>>::settings_stack();
settings_stack.with(|stack| {
let _span = settings_stack.with(|stack| {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's debatable if we should drop / end the span after line 44, or if it makes sense to include the cleanup. No strong opinion.

@jschwe jschwe requested a review from sagudev February 25, 2026 14:01
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Feb 25, 2026
@jschwe jschwe added this pull request to the merge queue Feb 25, 2026
@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 Feb 25, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 25, 2026
@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 Feb 25, 2026
@sagudev sagudev added this pull request to the merge queue Feb 25, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Feb 25, 2026
Merged via the queue into servo:main with commit 4b2e8c3 Feb 25, 2026
39 checks passed
@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 Feb 25, 2026
shubhamg13 pushed a commit to shubhamg13/servo that referenced this pull request Mar 2, 2026
The span needs to be assigned to a variable, so that it drops at the end
of scope.
This was introduced in servo#42715. 
Additionally also switch tho the profile_traits macro to simplify the
statement.

Testing: Manually verified the warning is fixed.

Signed-off-by: Jonathan Schwender <[email protected]>
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.

4 participants