Skip to content

Commit 6c5d3b2

Browse files
committed
rustc_target: move comment to macro
Avoid duplicating this comment in preparation for adding more enums.
1 parent 87f9dcd commit 6c5d3b2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

compiler/rustc_target/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ macro_rules! target_spec_enum {
135135
$( #[$variant_attr:meta] )*
136136
$Variant,
137137
)*
138+
/// The vast majority of the time, the compiler deals with a fixed
139+
/// set of values, so it is convenient for them to be represented in
140+
/// an enum. However, it is possible to have arbitrary values in a
141+
/// target JSON file (which can be parsed when `--target` is
142+
/// specified). This might occur, for example, for an out-of-tree
143+
/// codegen backend that supports a value (e.g. architecture or OS)
144+
/// that rustc currently doesn't know about. This variant exists as
145+
/// an escape hatch for such cases.
138146
$( #[$other_variant_attr] )*
139147
$OtherVariant(crate::spec::StaticCow<str>),
140148
}

compiler/rustc_target/src/spec/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,13 +1884,6 @@ crate::target_spec_enum! {
18841884
X86_64 = "x86_64",
18851885
Xtensa = "xtensa",
18861886
}
1887-
/// The vast majority of the time, the compiler deals with a fixed set of
1888-
/// target architectures, so it is convenient for them to be represented in
1889-
/// an enum. However, it is possible to have arbitrary values for the "arch"
1890-
/// field in a target JSON file (which can be parsed when `--target` is
1891-
/// specified). This might occur, for example, for an out-of-tree codegen
1892-
/// backend that supports an architecture that rustc currently doesn't know
1893-
/// about. This variant exists as an escape hatch for such cases.
18941887
other_variant = Unknown;
18951888
}
18961889

0 commit comments

Comments
 (0)