Cargo autocompletions are not working in Bash Linux

After the last rust update from 1.70 to 1.71 the cargo autocompletions hasn't been working.

i did the following steps:
mkdir -p ~/.local/share/bash-completion/completions
rustup completions bash >> ~/.local/share/bash-completion/completions/rustup
rustup completions bash cargo >> ~/.local/share/bash-completion/completions/cargo

Now after updating to the latest version 1.71, only the rustup completions are working, the cargo completions are not working. I installed the 1.70 toolchain and switched to it instead of stable (1.71) and now cargo completions are working fine.

Do you have any idea why this is happening ?

Looks like a bug.

$ rustup completions bash cargo
if command -v rustc >/dev/null 2>&1; then
	source "$(rustc --print sysroot)"/etc/bash_completion.d/cargo
fi

There is no etc directory under the sysroot on my machine. I'm also on 1.71.

1 Like

The etc directory is hidden under the src on my machine.