1
Fork 0

Make --error-format human-annotate-rs handle multiple files

This commit is contained in:
Martin Nordholts 2023-07-24 14:40:44 +02:00
parent 092e4f46be
commit 504acf8760
4 changed files with 38 additions and 7 deletions

View file

@ -0,0 +1,6 @@
pub struct WithPrivateMethod;
impl WithPrivateMethod {
/// Private to get an error involving two files
fn private_method(&self) {}
}

View 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();
}

View 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
|