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") { 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(); +} +