@@ -2,7 +2,7 @@ use std::cell::RefCell;
2
2
use std:: path:: Path ;
3
3
use std:: rc:: Rc ;
4
4
5
- use rustc_data_structures:: sync;
5
+ use rustc_data_structures:: sync:: Send ;
6
6
use syntax:: ast;
7
7
use syntax:: errors:: emitter:: { ColorConfig , Emitter , EmitterWriter } ;
8
8
use syntax:: errors:: { Diagnostic , Handler , Level as DiagnosticLevel } ;
@@ -31,15 +31,15 @@ impl Emitter for SilentEmitter {
31
31
fn emit_diagnostic ( & mut self , _db : & Diagnostic ) { }
32
32
}
33
33
34
- fn silent_emitter ( ) -> Box < dyn Emitter + sync :: Send > {
34
+ fn silent_emitter ( ) -> Box < dyn Emitter + Send > {
35
35
Box :: new ( SilentEmitter { } )
36
36
}
37
37
38
38
/// Emit errors against every files expect ones specified in the `ignore_path_set`.
39
39
struct SilentOnIgnoredFilesEmitter {
40
40
ignore_path_set : Rc < IgnorePathSet > ,
41
41
source_map : Rc < SourceMap > ,
42
- emitter : Box < dyn Emitter + sync :: Send > ,
42
+ emitter : Box < dyn Emitter + Send > ,
43
43
has_non_ignorable_parser_errors : bool ,
44
44
can_reset : Rc < RefCell < bool > > ,
45
45
}
@@ -269,6 +269,7 @@ mod tests {
269
269
mod emitter {
270
270
use super :: * ;
271
271
use crate :: config:: IgnoreList ;
272
+ use crate :: is_nightly_channel;
272
273
use crate :: utils:: mk_sp;
273
274
use std:: path:: PathBuf ;
274
275
use syntax:: source_map:: FileName as SourceMapFileName ;
@@ -347,6 +348,9 @@ mod tests {
347
348
348
349
#[ test]
349
350
fn handles_recoverable_parse_error_in_ignored_file ( ) {
351
+ if !is_nightly_channel ! ( ) {
352
+ return ;
353
+ }
350
354
let num_emitted_errors = Rc :: new ( RefCell :: new ( 0 ) ) ;
351
355
let can_reset_errors = Rc :: new ( RefCell :: new ( false ) ) ;
352
356
let ignore_list = get_ignore_list ( r#"ignore = ["foo.rs"]"# ) ;
@@ -368,6 +372,9 @@ mod tests {
368
372
369
373
#[ test]
370
374
fn handles_recoverable_parse_error_in_non_ignored_file ( ) {
375
+ if !is_nightly_channel ! ( ) {
376
+ return ;
377
+ }
371
378
let num_emitted_errors = Rc :: new ( RefCell :: new ( 0 ) ) ;
372
379
let can_reset_errors = Rc :: new ( RefCell :: new ( false ) ) ;
373
380
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
@@ -388,6 +395,9 @@ mod tests {
388
395
389
396
#[ test]
390
397
fn handles_mix_of_recoverable_parse_error ( ) {
398
+ if !is_nightly_channel ! ( ) {
399
+ return ;
400
+ }
391
401
let num_emitted_errors = Rc :: new ( RefCell :: new ( 0 ) ) ;
392
402
let can_reset_errors = Rc :: new ( RefCell :: new ( false ) ) ;
393
403
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
0 commit comments