diff --git a/src/components/style/errors.rs b/src/components/style/errors.rs index 1abd833fc39..b8d811aebd1 100644 --- a/src/components/style/errors.rs +++ b/src/components/style/errors.rs @@ -21,11 +21,6 @@ impl>> Iterator for ErrorLoggerIterator } -// FIXME: go back to `()` instead of `bool` after upgrading Rust -// past 898669c4e203ae91e2048fb6c0f8591c867bccc6 -// Using bool is a work-around for https://github.com/mozilla/rust/issues/13322 -local_data_key!(silence_errors: bool) - /// Defaults to a no-op. /// Set a `RUST_LOG=style::errors` environment variable /// to log CSS parse errors to stderr. @@ -37,8 +32,10 @@ pub fn log_css_error(location: SourceLocation, message: &str) { } +local_data_key!(silence_errors: ()) + pub fn with_errors_silenced(f: || -> T) -> T { - silence_errors.replace(Some(true)); + silence_errors.replace(Some(())); let result = f(); silence_errors.replace(None); result