Skip to content

Commit ec32c96

Browse files
committed
Add a test for rust-lang#3040
1 parent cd8549e commit ec32c96

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/source/match.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,3 +507,17 @@ fn issue_2377() {
507507
Tok::TypeOf if prec <= 16 => {}
508508
}
509509
}
510+
511+
// #3040
512+
fn issue_3040() {
513+
{
514+
match foo {
515+
DevtoolScriptControlMsg::WantsLiveNotifications(id, to_send) => {
516+
match documents.find_window(id) {
517+
Some(window) => devtools::handle_wants_live_notifications(window.upcast(), to_send),
518+
None => return warn!("Message sent to closed pipeline {}.", id),
519+
}
520+
}
521+
}
522+
}
523+
}

tests/target/match.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,3 +536,19 @@ fn issue_2377() {
536536
Tok::TypeOf if prec <= 16 => {}
537537
}
538538
}
539+
540+
// #3040
541+
fn issue_3040() {
542+
{
543+
match foo {
544+
DevtoolScriptControlMsg::WantsLiveNotifications(id, to_send) => {
545+
match documents.find_window(id) {
546+
Some(window) => {
547+
devtools::handle_wants_live_notifications(window.upcast(), to_send)
548+
}
549+
None => return warn!("Message sent to closed pipeline {}.", id),
550+
}
551+
}
552+
}
553+
}
554+
}

0 commit comments

Comments
 (0)