rust: migration: hide more warnings from call_func_with_field!
The call_func_with_field! macro uses dead code willingly to infer
the appropriate type. This has started adding a new warning:
error: unused variable: `value__`
79 | break phantom__(&{ let value__: $typ; value__.$($field).+ })
So shut it up together with the existing unreachable_code warning.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
194dfadd66
commit
ceda1563d6
1 changed files with 1 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ macro_rules! call_func_with_field {
|
|||
($func:expr, $typ:ty, $($field:tt).+) => {
|
||||
$func(loop {
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(unused_variables)]
|
||||
const fn phantom__<T>(_: &T) -> ::core::marker::PhantomData<T> { ::core::marker::PhantomData }
|
||||
// Unreachable code is exempt from checks on uninitialized values.
|
||||
// Use that trick to infer the type of this PhantomData.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue