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
|
// if we have fixed value variants
|
||||||
result.ident_str("variant");
|
result.ident_str("variant");
|
||||||
result.puncts("=>");
|
result.puncts("=>");
|
||||||
result.ident_str("Err");
|
result.push_parsed("core::result::Result::Err")?;
|
||||||
result.group(Delimiter::Parenthesis, |err_inner| {
|
result.group(Delimiter::Parenthesis, |err_inner| {
|
||||||
err_inner.push_parsed(format!(
|
err_inner.push_parsed(format!(
|
||||||
"{}::error::DecodeError::UnexpectedVariant",
|
"{}::error::DecodeError::UnexpectedVariant",
|
||||||
|
|
|
||||||
|
|
@ -408,6 +408,10 @@ mod derive_with_polluted_scope {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
fn Ok() {}
|
fn Ok() {}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
fn Err() {}
|
||||||
|
|
||||||
#[derive(bincode::Encode, bincode::Decode)]
|
#[derive(bincode::Encode, bincode::Decode)]
|
||||||
struct A {
|
struct A {
|
||||||
a: u32,
|
a: u32,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue