diff options
| -rw-r--r-- | src/librustc_errors/annotate_rs_emitter.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/annotate-snippet/missing-type.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/annotate-snippet/missing-type.stderr | 6 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/librustc_errors/annotate_rs_emitter.rs b/src/librustc_errors/annotate_rs_emitter.rs index 172b8b5551f..a5699035dea 100644 --- a/src/librustc_errors/annotate_rs_emitter.rs +++ b/src/librustc_errors/annotate_rs_emitter.rs @@ -204,7 +204,10 @@ impl AnnotateRsEmitterWriter { if let Some(snippet) = converter.to_annotation_snippet() { let dl = DisplayList::from(snippet); let dlf = DisplayListFormatter::new(true); - print!("{}", dlf.format(&dl)); + // FIXME(#59346): Figure out if we can _always_ print to stderr or not. + // `emitter.rs` has the `Destination` enum that lists various possible output + // destinations. + eprint!("{}", dlf.format(&dl)); }; } } diff --git a/src/test/ui/annotate-snippet/missing-type.rs b/src/test/ui/annotate-snippet/missing-type.rs index e52a81ec161..d0814a9537d 100644 --- a/src/test/ui/annotate-snippet/missing-type.rs +++ b/src/test/ui/annotate-snippet/missing-type.rs @@ -1,5 +1,5 @@ // compile-flags: --error-format human-annotate-rs pub fn main() { - let x: Iter; + let x: Iter; //~ ERROR cannot find type `Iter` in this scope } diff --git a/src/test/ui/annotate-snippet/missing-type.stderr b/src/test/ui/annotate-snippet/missing-type.stderr new file mode 100644 index 00000000000..1e84929d3c5 --- /dev/null +++ b/src/test/ui/annotate-snippet/missing-type.stderr @@ -0,0 +1,6 @@ +error[E0412]: cannot find type `Iter` in this scope + --> $DIR/missing-type.rs:4:11 + | +4 | let x: Iter; + | ^^^^ not found in this scope + | \ No newline at end of file |
