-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect types shown in an error when using rhai
#120416
Comments
For context, |
Reproduction (doesn't happen if the alias is in the same crate) // dep.rs
pub use std::option::Option as DepOption;
pub struct Engine; // poc.rs
struct Wrapper {
engine: dep::Engine,
ctx: Option<()>,
}
fn main() {
let _ = Wrapper {
engine: dep::Engine,
ctx: (),
};
}
error[E0308]: mismatched types
--> poc.rs:9:14
|
9 | ctx: (),
| ^^ expected `DepOption<()>`, found `()`
|
= note: expected enum `DepOption<()>`
found unit type `()`
... |
I believe this issue was regressed by #105411. More precisely, it was caused by the changes found at https://github.com/rust-lang/rust/pull/105411/files#diff-b56d8c5fa3d7803c5b0e19e1a8854d85c302974484c4c20bf51c76a19556f4a7R376-R382. |
Code
Current output
Desired output
Rationale and extra context
No response
Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: