Open
Description
Code
type Result<T> = std::result::Result<T, ()>;
fn foo() -> Result<'static, ()> { Ok(()) }
fn main() { }
Current output
error[E0107]: type alias takes 0 lifetime arguments but 1 lifetime argument was supplied
--> src/main.rs:3:13
|
3 | fn foo() -> Result<'static, ()> { Ok(()) }
| ^^^^^^ ------- help: remove this lifetime argument
| |
| expected 0 lifetime arguments
|
note: type alias defined here, with 0 lifetime parameters
--> src/main.rs:1:6
|
1 | type Result<T> = std::result::Result<T, ()>;
| ^^^^^^
For more information about this error, try `rustc --explain E0107`.
error: could not compile `test2` (bin "test2") due to 1 previous error
Desired output
error[E0107]: type alias takes 0 lifetime arguments but 1 lifetime argument was supplied
--> src/main.rs:3:13
|
3 | fn foo() -> Result<'static, ()> { Ok(()) }
| ^^^^^^ --------- help: remove this lifetime argument
| |
| expected 0 lifetime arguments
|
note: type alias defined here, with 0 lifetime parameters
--> src/main.rs:1:6
|
1 | type Result<T> = std::result::Result<T, ()>;
| ^^^^^^
For more information about this error, try `rustc --explain E0107`.
error: could not compile `test2` (bin "test2") due to 1 previous error
Rationale and extra context
Due to not removing the comma, rust-analyzer still has an error after quick fix
Other cases
No response
Rust Version
rustc 1.80.0 (051478957 2024-07-21)
binary: rustc
commit-hash: 051478957371ee0084a7c0913941d2a8c4757bb9
commit-date: 2024-07-21
host: aarch64-unknown-linux-gnu
release: 1.80.0
LLVM version: 18.1.7
Anything else?
No response