Reduce vebosity of E0599

This commit is contained in:
Esteban Küber 2020-02-17 23:59:21 -08:00
parent f037d5ca1b
commit 5e8707f39d
14 changed files with 20 additions and 62 deletions

View File

@ -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);
});
}
}

View File

@ -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);
}

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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`

View File

@ -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};

View File

@ -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

View File

@ -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`

View File

@ -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 {

View File

@ -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`

View File

@ -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,

View File

@ -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`