about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-08-03 06:42:19 +0000
committerMichael Goulet <michael@errs.io>2022-08-03 06:51:26 +0000
commit4df6cbe96fe3e356aff89155f58a497d48bc78ee (patch)
treed1f0294014cb75cb19b560cb062833db9b7b37e0 /src/test/ui
parent9cf570995cded5e224d5dba8296a85fdbe1c6918 (diff)
downloadrust-4df6cbe96fe3e356aff89155f58a497d48bc78ee.tar.gz
rust-4df6cbe96fe3e356aff89155f58a497d48bc78ee.zip
Consider privacy more carefully when suggesting accessing fields
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/issues/issue-31173.stderr4
-rw-r--r--src/test/ui/issues/issue-39175.stderr4
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.stderr4
-rw-r--r--src/test/ui/suggestions/import-trait-for-method-call.stderr4
-rw-r--r--src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr10
-rw-r--r--src/test/ui/suggestions/suggest-using-chars.stderr8
-rw-r--r--src/test/ui/unique-object-noncopyable.stderr8
-rw-r--r--src/test/ui/unique-pinned-nocopy.stderr8
8 files changed, 0 insertions, 50 deletions
diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr
index e8797ea7b5b..68337a715e1 100644
--- a/src/test/ui/issues/issue-31173.stderr
+++ b/src/test/ui/issues/issue-31173.stderr
@@ -33,10 +33,6 @@ LL | pub struct TakeWhile<I, P> {
            which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
            `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
            which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
-help: one of the expressions' fields has a method of the same name
-   |
-LL |         .it.collect();
-   |          +++
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/issues/issue-39175.stderr b/src/test/ui/issues/issue-39175.stderr
index b19f58d2a38..afceae82e68 100644
--- a/src/test/ui/issues/issue-39175.stderr
+++ b/src/test/ui/issues/issue-39175.stderr
@@ -5,10 +5,6 @@ LL |     Command::new("echo").arg("hello").exec();
    |                                       ^^^^ method not found in `&mut Command`
    |
    = help: items from traits can only be used if the trait is in scope
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     Command::new("echo").arg("hello").inner.exec();
-   |                                       ++++++
 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
 LL | use std::os::unix::process::CommandExt;
diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr
index c3c8e5f272e..b11ea97d160 100644
--- a/src/test/ui/mismatched_types/issue-36053-2.stderr
+++ b/src/test/ui/mismatched_types/issue-36053-2.stderr
@@ -35,10 +35,6 @@ LL | pub struct Filter<I, P> {
            which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
            `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
            which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     once::<&str>("str").fuse().filter(|a: &str| true).iter.count();
-   |                                                       +++++
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/suggestions/import-trait-for-method-call.stderr b/src/test/ui/suggestions/import-trait-for-method-call.stderr
index f220458f321..bac8de79872 100644
--- a/src/test/ui/suggestions/import-trait-for-method-call.stderr
+++ b/src/test/ui/suggestions/import-trait-for-method-call.stderr
@@ -10,10 +10,6 @@ LL |     fn finish(&self) -> u64;
    |        ------ the method is available for `DefaultHasher` here
    |
    = help: items from traits can only be used if the trait is in scope
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     h.0.finish()
-   |       ++
 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
 LL | use std::hash::Hasher;
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 e19bc5a1fd4..d121932c842 100644
--- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
+++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
@@ -41,16 +41,6 @@ LL | pub struct BufWriter<W: Write> {
            `&dyn std::io::Write: std::io::Write`
            which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
    = note: this error originates in the macro `writeln` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: one of the expressions' fields has a method of the same name
-  --> $SRC_DIR/core/src/macros/mod.rs:LL:COL
-   |
-LL |         $dst.inner.write_fmt($crate::format_args_nl!($($arg)*))
-   |              ++++++
-help: one of the expressions' fields has a method of the same name
-  --> $SRC_DIR/core/src/macros/mod.rs:LL:COL
-   |
-LL |         $dst.buf.write_fmt($crate::format_args_nl!($($arg)*))
-   |              ++++
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/suggestions/suggest-using-chars.stderr b/src/test/ui/suggestions/suggest-using-chars.stderr
index 1690309719f..99bcfb08a08 100644
--- a/src/test/ui/suggestions/suggest-using-chars.stderr
+++ b/src/test/ui/suggestions/suggest-using-chars.stderr
@@ -25,10 +25,6 @@ help: because of the in-memory representation of `&str`, to obtain an `Iterator`
    |
 LL |     let _ = String::from("bar").chars();
    |                                 ~~~~~
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let _ = String::from("bar").vec.iter();
-   |                                 ++++
 
 error[E0599]: no method named `iter` found for reference `&String` in the current scope
   --> $DIR/suggest-using-chars.rs:5:36
@@ -40,10 +36,6 @@ help: because of the in-memory representation of `&str`, to obtain an `Iterator`
    |
 LL |     let _ = (&String::from("bar")).chars();
    |                                    ~~~~~
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let _ = (&String::from("bar")).vec.iter();
-   |                                    ++++
 
 error[E0599]: no method named `iter` found for type `{integer}` in the current scope
   --> $DIR/suggest-using-chars.rs:6:15
diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr
index 12917d54114..98a9bd07ed2 100644
--- a/src/test/ui/unique-object-noncopyable.stderr
+++ b/src/test/ui/unique-object-noncopyable.stderr
@@ -23,14 +23,6 @@ LL | | >(Unique<T>, A);
            which is required by `Box<dyn Foo>: Clone`
            `dyn Foo: Clone`
            which is required by `Box<dyn Foo>: Clone`
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let _z = y.0.clone();
-   |                ++
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let _z = y.1.clone();
-   |                ++
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr
index cc9bdd26e11..7af9c684b72 100644
--- a/src/test/ui/unique-pinned-nocopy.stderr
+++ b/src/test/ui/unique-pinned-nocopy.stderr
@@ -25,14 +25,6 @@ help: consider annotating `R` with `#[derive(Clone)]`
    |
 LL | #[derive(Clone)]
    |
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let _j = i.0.clone();
-   |                ++
-help: one of the expressions' fields has a method of the same name
-   |
-LL |     let _j = i.1.clone();
-   |                ++
 
 error: aborting due to previous error