diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-02-17 23:59:21 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-02-28 11:37:58 -0800 |
| commit | 5e8707f39d781df9cc40e81cd1ccdffcfbe5af1f (patch) | |
| tree | f1a828f7fc2f1f24f21347bc6f611d10e2a33418 /src | |
| parent | f037d5ca1bf42108520a1fd3b07c5cec46bc94da (diff) | |
| download | rust-5e8707f39d781df9cc40e81cd1ccdffcfbe5af1f.tar.gz rust-5e8707f39d781df9cc40e81cd1ccdffcfbe5af1f.zip | |
Reduce vebosity of E0599
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/check/method/probe.rs | 21 | ||||
| -rw-r--r-- | src/librustc_typeck/check/method/suggest.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/derives/derive-assoc-type-not-impl.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-21596.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-31173.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/methods/method-call-err-msg.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/mismatched_types/issue-36053-2.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/suggestions/mut-borrow-needed-by-trait.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/union/union-derive-clone.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/unique-object-noncopyable.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/unique-object-noncopyable.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/unique-pinned-nocopy.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/unique-pinned-nocopy.stderr | 8 |
14 files changed, 20 insertions, 62 deletions
diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 0d6f8e9b7e6..1bf173e3b13 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -1426,17 +1426,18 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { } } } - _ => {} + _ => { + // Some nested subobligation of this predicate + // failed. + // + // FIXME: try to find the exact nested subobligation + // and point at it rather than reporting the entire + // trait-ref? + result = ProbeResult::NoMatch; + let trait_ref = self.resolve_vars_if_possible(&trait_ref); + possibly_unsatisfied_predicates.push(trait_ref); + } } - // Some nested subobligation of this predicate - // failed. - // - // FIXME: try to find the exact nested subobligation - // and point at it rather than reporting the entire - // trait-ref? - result = ProbeResult::NoMatch; - let trait_ref = self.resolve_vars_if_possible(&trait_ref); - possibly_unsatisfied_predicates.push(trait_ref); }); } } diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index bd87626b438..c6c404c5c78 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -394,7 +394,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { tcx.sess.diagnostic().struct_dummy() }; - // FIXME: Unify with unmet bound label. if let Some(def) = actual.ty_adt_def() { if let Some(full_sp) = tcx.hir().span_if_local(def.did) { let def_sp = tcx.sess.source_map().def_span(full_sp); @@ -576,7 +575,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { bound_list.sort(); bound_list.dedup(); // #35677 bound_spans.sort(); - bound_spans.dedup(); // #35677 + bound_spans.dedup(); for (span, msg) in bound_spans.into_iter() { err.span_label(span, &msg); } diff --git a/src/test/ui/derives/derive-assoc-type-not-impl.stderr b/src/test/ui/derives/derive-assoc-type-not-impl.stderr index 2746d8b7a14..0b55b3f2ec9 100644 --- a/src/test/ui/derives/derive-assoc-type-not-impl.stderr +++ b/src/test/ui/derives/derive-assoc-type-not-impl.stderr @@ -2,10 +2,7 @@ error[E0599]: no method named `clone` found for struct `Bar<NotClone>` in the cu --> $DIR/derive-assoc-type-not-impl.rs:18:30 | LL | struct Bar<T: Foo> { - | ------------------ - | | - | method `clone` not found for this - | this type doesn't satisfy the bound `std::clone::Clone` + | ------------------ method `clone` not found for this ... LL | struct NotClone; | ---------------- this type doesn't satisfy the bound `std::clone::Clone` @@ -14,7 +11,6 @@ LL | Bar::<NotClone> { x: 1 }.clone(); | ^^^^^ method not found in `Bar<NotClone>` | = note: the method `clone` exists but the following trait bounds were not satisfied: - `Bar<NotClone>: std::clone::Clone` `NotClone: std::clone::Clone` = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: diff --git a/src/test/ui/issues/issue-21596.stderr b/src/test/ui/issues/issue-21596.stderr index d98302552ca..10b634b4603 100644 --- a/src/test/ui/issues/issue-21596.stderr +++ b/src/test/ui/issues/issue-21596.stderr @@ -8,7 +8,6 @@ LL | println!("{}", z.to_string()); = note: using `<*const T>::as_ref()` on a pointer which is unaligned or points to invalid or uninitialized memory is undefined behavior = note: the method `to_string` exists but the following trait bounds were not satisfied: `*const u8: std::fmt::Display` - `*const u8: std::string::ToString` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 77cb7fb0426..28b3b872220 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -19,7 +19,6 @@ LL | pub struct Cloned<I> { | -------------------- this type doesn't satisfy the bound `std::iter::Iterator` | = note: the method `collect` exists but the following trait bounds were not satisfied: - `&mut std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator` `std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator` error: aborting due to 2 previous errors diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr index 0c48e93347d..2b683f8aa2a 100644 --- a/src/test/ui/methods/method-call-err-msg.stderr +++ b/src/test/ui/methods/method-call-err-msg.stderr @@ -44,7 +44,6 @@ LL | .take() | ^^^^ method not found in `Foo` | = note: the method `take` exists but the following trait bounds were not satisfied: - `&mut Foo: std::iter::Iterator` `Foo: std::iter::Iterator` = help: items from traits can only be used if the trait is implemented and in scope = note: the following traits define an item `take`, perhaps you need to implement one of them: diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index 2b8b2d82ec2..98d71b460db 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -10,7 +10,6 @@ LL | pub struct Filter<I, P> { | ----------------------- this type doesn't satisfy the bound `std::iter::Iterator` | = note: the method `count` exists but the following trait bounds were not satisfied: - `&mut std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator` `[closure@$DIR/issue-36053-2.rs:11:39: 11:53]: std::ops::FnMut<(&_,)>` `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator` diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.rs b/src/test/ui/suggestions/mut-borrow-needed-by-trait.rs index 49a37498fd9..f8b86377187 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.rs +++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.rs @@ -1,7 +1,3 @@ -// FIXME: missing sysroot spans (#53081) -// ignore-i586-unknown-linux-gnu -// ignore-i586-unknown-linux-musl -// ignore-i686-unknown-linux-musl use std::env::args; use std::fs::File; use std::io::{stdout, Write, BufWriter}; diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr index 5de7295f4f4..3a9fddc474a 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr +++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied - --> $DIR/mut-borrow-needed-by-trait.rs:21:29 + --> $DIR/mut-borrow-needed-by-trait.rs:17:29 | LL | let fp = BufWriter::new(fp); | ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write` @@ -8,7 +8,7 @@ LL | let fp = BufWriter::new(fp); = note: required by `std::io::BufWriter::<W>::new` error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied - --> $DIR/mut-borrow-needed-by-trait.rs:21:14 + --> $DIR/mut-borrow-needed-by-trait.rs:17:14 | LL | let fp = BufWriter::new(fp); | ^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write` @@ -17,7 +17,7 @@ LL | let fp = BufWriter::new(fp); = note: required by `std::io::BufWriter` error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied - --> $DIR/mut-borrow-needed-by-trait.rs:21:14 + --> $DIR/mut-borrow-needed-by-trait.rs:17:14 | LL | let fp = BufWriter::new(fp); | ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write` @@ -26,19 +26,13 @@ LL | let fp = BufWriter::new(fp); = note: required by `std::io::BufWriter` error[E0599]: no method named `write_fmt` found for struct `std::io::BufWriter<&dyn std::io::Write>` in the current scope - --> $DIR/mut-borrow-needed-by-trait.rs:26:5 + --> $DIR/mut-borrow-needed-by-trait.rs:22:5 | LL | writeln!(fp, "hello world").unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `std::io::BufWriter<&dyn std::io::Write>` - | - ::: $SRC_DIR/libstd/io/buffered.rs:LL:COL - | -LL | pub struct BufWriter<W: Write> { - | ------------------------------ this type doesn't satisfy the bound `std::io::Write` | = note: the method `write_fmt` exists but the following trait bounds were not satisfied: `&dyn std::io::Write: std::io::Write` - `std::io::BufWriter<&dyn std::io::Write>: std::io::Write` = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/union/union-derive-clone.stderr b/src/test/ui/union/union-derive-clone.stderr index 289b680a46e..c8537afd3bd 100644 --- a/src/test/ui/union/union-derive-clone.stderr +++ b/src/test/ui/union/union-derive-clone.stderr @@ -11,10 +11,7 @@ error[E0599]: no method named `clone` found for union `U5<CloneNoCopy>` in the c --> $DIR/union-derive-clone.rs:37:15 | LL | union U5<T> { - | ----------- - | | - | method `clone` not found for this - | this type doesn't satisfy the bound `std::clone::Clone` + | ----------- method `clone` not found for this ... LL | struct CloneNoCopy; | ------------------- this type doesn't satisfy the bound `std::marker::Copy` @@ -24,7 +21,6 @@ LL | let w = u.clone(); | = note: the method `clone` exists but the following trait bounds were not satisfied: `CloneNoCopy: std::marker::Copy` - `U5<CloneNoCopy>: std::clone::Clone` = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: candidate #1: `std::clone::Clone` diff --git a/src/test/ui/unique-object-noncopyable.rs b/src/test/ui/unique-object-noncopyable.rs index bedaf27c2dd..dd38a7190aa 100644 --- a/src/test/ui/unique-object-noncopyable.rs +++ b/src/test/ui/unique-object-noncopyable.rs @@ -1,7 +1,3 @@ -// FIXME: missing sysroot spans (#53081) -// ignore-i586-unknown-linux-gnu -// ignore-i586-unknown-linux-musl -// ignore-i686-unknown-linux-musl #![feature(box_syntax)] trait Foo { diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr index 192558f6b09..1ada663129f 100644 --- a/src/test/ui/unique-object-noncopyable.stderr +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `clone` found for struct `std::boxed::Box<dyn Foo>` in the current scope - --> $DIR/unique-object-noncopyable.rs:28:16 + --> $DIR/unique-object-noncopyable.rs:24:16 | LL | trait Foo { | --------- @@ -9,16 +9,10 @@ LL | trait Foo { ... LL | let _z = y.clone(); | ^^^^^ method not found in `std::boxed::Box<dyn Foo>` - | - ::: $SRC_DIR/liballoc/boxed.rs:LL:COL - | -LL | pub struct Box<T: ?Sized>(Unique<T>); - | ------------------------------------- this type doesn't satisfy the bound `std::clone::Clone` | = note: the method `clone` exists but the following trait bounds were not satisfied: `dyn Foo: std::clone::Clone` `dyn Foo: std::marker::Sized` - `std::boxed::Box<dyn Foo>: std::clone::Clone` = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: candidate #1: `std::clone::Clone` diff --git a/src/test/ui/unique-pinned-nocopy.rs b/src/test/ui/unique-pinned-nocopy.rs index 091b8a43862..4c30450c704 100644 --- a/src/test/ui/unique-pinned-nocopy.rs +++ b/src/test/ui/unique-pinned-nocopy.rs @@ -1,7 +1,3 @@ -// FIXME: missing sysroot spans (#53081) -// ignore-i586-unknown-linux-gnu -// ignore-i586-unknown-linux-musl -// ignore-i686-unknown-linux-musl #[derive(Debug)] struct R { b: bool, diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr index 7c1bef07218..2557ea8acb8 100644 --- a/src/test/ui/unique-pinned-nocopy.stderr +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -1,20 +1,14 @@ error[E0599]: no method named `clone` found for struct `std::boxed::Box<R>` in the current scope - --> $DIR/unique-pinned-nocopy.rs:16:16 + --> $DIR/unique-pinned-nocopy.rs:12:16 | LL | struct R { | -------- this type doesn't satisfy the bound `std::clone::Clone` ... LL | let _j = i.clone(); | ^^^^^ method not found in `std::boxed::Box<R>` - | - ::: $SRC_DIR/liballoc/boxed.rs:LL:COL - | -LL | pub struct Box<T: ?Sized>(Unique<T>); - | ------------------------------------- this type doesn't satisfy the bound `std::clone::Clone` | = note: the method `clone` exists but the following trait bounds were not satisfied: `R: std::clone::Clone` - `std::boxed::Box<R>: std::clone::Clone` = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: candidate #1: `std::clone::Clone` |
