Skip to content

Commit

Permalink
Diagnostics should start lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Jan 12, 2020
1 parent 59c1db0 commit 0810210
Show file tree
Hide file tree
Showing 39 changed files with 160 additions and 160 deletions.
2 changes: 1 addition & 1 deletion src/librustc/traits/error_reporting.rs
Expand Up @@ -1156,7 +1156,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
err.span_help(impl_span, "trait impl with same name found");
let trait_crate = self.tcx.crate_name(trait_with_same_path.krate);
let crate_msg = format!(
"Perhaps two different versions of crate `{}` are being used?",
"perhaps two different versions of crate `{}` are being used?",
trait_crate
);
err.note(&crate_msg);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_passes/feature_gate.rs
Expand Up @@ -413,7 +413,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
self.check_extern(bare_fn_ty.ext);
}
ast::TyKind::Never => {
gate_feature_post!(&self, never_type, ty.span, "The `!` type is experimental");
gate_feature_post!(&self, never_type, ty.span, "the `!` type is experimental");
}
_ => {}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/test.rs
Expand Up @@ -325,7 +325,7 @@ fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
`expected = \"error message\"`",
)
.note(
"Errors in this attribute were erroneously \
"errors in this attribute were erroneously \
allowed and will become a hard error in a \
future release.",
)
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_lint/builtin.rs
Expand Up @@ -657,7 +657,7 @@ impl EarlyLintPass for AnonymousParameters {
)
.span_suggestion(
arg.pat.span,
"Try naming the parameter or explicitly \
"try naming the parameter or explicitly \
ignoring it",
format!("_: {}", ty_snip),
appl,
Expand Down Expand Up @@ -1934,21 +1934,21 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
use rustc::ty::TyKind::*;
match ty.kind {
// Primitive types that don't like 0 as a value.
Ref(..) => Some((format!("References must be non-null"), None)),
Ref(..) => Some((format!("references must be non-null"), None)),
Adt(..) if ty.is_box() => Some((format!("`Box` must be non-null"), None)),
FnPtr(..) => Some((format!("Function pointers must be non-null"), None)),
Never => Some((format!("The never type (`!`) has no valid value"), None)),
FnPtr(..) => Some((format!("function pointers must be non-null"), None)),
Never => Some((format!("the `!` type has no valid value"), None)),
RawPtr(tm) if matches!(tm.ty.kind, Dynamic(..)) =>
// raw ptr to dyn Trait
{
Some((format!("The vtable of a wide raw pointer must be non-null"), None))
Some((format!("the vtable of a wide raw pointer must be non-null"), None))
}
// Primitive types with other constraints.
Bool if init == InitKind::Uninit => {
Some((format!("Booleans must be `true` or `false`"), None))
Some((format!("booleans must be either `true` or `false`"), None))
}
Char if init == InitKind::Uninit => {
Some((format!("Characters must be a valid unicode codepoint"), None))
Some((format!("characters must be a valid Unicode codepoint"), None))
}
// Recurse and checks for some compound types.
Adt(adt_def, substs) if !adt_def.is_union() => {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/borrow_check/nll.rs
Expand Up @@ -360,7 +360,7 @@ pub(super) fn dump_annotation<'a, 'tcx>(
// better.

if let Some(closure_region_requirements) = closure_region_requirements {
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "External requirements");
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "external requirements");

regioncx.annotate(tcx, &mut err);

Expand All @@ -379,7 +379,7 @@ pub(super) fn dump_annotation<'a, 'tcx>(

err.buffer(errors_buffer);
} else {
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "No external requirements");
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "no external requirements");
regioncx.annotate(tcx, &mut err);

err.buffer(errors_buffer);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/cast.rs
Expand Up @@ -381,7 +381,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
if unknown_cast_to { "to" } else { "from" }
);
err.note(
"The type information given here is insufficient to check whether \
"the type information given here is insufficient to check whether \
the pointer cast is valid",
);
if unknown_cast_to {
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/anon-params-deprecated.stderr
Expand Up @@ -2,7 +2,7 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
--> $DIR/anon-params-deprecated.rs:9:12
|
LL | fn foo(i32);
| ^^^ help: Try naming the parameter or explicitly ignoring it: `_: i32`
| ^^^ help: try naming the parameter or explicitly ignoring it: `_: i32`
|
note: lint level defined here
--> $DIR/anon-params-deprecated.rs:1:9
Expand All @@ -16,7 +16,7 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
--> $DIR/anon-params-deprecated.rs:12:30
|
LL | fn bar_with_default_impl(String, String) {}
| ^^^^^^ help: Try naming the parameter or explicitly ignoring it: `_: String`
| ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
Expand All @@ -25,7 +25,7 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
--> $DIR/anon-params-deprecated.rs:12:38
|
LL | fn bar_with_default_impl(String, String) {}
| ^^^^^^ help: Try naming the parameter or explicitly ignoring it: `_: String`
| ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
Expand Down
Expand Up @@ -34,7 +34,7 @@ LL | unsafe { std::mem::transmute(()) }
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
= note: `#[warn(invalid_value)]` on by default
= note: The never type (`!`) has no valid value
= note: the `!` type has no valid value

warning: the type `Empty` does not permit zero-initialization
--> $DIR/validate_uninhabited_zsts.rs:17:35
Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/feature-gates/feature-gate-never_type.stderr
@@ -1,4 +1,4 @@
error[E0658]: The `!` type is experimental
error[E0658]: the `!` type is experimental
--> $DIR/feature-gate-never_type.rs:7:17
|
LL | type Ma = (u32, !, i32);
Expand All @@ -7,7 +7,7 @@ LL | type Ma = (u32, !, i32);
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
error[E0658]: the `!` type is experimental
--> $DIR/feature-gate-never_type.rs:8:20
|
LL | type Meeshka = Vec<!>;
Expand All @@ -16,7 +16,7 @@ LL | type Meeshka = Vec<!>;
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
error[E0658]: the `!` type is experimental
--> $DIR/feature-gate-never_type.rs:9:24
|
LL | type Mow = &'static fn(!) -> !;
Expand All @@ -25,7 +25,7 @@ LL | type Mow = &'static fn(!) -> !;
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
error[E0658]: the `!` type is experimental
--> $DIR/feature-gate-never_type.rs:10:27
|
LL | type Skwoz = &'static mut !;
Expand All @@ -34,7 +34,7 @@ LL | type Skwoz = &'static mut !;
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
error[E0658]: the `!` type is experimental
--> $DIR/feature-gate-never_type.rs:13:16
|
LL | type Wub = !;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/future-incompatible-lint-group.stderr
Expand Up @@ -2,7 +2,7 @@ error: anonymous parameters are deprecated and will be removed in the next editi
--> $DIR/future-incompatible-lint-group.rs:4:10
|
LL | fn f(u8) {}
| ^^ help: Try naming the parameter or explicitly ignoring it: `_: u8`
| ^^ help: try naming the parameter or explicitly ignoring it: `_: u8`
|
note: lint level defined here
--> $DIR/future-incompatible-lint-group.rs:1:9
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/issues/issue-45730.stderr
Expand Up @@ -6,7 +6,7 @@ LL | let x: *const _ = 0 as _;
| |
| help: consider giving more type information
|
= note: The type information given here is insufficient to check whether the pointer cast is valid
= note: the type information given here is insufficient to check whether the pointer cast is valid

error[E0641]: cannot cast to a pointer of an unknown kind
--> $DIR/issue-45730.rs:5:23
Expand All @@ -16,7 +16,7 @@ LL | let x: *const _ = 0 as *const _;
| |
| help: consider giving more type information
|
= note: The type information given here is insufficient to check whether the pointer cast is valid
= note: the type information given here is insufficient to check whether the pointer cast is valid

error[E0641]: cannot cast to a pointer of an unknown kind
--> $DIR/issue-45730.rs:8:13
Expand All @@ -26,7 +26,7 @@ LL | let x = 0 as *const i32 as *const _ as *mut _;
| |
| help: consider giving more type information
|
= note: The type information given here is insufficient to check whether the pointer cast is valid
= note: the type information given here is insufficient to check whether the pointer cast is valid

error: aborting due to 3 previous errors

Expand Down

0 comments on commit 0810210

Please sign in to comment.