Skip to content

Commit

Permalink
Update to latest nightly rustc
Browse files Browse the repository at this point in the history
This requires fixing some nightly APIs that have been
changed in the latest nightly compiler.

For reference, the PR in rustc for the API change in
rustc crate: rust-lang/rust#107753

The tracking issue for the 'drain_filter' which is renamed
to 'extract_if': rust-lang/rust#43244

Signed-off-by: Mukilan Thiyagarajan <[email protected]>
  • Loading branch information
mukilan committed Jul 12, 2023
1 parent 9eee517 commit ae277a6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/eventtarget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl EventTarget {

let listener = EventListenerType::Additive(listener.clone());
if let Some(entries) = handlers.get_mut(ty) {
entries.drain_filter(|e| e.listener == listener && e.once);
entries.extract_if(|e| e.listener == listener && e.once);
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/script/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#![feature(core_intrinsics)]
#![feature(drain_filter)]
#![feature(extract_if)]
#![feature(plugin)]
#![feature(register_tool)]
#![deny(unsafe_code)]
Expand Down
2 changes: 1 addition & 1 deletion components/script/task_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<T: QueuedTaskConversion> TaskQueue<T> {

// 4. Filter tasks from non-priority task-sources.
let to_be_throttled: Vec<T> = incoming
.drain_filter(|msg| {
.extract_if(|msg| {
let task_source = match msg.task_source_name() {
Some(task_source) => task_source,
None => return false,
Expand Down
7 changes: 4 additions & 3 deletions components/script_plugins/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
}
if let hir::ItemKind::Struct(def, ..) = &item.kind {
for ref field in def.fields() {
let field_type = cx.tcx.type_of(field.def_id);
let field_type = cx.tcx.type_of(field.def_id).skip_binder();
if is_unrooted_ty(&self.symbols, cx, field_type, false) {
cx.lint(
UNROOTED_MUST_ROOT,
Expand All @@ -239,7 +239,7 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
match var.data {
hir::VariantData::Tuple(fields, ..) => {
for field in fields {
let field_type = cx.tcx.type_of(field.def_id);
let field_type = cx.tcx.type_of(field.def_id).skip_binder();
if is_unrooted_ty(&self.symbols, cx, field_type, false) {
cx.lint(
UNROOTED_MUST_ROOT,
Expand Down Expand Up @@ -273,7 +273,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
};

if !in_derive_expn(span) {
let sig = cx.tcx.type_of(def_id).fn_sig(cx.tcx);
let fn_type = cx.tcx.type_of(def_id).skip_binder();
let sig = fn_type.fn_sig(cx.tcx);

for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {
if is_unrooted_ty(&self.symbols, cx, *ty, false) {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-02-01
nightly-2023-07-12

0 comments on commit ae277a6

Please sign in to comment.