From cc68d8135b9fa7c3c9432fa154d5d1896408231c Mon Sep 17 00:00:00 2001 From: Jason Olson Date: Sun, 15 Sep 2019 11:07:44 -0700 Subject: [PATCH 1/2] Changes to catch_fatal_errors in rustc driver A [recent PR](https://github.com/rust-lang/rust/pull/60584/files#diff-707a0eda6b2f1a0537abc3d23133748cL1151) changed the function name from `report_ices_to_stderr_if_any` to `catch_fatal_errors`. This PR changes to using the new function name. --- src/driver.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/driver.rs b/src/driver.rs index 92f83f1a29e3..359d2f8530cb 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -247,8 +247,9 @@ You can use tool lints to allow or deny lints from your code, eg.: pub fn main() { rustc_driver::init_rustc_env_logger(); + rustc_driver::install_ice_hook(); exit( - rustc_driver::report_ices_to_stderr_if_any(move || { + rustc_driver::catch_fatal_errors(move || { use std::env; if std::env::args().any(|a| a == "--version" || a == "-V") { From c3cfb77bc74f85471828e85ba796a75be6e2c8e0 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 17 Sep 2019 09:48:25 +0200 Subject: [PATCH 2/2] Add ICE regression test --- tests/ui/ice-4545.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/ui/ice-4545.rs diff --git a/tests/ui/ice-4545.rs b/tests/ui/ice-4545.rs new file mode 100644 index 000000000000..58ef4c798dd3 --- /dev/null +++ b/tests/ui/ice-4545.rs @@ -0,0 +1,15 @@ +fn repro() { + trait Foo { + type Bar; + } + + #[allow(dead_code)] + struct Baz { + field: T::Bar, + } +} + +fn main() { + repro(); +} +