# This file is automatically generated by upgrade.py.

filegroup(
    name = "rustc",
    srcs = ["bin/rustc"],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "rustc_lib",
    srcs = glob(
        [
            "bin/*.dylib",
            "lib/*.dylib*",
            "lib/rustlib/x86_64-apple-darwin/codegen-backends/*.dylib",
            "lib/rustlib/x86_64-apple-darwin/bin/rust-lld",
            "lib/rustlib/x86_64-apple-darwin/lib/*.dylib*",
        ],
        allow_empty = True,
    ),
    visibility = ["//visibility:public"],
)

filegroup(
    name = "rustdoc",
    srcs = ["bin/rustdoc"],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "clippy_driver_bin",
    srcs = ["bin/clippy-driver"],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "cargo",
    srcs = ["bin/cargo"],
    visibility = ["//visibility:public"],
)
filegroup(
    name = "rustfmt_bin",
    srcs = ["bin/rustfmt"],
    visibility = ["//visibility:public"],
)

sh_binary(
    name = "rustfmt",
    srcs = [":rustfmt_bin"],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "llvm_cov_bin",
    srcs = ["lib/rustlib/x86_64-apple-darwin/bin/llvm-cov"],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "llvm_profdata_bin",
    srcs = ["lib/rustlib/x86_64-apple-darwin/bin/llvm-profdata"],
    visibility = ["//visibility:public"],
)

load("@rules_rust//rust:toolchain.bzl", "rust_stdlib_filegroup")

rust_stdlib_filegroup(
    name = "rust_std-x86_64-apple-darwin",
    srcs = glob(
        [
            "lib/rustlib/x86_64-apple-darwin/lib/*.rlib",
            "lib/rustlib/x86_64-apple-darwin/lib/*.dylib*",
            "lib/rustlib/x86_64-apple-darwin/lib/*.a",
            "lib/rustlib/x86_64-apple-darwin/lib/self-contained/**",
        ],
        # Some patterns (e.g. `lib/*.a`) don't match anything, see https://github.com/bazelbuild/rules_rust/pull/245
        allow_empty = True,
    ),
    visibility = ["//visibility:public"],
)

# For legacy support
alias(
    name = "rust_lib-x86_64-apple-darwin",
    actual = "rust_std-x86_64-apple-darwin",
    visibility = ["//visibility:public"],
)

load("@rules_rust//rust:toolchain.bzl", "rust_toolchain")

rust_toolchain(
    name = "rust_toolchain",
    rust_doc = "//:rustdoc",
    rust_std = "//:rust_std-x86_64-apple-darwin",
    rustc = "//:rustc",
    rustfmt = "//:rustfmt_bin",
    cargo = "//:cargo",
    clippy_driver = "//:clippy_driver_bin",
    llvm_cov = "//:llvm_cov_bin",
    llvm_profdata = "//:llvm_profdata_bin",
    rustc_lib = "//:rustc_lib",
    allocator_library = "@rules_rust//ffi/cc/allocator_library",
    global_allocator_library = "@rules_rust//ffi/cc/global_allocator_library",
    binary_ext = "",
    staticlib_ext = ".a",
    dylib_ext = ".dylib",
    stdlib_linkflags = ["-lSystem", "-lresolv"],
    default_edition = "",
    exec_triple = "x86_64-apple-darwin",
    target_triple = "x86_64-apple-darwin",
    visibility = ["//visibility:public"],
    extra_rustc_flags = [],
    extra_exec_rustc_flags = [],
    opt_level = None,
)
