- Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
use std::{cell::RefCell, rc::Rc}; struct Wrapper { // this part is important - if this field is commented out, error disappears engine: rhai::Engine, // this is what actually triggers the diagnostic ctx: Rc<RefCell<()>>, } fn main() { let _ = Wrapper { engine: rhai::Engine::new_raw(), ctx: (), }; }
Current output
error[E0308]: mismatched types --> src/main.rs:13:14 | 13 | ctx: (), | ^^ expected `Shared<Locked<()>>`, found `()` | = note: expected struct `Rc<Locked<()>>` found unit type `()`
Desired output
error[E0308]: mismatched types --> src/main.rs:13:14 | 13 | ctx: (), | ^^ expected `Rc<RefCell<()>>`, found `()` | = note: expected struct `Rc<RefCell<()>>` found unit type `()`
Rationale and extra context
No response
Other cases
No response
Rust Version
rustc 1.75.0 (82e1608df 2023-12-21) binary: rustc commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112 commit-date: 2023-12-21 host: x86_64-unknown-linux-gnu release: 1.75.0 LLVM version: 17.0.6
Anything else?
No response
clubby789
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.