mirror of https://git.sr.ht/~stygianentity/bincode
Fix issue when a foreign `Err` pollutes scope (#758)
This commit is contained in:
parent
3d1c4c339a
commit
bb3e60c94c
|
|
@ -162,7 +162,7 @@ impl DeriveEnum {
|
|||
// if we have fixed value variants
|
||||
result.ident_str("variant");
|
||||
result.puncts("=>");
|
||||
result.ident_str("Err");
|
||||
result.push_parsed("core::result::Result::Err")?;
|
||||
result.group(Delimiter::Parenthesis, |err_inner| {
|
||||
err_inner.push_parsed(format!(
|
||||
"{}::error::DecodeError::UnexpectedVariant",
|
||||
|
|
|
|||
|
|
@ -408,6 +408,10 @@ mod derive_with_polluted_scope {
|
|||
#[allow(non_snake_case)]
|
||||
fn Ok() {}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[allow(non_snake_case)]
|
||||
fn Err() {}
|
||||
|
||||
#[derive(bincode::Encode, bincode::Decode)]
|
||||
struct A {
|
||||
a: u32,
|
||||
|
|
|
|||
Loading…
Reference in New Issue