Skip to content

Commit 972a2a7

Browse files
tests: add nightly channel check to emitter tests
1 parent 849e818 commit 972a2a7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/syntux/session.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::cell::RefCell;
22
use std::path::Path;
33
use std::rc::Rc;
44

5-
use rustc_data_structures::sync;
5+
use rustc_data_structures::sync::Send;
66
use syntax::ast;
77
use syntax::errors::emitter::{ColorConfig, Emitter, EmitterWriter};
88
use syntax::errors::{Diagnostic, Handler, Level as DiagnosticLevel};
@@ -31,15 +31,15 @@ impl Emitter for SilentEmitter {
3131
fn emit_diagnostic(&mut self, _db: &Diagnostic) {}
3232
}
3333

34-
fn silent_emitter() -> Box<dyn Emitter + sync::Send> {
34+
fn silent_emitter() -> Box<dyn Emitter + Send> {
3535
Box::new(SilentEmitter {})
3636
}
3737

3838
/// Emit errors against every files expect ones specified in the `ignore_path_set`.
3939
struct SilentOnIgnoredFilesEmitter {
4040
ignore_path_set: Rc<IgnorePathSet>,
4141
source_map: Rc<SourceMap>,
42-
emitter: Box<dyn Emitter + sync::Send>,
42+
emitter: Box<dyn Emitter + Send>,
4343
has_non_ignorable_parser_errors: bool,
4444
can_reset: Rc<RefCell<bool>>,
4545
}
@@ -269,6 +269,7 @@ mod tests {
269269
mod emitter {
270270
use super::*;
271271
use crate::config::IgnoreList;
272+
use crate::is_nightly_channel;
272273
use crate::utils::mk_sp;
273274
use std::path::PathBuf;
274275
use syntax::source_map::FileName as SourceMapFileName;
@@ -347,6 +348,9 @@ mod tests {
347348

348349
#[test]
349350
fn handles_recoverable_parse_error_in_ignored_file() {
351+
if !is_nightly_channel!() {
352+
return;
353+
}
350354
let num_emitted_errors = Rc::new(RefCell::new(0));
351355
let can_reset_errors = Rc::new(RefCell::new(false));
352356
let ignore_list = get_ignore_list(r#"ignore = ["foo.rs"]"#);
@@ -368,6 +372,9 @@ mod tests {
368372

369373
#[test]
370374
fn handles_recoverable_parse_error_in_non_ignored_file() {
375+
if !is_nightly_channel!() {
376+
return;
377+
}
371378
let num_emitted_errors = Rc::new(RefCell::new(0));
372379
let can_reset_errors = Rc::new(RefCell::new(false));
373380
let source_map = Rc::new(SourceMap::new(FilePathMapping::empty()));
@@ -388,6 +395,9 @@ mod tests {
388395

389396
#[test]
390397
fn handles_mix_of_recoverable_parse_error() {
398+
if !is_nightly_channel!() {
399+
return;
400+
}
391401
let num_emitted_errors = Rc::new(RefCell::new(0));
392402
let can_reset_errors = Rc::new(RefCell::new(false));
393403
let source_map = Rc::new(SourceMap::new(FilePathMapping::empty()));

0 commit comments

Comments
 (0)