-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
C-bugCategory: bugCategory: bug
Description
rust-analyzer version: rust-analyzer 1.94.0-nightly (fcd6309 2026-01-01)
rustc version: rustc 1.94.0-nightly (fcd630976 2026-01-01)
editor or extension: Helix and Emacs
relevant settings:
[language-server.rust-analyzer.config]
check.overrideCommand = ["cargo", "xnitpick"]
# check.overrideCommand = ["cargo", "clippy"]
cargo.features = "all"
diagnostics = {experimental.enable = true, styleLints.enable = true}
inlayHints = {closureCaptureHints.enable = true, closureReturnTypeHints.enable = "always"}and identical settings in Emacs
repository link (if public, optional): https://github.com/latkerlo/latkerlo-jvotci/blob/main/rs/src/tools.rs
code snippet to reproduce: I couldn't find a minimal reproduction, but the linked file produces these warnings for me starting at line 170
none of the other uses of format! or strin! in the project cause the warnings.
#[macro_export]
/// Pythonic `str`ing `in`dexing.
macro_rules! strin {
($s:expr, $i:expr) => {{
let mut chars = ($s).chars();
let len = chars.clone().count();
let positive = |i| -> Option<usize> {
let j = if i < 0 { len as isize + i } else { i } as usize;
(j < len).then_some(j)
};
positive($i).map(|i| (&mut chars).nth(i).unwrap()).unwrap_or_default()
}};
}Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bug