Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #60090

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cc2689a
implement nth_back for Bytes
koalatux Apr 16, 2019
fae2a68
implement nth_back for Fuse
koalatux Apr 16, 2019
2605537
implement nth_back for Enumerate
koalatux Apr 16, 2019
ca19ffe
Update rustfmt to 1.2.1
topecongiro Apr 17, 2019
365a48a
whitelist rtm x86 cpu feature
mtak- Apr 17, 2019
007b40b
Point at try `?` on errors affecting the err match arm of the desugar…
estebank Apr 18, 2019
1e99b2e
Give custom error for E0277 on `?` error case
estebank Apr 18, 2019
379c541
Simplify the returning of a Result a bit
janhohenheim Apr 17, 2019
553ec5d
Update run-make PGO test to new commandline syntax.
michaelwoerister Apr 17, 2019
4269be3
Prefix PROFILER_SUPPORT and SANITIZER_SUPPORT test env vars with RUST…
michaelwoerister Apr 18, 2019
227be65
compiletest: Allow for tests requiring profiler-rt or sanitizer-rt su…
michaelwoerister Apr 18, 2019
e2acaee
Add codegen test that makes sure PGO instrumentation is emitted as ex…
michaelwoerister Apr 16, 2019
d98afc5
Fix small errors in docs for `rchunks_exact` and `rchunks_exact_mut`.
nathankleyn Apr 18, 2019
cc77087
Use new `needs-(profiler|sanitizer)-support` compiletest directive to…
michaelwoerister Apr 18, 2019
08efbac
Implement event filtering for self-profiler.
michaelwoerister Apr 12, 2019
ae1f2b5
Update miri
TimDiekmann Apr 18, 2019
b6f148c
hide `--explain` hint if error has no extended info
euclio Apr 17, 2019
a4a544e
Rollup merge of #59915 - michaelwoerister:sp-event-filters-1, r=wesle…
Centril Apr 18, 2019
28cf45f
Rollup merge of #60023 - koalatux:nth-back, r=scottmcm
Centril Apr 18, 2019
69093c1
Rollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichton
Centril Apr 18, 2019
b13cf83
Rollup merge of #60041 - jnferner:patch-1, r=shepmaster
Centril Apr 18, 2019
72494e8
Rollup merge of #60046 - euclio:missing-error-code-descriptions, r=es…
Centril Apr 18, 2019
ebec567
Rollup merge of #60056 - topecongiro:rustfmt-1.2.1, r=alexcrichton
Centril Apr 18, 2019
7dc08c0
Rollup merge of #60060 - mtak-:rtm-x86-feature, r=petrochenkov
Centril Apr 18, 2019
c6732f0
Rollup merge of #60064 - estebank:issue-59980, r=varkor
Centril Apr 18, 2019
d482e1d
Rollup merge of #60080 - nathankleyn:fix-issue-60068, r=Centril
Centril Apr 18, 2019
8ddc493
Rollup merge of #60082 - TimDiekmann:master, r=RalfJung
Centril Apr 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 14 additions & 10 deletions src/librustc_errors/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub use emitter::ColorConfig;
use Level::*;

use emitter::{Emitter, EmitterWriter};
use registry::Registry;

use rustc_data_structures::sync::{self, Lrc, Lock, AtomicUsize, AtomicBool, SeqCst};
use rustc_data_structures::fx::FxHashSet;
Expand Down Expand Up @@ -651,7 +652,7 @@ impl Handler {
self.err_count() > 0
}

pub fn print_error_count(&self) {
pub fn print_error_count(&self, registry: &Registry) {
let s = match self.err_count() {
0 => return,
1 => "aborting due to previous error".to_string(),
Expand All @@ -666,19 +667,22 @@ impl Handler {
let can_show_explain = self.emitter.borrow().should_show_explain();
let are_there_diagnostics = !self.emitted_diagnostic_codes.borrow().is_empty();
if can_show_explain && are_there_diagnostics {
let mut error_codes =
self.emitted_diagnostic_codes.borrow()
.iter()
.filter_map(|x| match *x {
DiagnosticId::Error(ref s) => Some(s.clone()),
_ => None,
})
.collect::<Vec<_>>();
let mut error_codes = self
.emitted_diagnostic_codes
.borrow()
.iter()
.filter_map(|x| match &x {
DiagnosticId::Error(s) if registry.find_description(s).is_some() => {
Some(s.clone())
}
_ => None,
})
.collect::<Vec<_>>();
if !error_codes.is_empty() {
error_codes.sort();
if error_codes.len() > 1 {
let limit = if error_codes.len() > 9 { 9 } else { error_codes.len() };
self.failure(&format!("Some errors occurred: {}{}",
self.failure(&format!("Some errors have detailed explanations: {}{}",
error_codes[..limit].join(", "),
if error_codes.len() > 9 { "..." } else { "." }));
self.failure(&format!("For more information about an error, try \
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_interface/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ where
crate_name: config.crate_name,
};

let _sess_abort_error = OnDrop(|| compiler.sess.diagnostic().print_error_count());
let _sess_abort_error = OnDrop(|| {
compiler.sess.diagnostic().print_error_count(&util::diagnostics_registry());
});

if compiler.sess.profile_queries() {
profile::begin(&compiler.sess);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/hash-stable-is-unstable.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ LL | #[derive(HashStable)]

error: aborting due to 6 previous errors

Some errors occurred: E0601, E0658.
Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.
1 change: 0 additions & 1 deletion src/test/ui-fulldeps/macro-crate-rlib.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | #![plugin(rlib_crate_test)]

error: aborting due to previous error

For more information about this error, try `rustc --explain E0457`.
1 change: 0 additions & 1 deletion src/test/ui/E0594.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | NUM = 20;

error: aborting due to previous error

For more information about this error, try `rustc --explain E0594`.
1 change: 0 additions & 1 deletion src/test/ui/E0594.ast.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | NUM = 20;

error: aborting due to previous error

For more information about this error, try `rustc --explain E0594`.
1 change: 0 additions & 1 deletion src/test/ui/E0594.mir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | NUM = 20;

error: aborting due to previous error

For more information about this error, try `rustc --explain E0594`.
1 change: 0 additions & 1 deletion src/test/ui/E0660.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ LL | asm!("nop" "nop" : "=r"(a));

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0660`.
1 change: 0 additions & 1 deletion src/test/ui/E0661.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | asm!("nop" : "r"(a));

error: aborting due to previous error

For more information about this error, try `rustc --explain E0661`.
1 change: 0 additions & 1 deletion src/test/ui/E0662.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | : "=test"("a")

error: aborting due to previous error

For more information about this error, try `rustc --explain E0662`.
1 change: 0 additions & 1 deletion src/test/ui/E0663.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | : "+test"("a")

error: aborting due to previous error

For more information about this error, try `rustc --explain E0663`.
1 change: 0 additions & 1 deletion src/test/ui/E0664.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | : "{eax}"

error: aborting due to previous error

For more information about this error, try `rustc --explain E0664`.
1 change: 0 additions & 1 deletion src/test/ui/E0665.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | #[derive(Default)]

error: aborting due to previous error

For more information about this error, try `rustc --explain E0665`.
1 change: 0 additions & 1 deletion src/test/ui/anonymous-higher-ranked-lifetime.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,3 @@ LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &()

error: aborting due to 22 previous errors

For more information about this error, try `rustc --explain E0631`.
1 change: 0 additions & 1 deletion src/test/ui/asm/asm-bad-clobber.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | asm!("xor %eax, %eax" : : : "{eax}");

error: aborting due to previous error

For more information about this error, try `rustc --explain E0664`.
2 changes: 0 additions & 2 deletions src/test/ui/asm/asm-in-bad-modifier.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ LL | asm!("mov $1, $0" : "=r"(y) : "+r"(5));

error: aborting due to 2 previous errors

Some errors occurred: E0662, E0663.
For more information about an error, try `rustc --explain E0662`.
1 change: 0 additions & 1 deletion src/test/ui/asm/asm-out-no-modifier.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | asm!("mov $1, $0" : "r"(x) : "r"(5));

error: aborting due to previous error

For more information about this error, try `rustc --explain E0661`.
2 changes: 1 addition & 1 deletion src/test/ui/associated-path-shl.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ LL | let 0 ..= <<A>::B>::C;

error: aborting due to 6 previous errors

Some errors occurred: E0029, E0412.
Some errors have detailed explanations: E0029, E0412.
For more information about an error, try `rustc --explain E0029`.
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ LL | fn paint<C:BoxCar>(c: C, d: C::Color) {

error: aborting due to 4 previous errors

Some errors occurred: E0191, E0221.
Some errors have detailed explanations: E0191, E0221.
For more information about an error, try `rustc --explain E0191`.
2 changes: 1 addition & 1 deletion src/test/ui/associated-types/associated-types-eq-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ LL | baz(&a);

error: aborting due to 3 previous errors

Some errors occurred: E0271, E0308.
Some errors have detailed explanations: E0271, E0308.
For more information about an error, try `rustc --explain E0271`.
2 changes: 1 addition & 1 deletion src/test/ui/associated-types/associated-types-eq-hr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ LL | | }

error: aborting due to 7 previous errors

Some errors occurred: E0271, E0277.
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ LL | trait Foo: Iterator<Item = i32> {}

error: aborting due to previous error

For more information about this error, try `rustc --explain E0284`.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ LL | pub fn f2<T: Foo + Bar>(a: T, x: T::A) {}

error: aborting due to 2 previous errors

Some errors occurred: E0220, E0221.
Some errors have detailed explanations: E0220, E0221.
For more information about an error, try `rustc --explain E0220`.
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ LL | let _: i32 = f2(2i32);

error: aborting due to 6 previous errors

Some errors occurred: E0277, E0308.
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ LL | let z: I::A = if cond { x } else { y };

error: aborting due to previous error

For more information about this error, try `rustc --explain E0623`.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | x: I::A)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0212`.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | field: I::A

error: aborting due to previous error

For more information about this error, try `rustc --explain E0212`.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | fn some_method(&self, arg: I::A);

error: aborting due to previous error

For more information about this error, try `rustc --explain E0212`.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ LL | let _c: <T as Trait<'a>>::Type = b;

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0623`.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | let x: isize = Foo::bar();

error: aborting due to previous error

For more information about this error, try `rustc --explain E0284`.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ LL | (a, b)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0623`.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ LL | bar(foo, x)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0495`.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ LL | let b = bar(foo, x);

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0623`.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ LL | let b = bar(f, y);

error: aborting due to previous error

For more information about this error, try `rustc --explain E0623`.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {

error: aborting due to previous error

For more information about this error, try `rustc --explain E0495`.
2 changes: 1 addition & 1 deletion src/test/ui/augmented-assignments.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ LL | y

error: aborting due to 2 previous errors

Some errors occurred: E0505, E0596.
Some errors have detailed explanations: E0505, E0596.
For more information about an error, try `rustc --explain E0505`.
2 changes: 1 addition & 1 deletion src/test/ui/augmented-assignments.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ LL | x;

error: aborting due to 2 previous errors

Some errors occurred: E0382, E0596.
Some errors have detailed explanations: E0382, E0596.
For more information about an error, try `rustc --explain E0382`.
3 changes: 1 addition & 2 deletions src/test/ui/auto-trait-validation.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ LL | auto trait MyTrait { fn foo() {} }

error: aborting due to 3 previous errors

Some errors occurred: E0380, E0567, E0568.
For more information about an error, try `rustc --explain E0380`.
For more information about this error, try `rustc --explain E0380`.
1 change: 0 additions & 1 deletion src/test/ui/await-keyword/2018-edition-error.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ LL | match await { await => () }

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0721`.
1 change: 0 additions & 1 deletion src/test/ui/await-keyword/post_expansion_error.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ LL | await!()

error: aborting due to previous error

For more information about this error, try `rustc --explain E0721`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-env-capture.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ LL | fn bar() { log(debug, x); }

error: aborting due to 3 previous errors

Some errors occurred: E0425, E0434.
Some errors have detailed explanations: E0425, E0434.
For more information about an error, try `rustc --explain E0425`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-env-capture2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ LL | fn bar() { log(debug, x); }

error: aborting due to 3 previous errors

Some errors occurred: E0425, E0434.
Some errors have detailed explanations: E0425, E0434.
For more information about an error, try `rustc --explain E0425`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-env-capture3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ LL | fn bar() { log(debug, x); }

error: aborting due to 3 previous errors

Some errors occurred: E0425, E0434.
Some errors have detailed explanations: E0425, E0434.
For more information about an error, try `rustc --explain E0425`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-expr-lhs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ LL | None = Some(3);

error: aborting due to 5 previous errors

Some errors occurred: E0067, E0070.
Some errors have detailed explanations: E0067, E0070.
For more information about an error, try `rustc --explain E0067`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-expr-path.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ LL | fn main(arguments: Vec<String>) {

error: aborting due to 4 previous errors

Some errors occurred: E0425, E0580.
Some errors have detailed explanations: E0425, E0580.
For more information about an error, try `rustc --explain E0425`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-expr-path2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ LL | fn main(arguments: Vec<String>) {

error: aborting due to 4 previous errors

Some errors occurred: E0423, E0425, E0580.
Some errors have detailed explanations: E0423, E0425, E0580.
For more information about an error, try `rustc --explain E0423`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-extern-link-attrs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ LL | #[link(name = "foo", kind = "bar")]

error: aborting due to 3 previous errors

Some errors occurred: E0454, E0458, E0459.
Some errors have detailed explanations: E0454, E0458, E0459.
For more information about an error, try `rustc --explain E0454`.
1 change: 0 additions & 1 deletion src/test/ui/bad/bad-intrinsic-monomorphization.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ LL | simd_add(a, b)

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0511`.
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-sized.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ LL | let x: Vec<Trait + Sized> = Vec::new();

error: aborting due to 3 previous errors

Some errors occurred: E0225, E0277.
Some errors have detailed explanations: E0225, E0277.
For more information about an error, try `rustc --explain E0225`.
2 changes: 1 addition & 1 deletion src/test/ui/binop/binop-move-semantics.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ LL | | &mut f;

error: aborting due to 8 previous errors

Some errors occurred: E0382, E0502, E0505, E0507.
Some errors have detailed explanations: E0382, E0502, E0505, E0507.
For more information about an error, try `rustc --explain E0382`.
2 changes: 1 addition & 1 deletion src/test/ui/binop/binop-move-semantics.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ LL | &mut f;

error: aborting due to 8 previous errors

Some errors occurred: E0382, E0502, E0505, E0507.
Some errors have detailed explanations: E0382, E0502, E0505, E0507.
For more information about an error, try `rustc --explain E0382`.
2 changes: 1 addition & 1 deletion src/test/ui/block-result/issue-20862.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ LL | let x = foo(5)(2);

error: aborting due to 2 previous errors

Some errors occurred: E0308, E0618.
Some errors have detailed explanations: E0308, E0618.
For more information about an error, try `rustc --explain E0308`.
2 changes: 1 addition & 1 deletion src/test/ui/block-result/issue-22645.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ LL | b + 3

error: aborting due to 2 previous errors

Some errors occurred: E0277, E0308.
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@ LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); })

error: aborting due to 6 previous errors

Some errors occurred: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.
For more information about this error, try `rustc --explain E0596`.
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); })

error: aborting due to 6 previous errors

Some errors occurred: E0387, E0594, E0596.
Some errors have detailed explanations: E0387, E0596.
For more information about an error, try `rustc --explain E0387`.
2 changes: 1 addition & 1 deletion src/test/ui/borrowck/borrow-tuple-fields.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ LL | a.use_mut();

error: aborting due to 6 previous errors

Some errors occurred: E0499, E0502, E0505.
Some errors have detailed explanations: E0499, E0502, E0505.
For more information about an error, try `rustc --explain E0499`.
2 changes: 1 addition & 1 deletion src/test/ui/borrowck/borrow-tuple-fields.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ LL | }

error: aborting due to 6 previous errors

Some errors occurred: E0499, E0502, E0505.
Some errors have detailed explanations: E0499, E0502, E0505.
For more information about an error, try `rustc --explain E0499`.
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ LL | let _y = &mut *foo_ref.f;

error: aborting due to 6 previous errors

Some errors occurred: E0389, E0596.
Some errors have detailed explanations: E0389, E0596.
For more information about an error, try `rustc --explain E0389`.
Loading