Skip to content

Target tab completion invokes rustup #12585

Closed
@mkoncek

Description

@mkoncek

Problem

Invoking cargo build --target <TAB> invokes rustup. Some environments may not have it installed and I do not see why it should be invoked if the tab completion can run equivalent of rustc --print target-list.

Steps

  1. Set up a basic Rust project with cargo
  2. Write cargo build --target on terminal and then press the TAB key.
  3. If rustup is not installed, terminal will print:
    cargo build --target bash: rustup: command not found

Possible Solution(s)

I suppose cargo could return the output of rustc --print target-list

Notes

It is generally a good idea to depend only on the most basic tools, especially if they get the job done right, like rustc does.

Version

cargo 1.71.0
release: 1.71.0
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.1 system)
libcurl: 8.0.1 (sys:0.4.61+curl-8.0.1 system ssl:OpenSSL/3.0.9)
os: Fedora 38.0.0 [64-bit]


<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"Angelin01"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->

Metadata

Metadata

Assignees

Labels

A-completionsArea: shell completionsC-bugCategory: bugE-easyExperience: EasyS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions