Skip to content

Commit

Permalink
Remove unused rust.bzl file (#1002)
Browse files Browse the repository at this point in the history
* Remove unused rust.bzl file

* Regenerate documentation
  • Loading branch information
hlopko committed Nov 1, 2021
1 parent b3e26e0 commit 3cc41db
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 167 deletions.
19 changes: 0 additions & 19 deletions docs/flatten.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,6 @@ Add additional rustc_flags from the command line with `--@rules_rust//:extra_rus
| <a id="extra_rustc_flags-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |


<a id="#fail_when_enabled"></a>

## fail_when_enabled

<pre>
fail_when_enabled(<a href="#fail_when_enabled-name">name</a>, <a href="#fail_when_enabled-flag">flag</a>)
</pre>

A rule that will fail analysis when a flag is enabled.

**ATTRIBUTES**


| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="fail_when_enabled-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="fail_when_enabled-flag"></a>flag | The incompatible flag to check | String | required | |


<a id="#incompatible_flag"></a>

## incompatible_flag
Expand Down
19 changes: 0 additions & 19 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@
* [incompatible_flag](#incompatible_flag)
* [fail_when_enabled](#fail_when_enabled)

<a id="#fail_when_enabled"></a>

## fail_when_enabled

<pre>
fail_when_enabled(<a href="#fail_when_enabled-name">name</a>, <a href="#fail_when_enabled-flag">flag</a>)
</pre>

A rule that will fail analysis when a flag is enabled.

**ATTRIBUTES**


| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="fail_when_enabled-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="fail_when_enabled-flag"></a>flag | The incompatible flag to check | String | required | |


<a id="#incompatible_flag"></a>

## incompatible_flag
Expand Down
2 changes: 0 additions & 2 deletions docs/symbols.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ load(
)
load(
"@rules_rust//rust/settings:incompatible.bzl",
_fail_when_enabled = "fail_when_enabled",
_incompatible_flag = "incompatible_flag",
)
load(
Expand Down Expand Up @@ -147,7 +146,6 @@ rustfmt_test = _rustfmt_test
error_format = _error_format
extra_rustc_flags = _extra_rustc_flags
incompatible_flag = _incompatible_flag
fail_when_enabled = _fail_when_enabled
capture_clippy_output = _capture_clippy_output

CrateInfo = _CrateInfo
Expand Down
1 change: 0 additions & 1 deletion rust/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package(default_visibility = ["//visibility:public"])
exports_files([
"known_shas.bzl",
"repositories.bzl",
"rust.bzl",
"defs.bzl",
"toolchain.bzl",
])
Expand Down
2 changes: 1 addition & 1 deletion rust/private/common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
This module is meant to be used by custom rules that need to compile Rust code
and cannot simply rely on writing a macro that wraps `rust_library`. This module
provides the lower-level interface to Rust providers, actions, and functions.
Do not load this file directly; instead, load the top-level `rust.bzl` file,
Do not load this file directly; instead, load the top-level `defs.bzl` file,
which exports the `rust_common` struct.
In the Bazel lingo, `rust_common` gives the access to the Rust Sandwich API.
Expand Down
101 changes: 0 additions & 101 deletions rust/rust.bzl

This file was deleted.

6 changes: 0 additions & 6 deletions rust/settings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ load(":incompatible.bzl", "incompatible_flag")

package(default_visibility = ["//visibility:public"])

incompatible_flag(
name = "split_rust_library",
build_setting_default = True,
issue = "https://github.com/bazelbuild/rules_rust/issues/591",
)

incompatible_flag(
name = "incompatible_make_rust_providers_target_independent",
build_setting_default = True,
Expand Down
18 changes: 0 additions & 18 deletions rust/settings/incompatible.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,3 @@ incompatible_flag = rule(
),
},
)

def _fail_when_enabled_impl(ctx):
flag = ctx.attr.flag
flag_info = getattr(ctx.attr, "_" + flag)[IncompatibleFlagInfo]
if flag_info.enabled:
fail("Incompatible flag {} has been flipped, see {} for details.".format(flag, flag_info.issue))

fail_when_enabled = rule(
doc = "A rule that will fail analysis when a flag is enabled.",
implementation = _fail_when_enabled_impl,
attrs = {
"flag": attr.string(
doc = "The incompatible flag to check",
mandatory = True,
),
"_split_rust_library": attr.label(default = "//rust/settings:split_rust_library"),
},
)

0 comments on commit 3cc41db

Please sign in to comment.