Address issues uncovered by rust-1.78 beta (#32130)

This change makes changes to allow Servo to compile with the 1.78
version of Rust:

 - Dead code is removd (Rust seems to have gotten better at detecting
   it).
 - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice
   [^1].
 - The `imports.rs` now explicitly silences warnings about unused
   imports.

[^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179

<!-- Please describe your changes on the following line: -->


---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they should not change
behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->
This commit is contained in:
Martin Robinson 2024-04-22 20:20:47 +02:00 committed by GitHub
parent f65010c97d
commit a0640c8524
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 6 additions and 146 deletions

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::any::Any;
use std::ptr::NonNull;
use js::jsapi::JSObject;
@ -27,7 +26,6 @@ pub trait WebGLExtensionWrapper: JSTraceable + MallocSizeOf {
fn is_enabled(&self) -> bool;
fn enable(&self, ext: &WebGLExtensions);
fn name(&self) -> &'static str;
fn as_any(&self) -> &dyn Any;
}
#[crown::unrooted_must_root_lint::must_root]
@ -86,8 +84,4 @@ where
fn name(&self) -> &'static str {
T::name()
}
fn as_any(&self) -> &dyn Any {
self
}
}