1
Fork 0

add DefId to unsafety violations and display function path in E0133

this enables consumers to access the function definition that was reported to be unsafe
This commit is contained in:
Emil Gardström 2022-04-24 14:08:23 +02:00
parent d8e59edbfa
commit 8b8f6653cf
No known key found for this signature in database
GPG key ID: 08AABB4F80C3FAC6
42 changed files with 228 additions and 200 deletions

View file

@ -11,11 +11,11 @@ impl S {
async unsafe fn f() {}
async fn g() {
S::f(); //~ ERROR call to unsafe function is unsafe
f(); //~ ERROR call to unsafe function is unsafe
S::f(); //~ ERROR call to unsafe function `S::f` is unsafe
f(); //~ ERROR call to unsafe function `f` is unsafe
}
fn main() {
S::f(); //[mir]~ ERROR call to unsafe function is unsafe
f(); //[mir]~ ERROR call to unsafe function is unsafe
S::f(); //[mir]~ ERROR call to unsafe function `S::f` is unsafe
f(); //[mir]~ ERROR call to unsafe function `f` is unsafe
}