Skip to content

Commit

Permalink
Diagnostics should not end with a full stop
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Jan 12, 2020
1 parent 0810210 commit 8461fa5
Show file tree
Hide file tree
Showing 29 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Expand Up @@ -44,7 +44,7 @@
// Here we explicitly #[cfg]-out this whole crate when testing. If we don't do
// this, both the generated test artifact and the linked libtest (which
// transitively includes libcore) will both define the same set of lang items,
// and this will cause the E0152 "duplicate lang item found" error. See
// and this will cause the E0152 "found duplicate lang item" error. See
// discussion in #50466 for details.
//
// This cfg won't affect doc tests.
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/lang_items.rs
Expand Up @@ -184,7 +184,7 @@ impl LanguageItemCollector<'tcx> {
self.tcx.sess,
span,
E0152,
"duplicate lang item found: `{}`.",
"found duplicate lang item `{}`",
name
),
None => {
Expand All @@ -206,12 +206,12 @@ impl LanguageItemCollector<'tcx> {
},
};
if let Some(span) = self.tcx.hir().span_if_local(original_def_id) {
err.span_note(span, "first defined here.");
err.span_note(span, "first defined here");
} else {
match self.tcx.extern_crate(original_def_id) {
Some(ExternCrate {dependency_of, ..}) => {
err.note(&format!(
"first defined in crate `{}` (which `{}` depends on).",
"first defined in crate `{}` (which `{}` depends on)",
self.tcx.crate_name(original_def_id.krate),
self.tcx.crate_name(*dependency_of)));
},
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_passes/diagnostic_items.rs
Expand Up @@ -73,7 +73,7 @@ fn collect_item(
)),
};
if let Some(span) = tcx.hir().span_if_local(original_def_id) {
err.span_note(span, "first defined here.");
err.span_note(span, "first defined here");
} else {
err.note(&format!(
"first defined in crate `{}`.",
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/lib.rs
Expand Up @@ -2006,7 +2006,7 @@ impl<'a> Resolver<'a> {
continue;
}
}
let msg = "there are too many initial `super`s.".to_string();
let msg = "there are too many leading `super` keywords".to_string();
return PathResult::Failed {
span: ident.span,
label: msg,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Expand Up @@ -1664,7 +1664,7 @@ fn check_opaque_for_cycles<'tcx>(
if let hir::OpaqueTyOrigin::AsyncFn = origin {
struct_span_err!(tcx.sess, span, E0733, "recursion in an `async fn` requires boxing",)
.span_label(span, "recursive `async fn`")
.note("a recursive `async fn` must be rewritten to return a boxed `dyn Future`.")
.note("a recursive `async fn` must be rewritten to return a boxed `dyn Future`")
.emit();
} else {
let mut err =
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/panicking.rs
Expand Up @@ -199,7 +199,7 @@ fn default_hook(info: &PanicInfo<'_>) {
let _ = writeln!(
err,
"note: run with `RUST_BACKTRACE=1` \
environment variable to display a backtrace."
environment variable to display a backtrace"
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/panic-handler-twice.rs
Expand Up @@ -10,7 +10,7 @@ use core::panic::PanicInfo;

#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
//~^ error duplicate lang item found: `panic_impl`
//~^ ERROR found duplicate lang item `panic_impl`
loop {}
}

Expand Down
Expand Up @@ -4,15 +4,15 @@ error[E0733]: recursion in an `async fn` requires boxing
LL | async fn rec_1() {
| ^ recursive `async fn`
|
= note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`.
= note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`

error[E0733]: recursion in an `async fn` requires boxing
--> $DIR/mutually-recursive-async-impl-trait-type.rs:9:18
|
LL | async fn rec_2() {
| ^ recursive `async fn`
|
= note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`.
= note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`

error: aborting due to 2 previous errors

Expand Down
Expand Up @@ -4,7 +4,7 @@ error[E0733]: recursion in an `async fn` requires boxing
LL | async fn recursive_async_function() -> () {
| ^^ recursive `async fn`
|
= note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`.
= note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/miri_unleashed/mutable_const2.stderr
Expand Up @@ -11,7 +11,7 @@ LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *m
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:346:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

Expand Down
Expand Up @@ -7,7 +7,7 @@ LL | x: &UnsafeCell::new(42),
thread 'rustc' panicked at 'assertion failed: `(left != right)`
left: `Const`,
right: `Const`: UnsafeCells are not allowed behind references in constants. This should have been prevented statically by const qualification. If this were allowed one would be able to change a constant at one use site and other use sites could observe that mutation.', src/librustc_mir/interpret/intern.rs:LL:CC
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/duplicate_entry_error.rs
Expand Up @@ -8,7 +8,7 @@ use std::panic::PanicInfo;

#[lang = "panic_impl"]
fn panic_impl(info: &PanicInfo) -> ! {
//~^ ERROR: duplicate lang item found: `panic_impl`.
//~^ ERROR: found duplicate lang item `panic_impl`
loop {}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/duplicate_entry_error.stderr
@@ -1,4 +1,4 @@
error[E0152]: duplicate lang item found: `panic_impl`.
error[E0152]: found duplicate lang item `panic_impl`
--> $DIR/duplicate_entry_error.rs:10:1
|
LL | / fn panic_impl(info: &PanicInfo) -> ! {
Expand All @@ -7,7 +7,7 @@ LL | | loop {}
LL | | }
| |_^
|
= note: first defined in crate `std` (which `duplicate_entry_error` depends on).
= note: first defined in crate `std` (which `duplicate_entry_error` depends on)

error: aborting due to previous error

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/error-codes/E0152.stderr
@@ -1,10 +1,10 @@
error[E0152]: duplicate lang item found: `arc`.
error[E0152]: found duplicate lang item `arc`
--> $DIR/E0152.rs:4:1
|
LL | struct Foo;
| ^^^^^^^^^^^
|
= note: first defined in crate `alloc` (which `std` depends on).
= note: first defined in crate `alloc` (which `std` depends on)

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/keyword/keyword-super-as-identifier.rs
@@ -1,3 +1,3 @@
fn main() {
let super = 22; //~ ERROR failed to resolve: there are too many initial `super`s
let super = 22; //~ ERROR failed to resolve: there are too many leading `super` keywords
}
4 changes: 2 additions & 2 deletions src/test/ui/keyword/keyword-super-as-identifier.stderr
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: there are too many initial `super`s.
error[E0433]: failed to resolve: there are too many leading `super` keywords
--> $DIR/keyword-super-as-identifier.rs:2:9
|
LL | let super = 22;
| ^^^^^ there are too many initial `super`s.
| ^^^^^ there are too many leading `super` keywords

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/keyword/keyword-super.rs
@@ -1,3 +1,3 @@
fn main() {
let super: isize; //~ ERROR failed to resolve: there are too many initial `super`s
let super: isize; //~ ERROR failed to resolve: there are too many leading `super` keywords
}
4 changes: 2 additions & 2 deletions src/test/ui/keyword/keyword-super.stderr
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: there are too many initial `super`s.
error[E0433]: failed to resolve: there are too many leading `super` keywords
--> $DIR/keyword-super.rs:2:9
|
LL | let super: isize;
| ^^^^^ there are too many initial `super`s.
| ^^^^^ there are too many leading `super` keywords

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/multi-panic.rs
Expand Up @@ -10,7 +10,7 @@ fn check_for_no_backtrace(test: std::process::Output) {

assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked at")), Some(true));
assert_eq!(it.next(), Some("note: run with `RUST_BACKTRACE=1` \
environment variable to display a backtrace."));
environment variable to display a backtrace"));
assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true));
assert_eq!(it.next(), None);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/panic-handler/panic-handler-duplicate.rs
Expand Up @@ -12,6 +12,6 @@ fn panic(info: &PanicInfo) -> ! {
}

#[lang = "panic_impl"]
fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`.
fn panic2(info: &PanicInfo) -> ! { //~ ERROR found duplicate lang item `panic_impl`
loop {}
}
4 changes: 2 additions & 2 deletions src/test/ui/panic-handler/panic-handler-duplicate.stderr
@@ -1,12 +1,12 @@
error[E0152]: duplicate lang item found: `panic_impl`.
error[E0152]: found duplicate lang item `panic_impl`
--> $DIR/panic-handler-duplicate.rs:15:1
|
LL | / fn panic2(info: &PanicInfo) -> ! {
LL | | loop {}
LL | | }
| |_^
|
note: first defined here.
note: first defined here
--> $DIR/panic-handler-duplicate.rs:10:1
|
LL | / fn panic(info: &PanicInfo) -> ! {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/panic-handler/panic-handler-std.rs
@@ -1,4 +1,4 @@
// error-pattern: duplicate lang item found: `panic_impl`.
// error-pattern: found duplicate lang item `panic_impl`


use std::panic::PanicInfo;
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/panic-handler/panic-handler-std.stderr
@@ -1,12 +1,12 @@
error[E0152]: duplicate lang item found: `panic_impl`.
error[E0152]: found duplicate lang item `panic_impl`
--> $DIR/panic-handler-std.rs:7:1
|
LL | / fn panic(info: PanicInfo) -> ! {
LL | | loop {}
LL | | }
| |_^
|
= note: first defined in crate `std` (which `panic_handler_std` depends on).
= note: first defined in crate `std` (which `panic_handler_std` depends on)

error: argument should be `&PanicInfo`
--> $DIR/panic-handler-std.rs:7:16
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/pattern/const-pat-ice.stderr
@@ -1,5 +1,5 @@
thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', src/librustc_mir_build/hair/pattern/_match.rs:LL:CC
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/resolve/impl-items-vis-unresolved.rs
Expand Up @@ -18,7 +18,7 @@ mod state {
pub struct RawFloatState;
impl RawFloatState {
perftools_inline! {
pub(super) fn new() {} //~ ERROR failed to resolve: there are too many initial `super`s
pub(super) fn new() {} //~ ERROR failed to resolve: there are too many leading `super` keywords
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/resolve/impl-items-vis-unresolved.stderr
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: there are too many initial `super`s.
error[E0433]: failed to resolve: there are too many leading `super` keywords
--> $DIR/impl-items-vis-unresolved.rs:21:13
|
LL | pub(super) fn new() {}
| ^^^^^ there are too many initial `super`s.
| ^^^^^ there are too many leading `super` keywords.

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/super-at-top-level.rs
@@ -1,4 +1,4 @@
use super::f; //~ ERROR there are too many initial `super`s
use super::f; //~ ERROR there are too many leading `super` keywords

fn main() {
}
4 changes: 2 additions & 2 deletions src/test/ui/super-at-top-level.stderr
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: there are too many initial `super`s.
error[E0433]: failed to resolve: there are too many leading `super` keywords
--> $DIR/super-at-top-level.rs:1:5
|
LL | use super::f;
| ^^^^^ there are too many initial `super`s.
| ^^^^^ there are too many leading `super` keywords

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/test-panic-abort.run.stdout
Expand Up @@ -18,7 +18,7 @@ testing321
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `2`,
right: `5`', $DIR/test-panic-abort.rs:31:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
Expand Down

0 comments on commit 8461fa5

Please sign in to comment.