Make --error-format human-annotate-rs
handle multiple files
This commit is contained in:
parent
092e4f46be
commit
504acf8760
4 changed files with 38 additions and 7 deletions
6
tests/ui/annotate-snippet/auxiliary/other_file.rs
Normal file
6
tests/ui/annotate-snippet/auxiliary/other_file.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
pub struct WithPrivateMethod;
|
||||
|
||||
impl WithPrivateMethod {
|
||||
/// Private to get an error involving two files
|
||||
fn private_method(&self) {}
|
||||
}
|
8
tests/ui/annotate-snippet/multiple-files.rs
Normal file
8
tests/ui/annotate-snippet/multiple-files.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// aux-build:other_file.rs
|
||||
// compile-flags: --error-format human-annotate-rs -Z unstable-options
|
||||
|
||||
extern crate other_file;
|
||||
|
||||
fn main() {
|
||||
other_file::WithPrivateMethod.private_method();
|
||||
}
|
11
tests/ui/annotate-snippet/multiple-files.stderr
Normal file
11
tests/ui/annotate-snippet/multiple-files.stderr
Normal file
|
@ -0,0 +1,11 @@
|
|||
error[E0624]: method `private_method` is private
|
||||
--> $DIR/multiple-files.rs:7:35
|
||||
|
|
||||
LL | other_file::WithPrivateMethod.private_method();
|
||||
| ^^^^^^^^^^^^^^ private method
|
||||
|
|
||||
::: $DIR/auxiliary/other_file.rs:5:5
|
||||
|
|
||||
LL | fn private_method(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ private method defined here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue