This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ // force-host
2+ // no-prefer-dynamic
3+
4+ #![ crate_type = "proc-macro" ]
5+
6+ extern crate proc_macro;
7+ use proc_macro:: TokenStream ;
8+
9+ #[ proc_macro_derive( Deserialize ) ]
10+ pub fn deserialize_derive ( input : TokenStream ) -> TokenStream {
11+ "impl Build {
12+ fn deserialize() -> Option<u64> {
13+ let x: Option<u32> = Some(0);
14+ Some(x? + 1)
15+ }
16+ }
17+ "
18+ . parse ( )
19+ . unwrap ( )
20+ }
Original file line number Diff line number Diff line change 1+ // aux-build: issue-118809.rs
2+
3+ #[ macro_use]
4+ extern crate issue_118809;
5+
6+ #[ derive( Deserialize ) ] //~ ERROR mismatched types [E0308]
7+ pub struct Build {
8+ }
9+
10+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0308]: mismatched types
2+ --> $DIR/issue-118809.rs:6:10
3+ |
4+ LL | #[derive(Deserialize)]
5+ | ^^^^^^^^^^^
6+ | |
7+ | expected `u64`, found `u32`
8+ | arguments to this enum variant are incorrect
9+ |
10+ help: the type constructed contains `u32` due to the type of the argument passed
11+ --> $DIR/issue-118809.rs:6:10
12+ |
13+ LL | #[derive(Deserialize)]
14+ | ^^^^^^^^^^^ this argument influences the type of `Some`
15+ note: tuple variant defined here
16+ --> $SRC_DIR/core/src/option.rs:LL:COL
17+ = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
18+
19+ error: aborting due to 1 previous error
20+
21+ For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments