Skip to content

Cargo scripts cannot be used in aliases #16894

@musjj

Description

@musjj

Problem

Cargo script paths cannot be used in aliases.

Steps

.cargo/config.toml

[unstable]
script = true

[alias]
foo = "foo.rs"

foo.rs

#!/usr/bin/env cargo

fn main() {}

Then run the alias:

$ cargo foo
error: expected table for configuration key `alias.foo`, but found string in /tmp/tmp.JYGBGctKpJ/.cargo/config.toml

Possible Solution(s)

Script paths should be usable in aliases.

Notes

No response

Version

cargo 1.96.0-nightly (f298b8c82 2026-02-24)
release: 1.96.0-nightly
commit-hash: f298b8c82da0cba538516b45b04a480fc501d4c0
commit-date: 2026-02-24
host: x86_64-unknown-linux-gnu
libgit2: 1.9.2 (sys:0.20.4 vendored)
libcurl: 8.15.0-DEV (sys:0.4.83+curl-8.15.0 vendored ssl:OpenSSL/3.5.4)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: NixOS 26.5.0 [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasesArea: command aliasesC-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Z-scriptNightly: cargo script

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions