Skip to content

Commit 022d9c8

Browse files
author
Alexander Regueiro
committed
Fixed grammar/style in error messages and reblessed tests.
1 parent 6187684 commit 022d9c8

File tree

125 files changed

+381
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+381
-380
lines changed

src/librustc/mir/interpret/error.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,13 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
430430
match self {
431431
PointerOutOfBounds { ptr, msg, allocation_size } => {
432432
write!(f, "{} failed: pointer must be in-bounds at offset {}, \
433-
but is outside bounds of allocation {} which has size {}",
433+
but is outside bounds of allocation {} which has size {}",
434434
msg, ptr.offset.bytes(), ptr.alloc_id, allocation_size.bytes())
435435
},
436436
ValidationFailure(ref err) => {
437437
write!(f, "type validation failed: {}", err)
438438
}
439-
NoMirFor(ref func) => write!(f, "no mir for `{}`", func),
439+
NoMirFor(ref func) => write!(f, "no MIR for `{}`", func),
440440
FunctionAbiMismatch(caller_abi, callee_abi) =>
441441
write!(f, "tried to call a function with ABI {:?} using caller ABI {:?}",
442442
callee_abi, caller_abi),
@@ -451,9 +451,9 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
451451
FunctionArgCountMismatch =>
452452
write!(f, "tried to call a function with incorrect number of arguments"),
453453
ReallocatedWrongMemoryKind(ref old, ref new) =>
454-
write!(f, "tried to reallocate memory from {} to {}", old, new),
454+
write!(f, "tried to reallocate memory from `{}` to `{}`", old, new),
455455
DeallocatedWrongMemoryKind(ref old, ref new) =>
456-
write!(f, "tried to deallocate {} memory but gave {} as the kind", old, new),
456+
write!(f, "tried to deallocate `{}` memory but gave `{}` as the kind", old, new),
457457
InvalidChar(c) =>
458458
write!(f, "tried to interpret an invalid 32-bit value as a char: {}", c),
459459
AlignmentCheckFailed { required, has } =>
@@ -462,7 +462,7 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
462462
TypeNotPrimitive(ty) =>
463463
write!(f, "expected primitive type, got {}", ty),
464464
PathNotFound(ref path) =>
465-
write!(f, "Cannot find path {:?}", path),
465+
write!(f, "cannot find path {:?}", path),
466466
IncorrectAllocationInformation(size, size2, align, align2) =>
467467
write!(f, "incorrect alloc info: expected size {} and align {}, \
468468
got size {} and align {}",
@@ -525,7 +525,7 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
525525
InvalidBoolOp(_) =>
526526
write!(f, "invalid boolean operation"),
527527
UnterminatedCString(_) =>
528-
write!(f, "attempted to get length of a null terminated string, but no null \
528+
write!(f, "attempted to get length of a null-terminated string, but no null \
529529
found before end of allocation"),
530530
ReadUndefBytes(_) =>
531531
write!(f, "attempted to read undefined bytes"),

src/librustc/session/config.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,7 @@ pub fn parse_error_format(
19981998
Some(arg) => early_error(
19991999
ErrorOutputType::HumanReadable(HumanReadableErrorType::Default(color)),
20002000
&format!(
2001-
"argument for --error-format must be `human`, `json` or \
2001+
"argument for `--error-format` must be `human`, `json` or \
20022002
`short` (instead was `{}`)",
20032003
arg
20042004
),
@@ -2037,7 +2037,7 @@ pub fn build_session_options_and_crate_config(
20372037
early_error(
20382038
ErrorOutputType::default(),
20392039
&format!(
2040-
"argument for --edition must be one of: \
2040+
"argument for `--edition` must be one of: \
20412041
{}. (instead was `{}`)",
20422042
EDITION_NAME_LIST,
20432043
arg
@@ -2051,7 +2051,7 @@ pub fn build_session_options_and_crate_config(
20512051
early_error(
20522052
ErrorOutputType::default(),
20532053
&format!(
2054-
"Edition {} is unstable and only \
2054+
"edition {} is unstable and only \
20552055
available for nightly builds of rustc.",
20562056
edition,
20572057
)
@@ -2075,14 +2075,14 @@ pub fn build_session_options_and_crate_config(
20752075
if let ErrorOutputType::Json { pretty: true, json_rendered } = error_format {
20762076
early_error(
20772077
ErrorOutputType::Json { pretty: false, json_rendered },
2078-
"--error-format=pretty-json is unstable",
2078+
"`--error-format=pretty-json` is unstable",
20792079
);
20802080
}
20812081
if let ErrorOutputType::HumanReadable(HumanReadableErrorType::AnnotateSnippet(_)) =
20822082
error_format {
20832083
early_error(
20842084
ErrorOutputType::Json { pretty: false, json_rendered },
2085-
"--error-format=human-annotate-rs is unstable",
2085+
"`--error-format=human-annotate-rs` is unstable",
20862086
);
20872087
}
20882088
}
@@ -2132,8 +2132,8 @@ pub fn build_session_options_and_crate_config(
21322132
early_warn(
21332133
error_format,
21342134
&format!(
2135-
"--emit={} with -o incompatible with \
2136-
-C codegen-units=N for N > 1",
2135+
"`--emit={}` with `-o` incompatible with \
2136+
`-C codegen-units=N` for N > 1",
21372137
ot
21382138
),
21392139
);
@@ -2153,21 +2153,21 @@ pub fn build_session_options_and_crate_config(
21532153
if debugging_opts.threads == Some(0) {
21542154
early_error(
21552155
error_format,
2156-
"Value for threads must be a positive nonzero integer",
2156+
"value for threads must be a positive non-zero integer",
21572157
);
21582158
}
21592159

21602160
if debugging_opts.threads.unwrap_or(1) > 1 && debugging_opts.fuel.is_some() {
21612161
early_error(
21622162
error_format,
2163-
"Optimization fuel is incompatible with multiple threads",
2163+
"optimization fuel is incompatible with multiple threads",
21642164
);
21652165
}
21662166

21672167
if codegen_units == Some(0) {
21682168
early_error(
21692169
error_format,
2170-
"Value for codegen units must be a positive nonzero integer",
2170+
"value for codegen units must be a positive non-zero integer",
21712171
);
21722172
}
21732173

src/librustc/traits/object_safety.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl<'tcx> TyCtxt<'tcx> {
368368
match self.layout_of(param_env.and(ty)) {
369369
Ok(layout) => &layout.abi,
370370
Err(err) => bug!(
371-
"Error: {}\n while computing layout for type {:?}", err, ty
371+
"error: {}\n while computing layout for type {:?}", err, ty
372372
)
373373
}
374374
};
@@ -384,7 +384,7 @@ impl<'tcx> TyCtxt<'tcx> {
384384
self.sess.delay_span_bug(
385385
self.def_span(method.def_id),
386386
&format!(
387-
"Receiver when Self = () should have a Scalar ABI, found {:?}",
387+
"receiver when `Self = ()` should have a Scalar ABI; found {:?}",
388388
abi
389389
),
390390
);
@@ -406,7 +406,8 @@ impl<'tcx> TyCtxt<'tcx> {
406406
self.sess.delay_span_bug(
407407
self.def_span(method.def_id),
408408
&format!(
409-
"Receiver when Self = {} should have a ScalarPair ABI, found {:?}",
409+
"receiver when `Self = {}` should have a ScalarPair ABI; \
410+
found {:?}",
410411
trait_object_ty, abi
411412
),
412413
);

src/librustc_mir/borrow_check/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
9898
&self.describe_place_with_options(moved_place, IncludingDowncast(true))
9999
.unwrap_or_else(|| "_".to_owned()),
100100
);
101-
err.span_label(span, format!("use of possibly uninitialized {}", item_msg));
101+
err.span_label(span, format!("use of possibly-uninitialized {}", item_msg));
102102

103103
use_spans.var_span_label(
104104
&mut err,

src/librustc_mir/const_eval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ pub fn error_to_const_error<'mir, 'tcx>(
533533

534534
pub fn note_on_undefined_behavior_error() -> &'static str {
535535
"The rules on what exactly is undefined behavior aren't clear, \
536-
so this check might be overzealous. Please open an issue on the rust compiler \
537-
repository if you believe it should not be considered undefined behavior"
536+
so this check might be overzealous. Please open an issue on the rustc \
537+
repository if you believe it should not be considered undefined behavior."
538538
}
539539

540540
fn validate_and_turn_into_const<'tcx>(

src/librustc_mir/error_codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ It is not allowed to use or capture an uninitialized variable. For example:
748748
```compile_fail,E0381
749749
fn main() {
750750
let x: i32;
751-
let y = x; // error, use of possibly uninitialized variable
751+
let y = x; // error, use of possibly-uninitialized variable
752752
}
753753
```
754754

src/librustc_mir/util/borrowck_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'cx, 'tcx> crate::borrow_check::MirBorrowckCtxt<'cx, 'tcx> {
5050
self,
5151
span,
5252
E0381,
53-
"{} of possibly uninitialized variable: `{}`",
53+
"{} of possibly-uninitialized variable: `{}`",
5454
verb,
5555
desc,
5656
)

src/libsyntax/parse/parser/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ impl<'a> Parser<'a> {
982982
}
983983
if self.is_do_catch_block() {
984984
let mut db = self.fatal("found removed `do catch` syntax");
985-
db.help("Following RFC #2388, the new non-placeholder syntax is `try`");
985+
db.help("following RFC #2388, the new non-placeholder syntax is `try`");
986986
return Err(db);
987987
}
988988
if self.is_try_block() {

src/libsyntax/parse/parser/stmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl<'a> Parser<'a> {
469469
self.diagnostic().struct_span_warn(self.token.span, {
470470
&format!("expected `;`, found {}", self.this_token_descr())
471471
}).note({
472-
"This was erroneously allowed and will become a hard error in a future release"
472+
"this was erroneously allowed and will become a hard error in a future release"
473473
}).emit();
474474
}
475475
}

src/test/ui/asm/asm-out-read-uninit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn main() {
2020
let x: isize;
2121
unsafe {
2222
asm!("mov $1, $0" : "=r"(x) : "r"(x));
23-
//~^ ERROR use of possibly uninitialized variable: `x`
23+
//~^ ERROR use of possibly-uninitialized variable: `x`
2424
}
2525
foo(x);
2626
}

0 commit comments

Comments
 (0)