Add span label to primary error span

This commit is contained in:
Esteban Küber 2020-03-22 11:18:06 -07:00
parent 52fbd3e569
commit 94bbd46682
25 changed files with 76 additions and 80 deletions

View file

@ -2,7 +2,7 @@ error[E0615]: attempted to take value of method `get` on type `std::boxed::Box<(
--> $DIR/issue-13853-2.rs:5:43
|
LL | fn foo(res : Box<dyn ResponseHook>) { res.get }
| ^^^
| ^^^ method, not a field
|
help: use parentheses to call the method
|

View file

@ -17,12 +17,12 @@ mod stuff {
macro_rules! check_ptr_exist {
($var:expr, $member:ident) => (
(*$var.c_object).$member.is_some()
//~^ ERROR field `name` of struct `stuff::CObj` is private
//~^^ ERROR field `c_object` of struct `stuff::Item` is private
//~^ ERROR field `c_object` of struct `stuff::Item` is private
);
}
fn main() {
let item = stuff::Item::new();
println!("{}", check_ptr_exist!(item, name));
//~^ ERROR field `name` of struct `stuff::CObj` is private
}

View file

@ -1,8 +1,8 @@
error[E0616]: field `c_object` of struct `stuff::Item` is private
--> $DIR/issue-25386.rs:19:11
--> $DIR/issue-25386.rs:19:16
|
LL | (*$var.c_object).$member.is_some()
| ^^^^^^^^^^^^^
| ^^^^^^^^ private field
...
LL | println!("{}", check_ptr_exist!(item, name));
| ---------------------------- in this macro invocation
@ -10,15 +10,10 @@ LL | println!("{}", check_ptr_exist!(item, name));
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0616]: field `name` of struct `stuff::CObj` is private
--> $DIR/issue-25386.rs:19:9
--> $DIR/issue-25386.rs:26:43
|
LL | (*$var.c_object).$member.is_some()
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | println!("{}", check_ptr_exist!(item, name));
| ---------------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
| ^^^^ private field
error: aborting due to 2 previous errors

View file

@ -1,8 +1,8 @@
error[E0616]: field `len` of struct `sub::S` is private
--> $DIR/issue-26472.rs:11:13
--> $DIR/issue-26472.rs:11:15
|
LL | let v = s.len;
| ^^^^^
| ^^^ private field
|
help: a method `len` also exists, call it with parentheses
|
@ -10,10 +10,10 @@ LL | let v = s.len();
| ^^
error[E0616]: field `len` of struct `sub::S` is private
--> $DIR/issue-26472.rs:12:5
--> $DIR/issue-26472.rs:12:7
|
LL | s.len = v;
| ^^^^^
| ^^^ private field
error: aborting due to 2 previous errors

View file

@ -1,14 +1,14 @@
error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
--> $DIR/issue-3763.rs:18:19
--> $DIR/issue-3763.rs:18:32
|
LL | let _woohoo = (&my_struct).priv_field;
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^ private field
error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
--> $DIR/issue-3763.rs:21:19
--> $DIR/issue-3763.rs:21:41
|
LL | let _woohoo = (Box::new(my_struct)).priv_field;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^ private field
error[E0624]: associated function `happyfun` is private
--> $DIR/issue-3763.rs:24:18
@ -23,10 +23,10 @@ LL | (Box::new(my_struct)).happyfun();
| ^^^^^^^^
error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
--> $DIR/issue-3763.rs:27:16
--> $DIR/issue-3763.rs:27:26
|
LL | let nope = my_struct.priv_field;
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^ private field
error: aborting due to 5 previous errors

View file

@ -1,8 +1,8 @@
error[E0616]: field `inner` of struct `std::sync::Mutex` is private
--> $DIR/issue-54062.rs:10:13
--> $DIR/issue-54062.rs:10:24
|
LL | let _ = test.comps.inner.lock().unwrap();
| ^^^^^^^^^^^^^^^^
| ^^^^^ private field
error[E0599]: no method named `unwrap` found for struct `std::sys_common::mutex::MutexGuard<'_>` in the current scope
--> $DIR/issue-54062.rs:10:37