Skip to content
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

Quick fix for function no return value, Ok() out of function body #17728

Closed
A4-Tacks opened this issue Jul 28, 2024 · 0 comments · Fixed by #17763
Closed

Quick fix for function no return value, Ok() out of function body #17728

A4-Tacks opened this issue Jul 28, 2024 · 0 comments · Fixed by #17763
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug

Comments

@A4-Tacks
Copy link

rust-analyzer version: rust-analyzer 1.80.0 (05147895 2024-07-21)

rustc version: rustc 1.80.0 (051478957 2024-07-21)

editor or extension: Vim 9.1 coc-rust-analyzer

code snippet to reproduce:

type Result<T> = std::result::Result<T, ()>;

fn foo() -> Result<()> {}

fn main() { }

quick fix:

type Result<T> = std::result::Result<T, ()>;

fn foo() -> Result<()> Ok({})

fn main() { }

expect:

type Result<T> = std::result::Result<T, ()>;

fn foo() -> Result<()> { Ok(()) }

fn main() { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants