Skip to content

Commit 1bdb024

Browse files
committed
Fix RowValue which can reference an invalid Ok that defined outside
Update tests/procmacro.rs Fix lint attribute
1 parent 7f7fa12 commit 1bdb024

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

oracle_procmacro/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn derive_row_value(input: TokenStream) -> TokenStream {
7171
let result = #ident {
7272
#(#fields)*
7373
};
74-
Ok(result)
74+
::std::result::Result::Ok(result)
7575
}
7676
}
7777
};

tests/procmacro.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use oracle::RowValue;
2+
3+
#[test]
4+
fn procmacro_ok_shadow() {
5+
#[allow(dead_code)]
6+
enum AnotherResult<T, E> {
7+
Ok(T),
8+
Err(E),
9+
}
10+
11+
#[allow(unused_imports)]
12+
use AnotherResult::Ok;
13+
14+
#[derive(Debug, RowValue)]
15+
struct Foo {}
16+
}

0 commit comments

Comments
 (0)