mirror of
https://github.com/topjohnwu/cxx.git
synced 2024-10-07 09:03:30 +00:00
Improve span of shared struct Drop error
This commit is contained in:
parent
894ad11042
commit
da9f1b9471
@ -274,9 +274,11 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
fn expand_struct_forbid_drop(strct: &Struct) -> TokenStream {
|
||||
let ident = &strct.name.rust;
|
||||
let generics = &strct.generics;
|
||||
let span = ident.span();
|
||||
let impl_token = Token![impl](strct.visibility.span);
|
||||
|
||||
quote! {
|
||||
impl #generics self::Drop for super::#ident #generics {}
|
||||
quote_spanned! {span=>
|
||||
#impl_token #generics self::Drop for super::#ident #generics {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
error[E0119]: conflicting implementations of trait `ffi::_::forbid::Drop` for type `ffi::Shared`:
|
||||
--> $DIR/drop_shared.rs:1:1
|
||||
--> $DIR/drop_shared.rs:3:5
|
||||
|
|
||||
1 | #[cxx::bridge]
|
||||
| ^^^^^^^^^^^^^^
|
||||
| |
|
||||
| first implementation here
|
||||
| conflicting implementation for `ffi::Shared`
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
| -------------- first implementation here
|
||||
2 | mod ffi {
|
||||
3 | struct Shared {
|
||||
| ^^^^^^^^^^^^^ conflicting implementation for `ffi::Shared`
|
||||
|
Loading…
Reference in New Issue
Block a user