From 972a2a7432294ff0c9845ecb2b4a57403ab2fb72 Mon Sep 17 00:00:00 2001 From: Caleb Cartwright Date: Mon, 11 Nov 2019 13:00:18 -0600 Subject: [PATCH] tests: add nightly channel check to emitter tests --- src/syntux/session.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/syntux/session.rs b/src/syntux/session.rs index e369cb42c71..b1ae5e04871 100644 --- a/src/syntux/session.rs +++ b/src/syntux/session.rs @@ -2,7 +2,7 @@ use std::cell::RefCell; use std::path::Path; use std::rc::Rc; -use rustc_data_structures::sync; +use rustc_data_structures::sync::Send; use syntax::ast; use syntax::errors::emitter::{ColorConfig, Emitter, EmitterWriter}; use syntax::errors::{Diagnostic, Handler, Level as DiagnosticLevel}; @@ -31,7 +31,7 @@ impl Emitter for SilentEmitter { fn emit_diagnostic(&mut self, _db: &Diagnostic) {} } -fn silent_emitter() -> Box { +fn silent_emitter() -> Box { Box::new(SilentEmitter {}) } @@ -39,7 +39,7 @@ fn silent_emitter() -> Box { struct SilentOnIgnoredFilesEmitter { ignore_path_set: Rc, source_map: Rc, - emitter: Box, + emitter: Box, has_non_ignorable_parser_errors: bool, can_reset: Rc>, } @@ -269,6 +269,7 @@ mod tests { mod emitter { use super::*; use crate::config::IgnoreList; + use crate::is_nightly_channel; use crate::utils::mk_sp; use std::path::PathBuf; use syntax::source_map::FileName as SourceMapFileName; @@ -347,6 +348,9 @@ mod tests { #[test] fn handles_recoverable_parse_error_in_ignored_file() { + if !is_nightly_channel!() { + return; + } let num_emitted_errors = Rc::new(RefCell::new(0)); let can_reset_errors = Rc::new(RefCell::new(false)); let ignore_list = get_ignore_list(r#"ignore = ["foo.rs"]"#); @@ -368,6 +372,9 @@ mod tests { #[test] fn handles_recoverable_parse_error_in_non_ignored_file() { + if !is_nightly_channel!() { + return; + } let num_emitted_errors = Rc::new(RefCell::new(0)); let can_reset_errors = Rc::new(RefCell::new(false)); let source_map = Rc::new(SourceMap::new(FilePathMapping::empty())); @@ -388,6 +395,9 @@ mod tests { #[test] fn handles_mix_of_recoverable_parse_error() { + if !is_nightly_channel!() { + return; + } let num_emitted_errors = Rc::new(RefCell::new(0)); let can_reset_errors = Rc::new(RefCell::new(false)); let source_map = Rc::new(SourceMap::new(FilePathMapping::empty()));