Skip to content

Commit a0ec766

Browse files
committed
rustc_target: move comment to macro
Avoid duplicating this comment in preparation for adding more enums.
1 parent 0bbef55 commit a0ec766

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
@@ -1881,13 +1881,6 @@ crate::target_spec_enum! {
18811881
X86_64 = "x86_64",
18821882
Xtensa = "xtensa",
18831883
}
1884-
/// The vast majority of the time, the compiler deals with a fixed set of
1885-
/// target architectures, so it is convenient for them to be represented in
1886-
/// an enum. However, it is possible to have arbitrary values for the "arch"
1887-
/// field in a target JSON file (which can be parsed when `--target` is
1888-
/// specified). This might occur, for example, for an out-of-tree codegen
1889-
/// backend that supports an architecture that rustc currently doesn't know
1890-
/// about. This variant exists as an escape hatch for such cases.
18911884
other_variant = Unknown;
18921885
}
18931886

0 commit comments

Comments
 (0)