Bug 473438 - Encountering an error when trying to use `async fn` feature in Rust (2021) with Kate 23.04.3
Summary: Encountering an error when trying to use `async fn` feature in Rust (2021) wi...
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-16 06:06 UTC by tjw123hh
Modified: 2023-08-16 08:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tjw123hh 2023-08-16 06:06:42 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

Encountering an error when trying to use `async fn` feature in Rust (2021) with Kate 23.04.3

STEPS TO REPRODUCE
1. Open Kate 23.04.3
2. Try to use the `async fn` feature in Rust (2021)

OBSERVED RESULT
Error message (in `Output`): 
```

\[13:50:11  Format Error\] /home/tjw123hh/.cargo/bin/rustfmt --color=never --check
error\[E0670\]: `async fn` is not permitted in Rust 2015
--> :11:1
|
11 | async fn main() {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
= help: pass `--edition 2021` to `rustc`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide

```

No edition argument is passed to rustc

EXPECTED RESULT
The `async fn` feature in Rust (2021) should work without error.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 23.04 
(available in About System)
Operating System: Ubuntu 23.04
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.8
Kernel Version: 6.2.0-27-generic (64-bit)
Graphics Platform: X11
Comment 1 Waqar Ahmed 2023-08-16 08:20:52 UTC
Your project makes rustfmt think that it's using Rust-2015 for whatever reason (incorrectly specified somewhere perhaps?). You can either fix that OR: 

- go to: Main Menu -> Configure Kate... -> Formatting
- Override the default "command" for rustfmt. See clang-format in the page as an example