Skip to content

Commit 4c91dc2

Browse files
Samy KacimiAlexander Regueiro
Samy Kacimi
authored and
Alexander Regueiro
committed
fix syntax typos and consistency in compiler messages
1 parent cd5214c commit 4c91dc2

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

src/librustc/hir/def_id.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ impl CrateNum {
6969
pub fn as_usize(self) -> usize {
7070
match self {
7171
CrateNum::Index(id) => id.as_usize(),
72-
_ => bug!("tried to get index of nonstandard crate {:?}", self),
72+
_ => bug!("tried to get index of non-standard crate {:?}", self),
7373
}
7474
}
7575

7676
pub fn as_u32(self) -> u32 {
7777
match self {
7878
CrateNum::Index(id) => id.as_u32(),
79-
_ => bug!("tried to get index of nonstandard crate {:?}", self),
79+
_ => bug!("tried to get index of non-standard crate {:?}", self),
8080
}
8181
}
8282

src/librustc/session/config.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1144,9 +1144,9 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
11441144
lto: LtoCli = (LtoCli::Unspecified, parse_lto, [TRACKED],
11451145
"perform LLVM link-time optimizations"),
11461146
target_cpu: Option<String> = (None, parse_opt_string, [TRACKED],
1147-
"select target processor (rustc --print target-cpus for details)"),
1147+
"select target processor (`rustc --print target-cpus` for details)"),
11481148
target_feature: String = (String::new(), parse_string, [TRACKED],
1149-
"target specific attributes (rustc --print target-features for details)"),
1149+
"target specific attributes (`rustc --print target-features` for details)"),
11501150
passes: Vec<String> = (Vec::new(), parse_list, [TRACKED],
11511151
"a list of extra LLVM passes to run (space separated)"),
11521152
llvm_args: Vec<String> = (Vec::new(), parse_list, [TRACKED],
@@ -1172,9 +1172,9 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
11721172
no_redzone: Option<bool> = (None, parse_opt_bool, [TRACKED],
11731173
"disable the use of the redzone"),
11741174
relocation_model: Option<String> = (None, parse_opt_string, [TRACKED],
1175-
"choose the relocation model to use (rustc --print relocation-models for details)"),
1175+
"choose the relocation model to use (`rustc --print relocation-models` for details)"),
11761176
code_model: Option<String> = (None, parse_opt_string, [TRACKED],
1177-
"choose the code model to use (rustc --print code-models for details)"),
1177+
"choose the code model to use (`rustc --print code-models` for details)"),
11781178
metadata: Vec<String> = (Vec::new(), parse_list, [TRACKED],
11791179
"metadata to mangle symbol names with"),
11801180
extra_filename: String = (String::new(), parse_string, [UNTRACKED],
@@ -1184,7 +1184,7 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
11841184
remark: Passes = (Passes::Some(Vec::new()), parse_passes, [UNTRACKED],
11851185
"print remarks for these optimization passes (space separated, or \"all\")"),
11861186
no_stack_check: bool = (false, parse_bool, [UNTRACKED],
1187-
"the --no-stack-check flag is deprecated and does nothing"),
1187+
"the `--no-stack-check` flag is deprecated and does nothing"),
11881188
debuginfo: Option<usize> = (None, parse_opt_uint, [TRACKED],
11891189
"debug info emission level, 0 = no debug info, 1 = line tables only, \
11901190
2 = full debug info with variable and type information"),
@@ -1400,9 +1400,9 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
14001400
thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED],
14011401
"enable ThinLTO when possible"),
14021402
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],
1403-
"control whether `#[inline]` functions are in all cgus"),
1403+
"control whether `#[inline]` functions are in all CGUs"),
14041404
tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
1405-
"choose the TLS model to use (rustc --print tls-models for details)"),
1405+
"choose the TLS model to use (`rustc --print tls-models` for details)"),
14061406
saturating_float_casts: bool = (false, parse_bool, [TRACKED],
14071407
"make float->int casts UB-free: numbers outside the integer type's range are clipped to \
14081408
the max/min integer respectively, and NaN is mapped to 0"),

src/librustc_codegen_utils/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn find_crate_name(sess: Option<&Session>,
5757
if let Some(ref s) = sess.opts.crate_name {
5858
if let Some((attr, name)) = attr_crate_name {
5959
if name.as_str() != *s {
60-
let msg = format!("--crate-name and `#[crate_name]` are \
60+
let msg = format!("`--crate-name` and `#[crate_name]` are \
6161
required to match, but `{}` != `{}`",
6262
s, name);
6363
sess.span_err(attr.span, &msg);

src/librustc_data_structures/flock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ cfg_if! {
276276
debug!("failed acquiring file lock: {}", err);
277277
Err(err)
278278
} else {
279-
debug!("successfully acquired lock.");
279+
debug!("successfully acquired lock");
280280
Ok(Lock { _file: file })
281281
}
282282
}

src/librustc_driver/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ fn print_with_analysis(
898898
suffix (b::c::d)");
899899
let hir_id = tcx.hir().node_to_hir_id(nodeid);
900900
let node = tcx.hir().find(hir_id).unwrap_or_else(|| {
901-
tcx.sess.fatal(&format!("--pretty flowgraph couldn't find id: {}", nodeid))
901+
tcx.sess.fatal(&format!("`--pretty` flowgraph couldn't find id: {}", nodeid))
902902
});
903903

904904
match blocks::Code::from_node(&tcx.hir(), hir_id) {
@@ -910,7 +910,7 @@ fn print_with_analysis(
910910
print_flowgraph(variants, tcx, code, mode, out)
911911
}
912912
None => {
913-
let message = format!("--pretty=flowgraph needs block, fn, or method; \
913+
let message = format!("`--pretty=flowgraph` needs block, fn, or method; \
914914
got {:?}",
915915
node);
916916

src/librustc_incremental/persist/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ fn find_source_directory_in_iter<I>(iter: I,
538538
if source_directories_already_tried.contains(&session_dir) ||
539539
!is_session_directory(&directory_name) ||
540540
!is_finalized(&directory_name) {
541-
debug!("find_source_directory_in_iter - ignoring.");
541+
debug!("find_source_directory_in_iter - ignoring");
542542
continue
543543
}
544544

src/librustdoc/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl Options {
250250
None => ColorConfig::Auto,
251251
Some(arg) => {
252252
early_error(ErrorOutputType::default(),
253-
&format!("argument for --color must be `auto`, `always` or `never` \
253+
&format!("argument for `--color` must be `auto`, `always` or `never` \
254254
(instead was `{}`)", arg));
255255
}
256256
};
@@ -269,7 +269,7 @@ impl Options {
269269
Some("short") => ErrorOutputType::HumanReadable(HumanReadableErrorType::Short(color)),
270270
Some(arg) => {
271271
early_error(ErrorOutputType::default(),
272-
&format!("argument for --error-format must be `human`, `json` or \
272+
&format!("argument for `--error-format` must be `human`, `json` or \
273273
`short` (instead was `{}`)", arg));
274274
}
275275
};

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
20642064
}
20652065
if attr::contains_name(&i.attrs[..], sym::main) {
20662066
gate_feature_post!(&self, main, i.span,
2067-
"declaration of a nonstandard `#[main]` \
2067+
"declaration of a non-standard `#[main]` \
20682068
function may change over time, for now \
20692069
a top-level `fn main()` is required");
20702070
}

src/libsyntax/parse/attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl<'a> Parser<'a> {
226226

227227
fn parse_unsuffixed_lit(&mut self) -> PResult<'a, ast::Lit> {
228228
let lit = self.parse_lit()?;
229-
debug!("checking if {:?} is unusuffixed.", lit);
229+
debug!("checking if {:?} is unusuffixed", lit);
230230

231231
if !lit.node.is_unsuffixed() {
232232
let msg = "suffixed literals are not allowed in attributes";

0 commit comments

Comments
 (0)