about summary refs log tree commit diff
path: root/src/test/ui/methods/issues
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/methods/issues
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/methods/issues')
-rw-r--r--src/test/ui/methods/issues/issue-105732.rs14
-rw-r--r--src/test/ui/methods/issues/issue-105732.stderr18
-rw-r--r--src/test/ui/methods/issues/issue-61525.rs20
-rw-r--r--src/test/ui/methods/issues/issue-61525.stderr39
-rw-r--r--src/test/ui/methods/issues/issue-84495.rs4
-rw-r--r--src/test/ui/methods/issues/issue-84495.stderr13
-rw-r--r--src/test/ui/methods/issues/issue-90315.rs75
-rw-r--r--src/test/ui/methods/issues/issue-90315.stderr190
-rw-r--r--src/test/ui/methods/issues/issue-94581.rs7
-rw-r--r--src/test/ui/methods/issues/issue-94581.stderr15
10 files changed, 0 insertions, 395 deletions
diff --git a/src/test/ui/methods/issues/issue-105732.rs b/src/test/ui/methods/issues/issue-105732.rs
deleted file mode 100644
index d7005065813..00000000000
--- a/src/test/ui/methods/issues/issue-105732.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#![feature(auto_traits)]
-
-auto trait Foo {
-    fn g(&self); //~ ERROR auto traits cannot have associated items
-}
-
-trait Bar {
-    fn f(&self) {
-        // issue #105788
-        self.g(); //~ ERROR no method named `g` found for reference `&Self` in the current scope
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/methods/issues/issue-105732.stderr b/src/test/ui/methods/issues/issue-105732.stderr
deleted file mode 100644
index 7696642548d..00000000000
--- a/src/test/ui/methods/issues/issue-105732.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0380]: auto traits cannot have associated items
-  --> $DIR/issue-105732.rs:4:8
-   |
-LL | auto trait Foo {
-   |            --- auto trait cannot have associated items
-LL |     fn g(&self);
-   |     ---^-------- help: remove these associated items
-
-error[E0599]: no method named `g` found for reference `&Self` in the current scope
-  --> $DIR/issue-105732.rs:10:14
-   |
-LL |         self.g();
-   |              ^ help: there is a method with a similar name: `f`
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0380, E0599.
-For more information about an error, try `rustc --explain E0380`.
diff --git a/src/test/ui/methods/issues/issue-61525.rs b/src/test/ui/methods/issues/issue-61525.rs
deleted file mode 100644
index c5ca0326e43..00000000000
--- a/src/test/ui/methods/issues/issue-61525.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-pub trait Example {
-    fn query<Q>(self, q: Q);
-}
-
-impl Example for i32 {
-    fn query<Q>(self, _: Q) {
-        unimplemented!()
-    }
-}
-
-mod nested {
-    use super::Example;
-    fn example() {
-        1.query::<dyn ToString>("")
-        //~^ ERROR the size for values of type `dyn ToString` cannot be known at compilation time
-        //~| ERROR mismatched types
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/methods/issues/issue-61525.stderr b/src/test/ui/methods/issues/issue-61525.stderr
deleted file mode 100644
index 3e73b950a14..00000000000
--- a/src/test/ui/methods/issues/issue-61525.stderr
+++ /dev/null
@@ -1,39 +0,0 @@
-error[E0277]: the size for values of type `dyn ToString` cannot be known at compilation time
-  --> $DIR/issue-61525.rs:14:33
-   |
-LL |         1.query::<dyn ToString>("")
-   |           -----                 ^^ doesn't have a size known at compile-time
-   |           |
-   |           required by a bound introduced by this call
-   |
-   = help: the trait `Sized` is not implemented for `dyn ToString`
-note: required by a bound in `Example::query`
-  --> $DIR/issue-61525.rs:2:14
-   |
-LL |     fn query<Q>(self, q: Q);
-   |              ^ required by this bound in `Example::query`
-help: consider relaxing the implicit `Sized` restriction
-   |
-LL |     fn query<Q: ?Sized>(self, q: Q);
-   |               ++++++++
-
-error[E0308]: mismatched types
-  --> $DIR/issue-61525.rs:14:33
-   |
-LL |         1.query::<dyn ToString>("")
-   |           --------------------- ^^ expected trait object `dyn ToString`, found `&str`
-   |           |
-   |           arguments to this method are incorrect
-   |
-   = note: expected trait object `dyn ToString`
-                 found reference `&'static str`
-note: associated function defined here
-  --> $DIR/issue-61525.rs:2:8
-   |
-LL |     fn query<Q>(self, q: Q);
-   |        ^^^^^
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0277, E0308.
-For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/methods/issues/issue-84495.rs b/src/test/ui/methods/issues/issue-84495.rs
deleted file mode 100644
index 28c094bf2ac..00000000000
--- a/src/test/ui/methods/issues/issue-84495.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-fn main() {
-    let x: i32 = 1;
-    println!("{:?}", x.count()); //~ ERROR is not an iterator
-}
diff --git a/src/test/ui/methods/issues/issue-84495.stderr b/src/test/ui/methods/issues/issue-84495.stderr
deleted file mode 100644
index b0217a7c844..00000000000
--- a/src/test/ui/methods/issues/issue-84495.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0599]: `i32` is not an iterator
-  --> $DIR/issue-84495.rs:3:24
-   |
-LL |     println!("{:?}", x.count());
-   |                        ^^^^^ `i32` is not an iterator
-   |
-   = note: the following trait bounds were not satisfied:
-           `i32: Iterator`
-           which is required by `&mut i32: Iterator`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/methods/issues/issue-90315.rs b/src/test/ui/methods/issues/issue-90315.rs
deleted file mode 100644
index fbecaf9b971..00000000000
--- a/src/test/ui/methods/issues/issue-90315.rs
+++ /dev/null
@@ -1,75 +0,0 @@
-#![allow(unused)]
-fn main() {
-    let arr = &[0, 1, 2, 3];
-    for _i in 0..arr.len().rev() {
-        //~^ ERROR can't call method
-        //~| surround the range in parentheses
-        // The above error used to say “the method `rev` exists for type `usize`”.
-        // This regression test ensures it doesn't say that any more.
-    }
-
-    // Test for #102396
-    for i in 1..11.rev() {
-        //~^ ERROR can't call method
-        //~| HELP surround the range in parentheses
-    }
-
-    let end: usize = 10;
-    for i in 1..end.rev() {
-        //~^ ERROR can't call method
-        //~| HELP surround the range in parentheses
-    }
-
-    for i in 1..(end + 1).rev() {
-        //~^ ERROR can't call method
-        //~| HELP surround the range in parentheses
-    }
-
-    if 1..(end + 1).is_empty() {
-        //~^ ERROR can't call method
-        //~| ERROR mismatched types [E0308]
-        //~| HELP surround the range in parentheses
-    }
-
-    if 1..(end + 1).is_sorted() {
-        //~^ ERROR mismatched types [E0308]
-        //~| ERROR can't call method
-        //~| HELP surround the range in parentheses
-    }
-
-    let _res: i32 = 3..6.take(2).sum();
-    //~^ ERROR can't call method
-    //~| ERROR mismatched types [E0308]
-    //~| HELP surround the range in parentheses
-
-    let _sum: i32 = 3..6.sum();
-    //~^ ERROR can't call method
-    //~| ERROR mismatched types [E0308]
-    //~| HELP surround the range in parentheses
-
-    let a = 1 as usize;
-    let b = 10 as usize;
-
-    for _a in a..=b.rev() {
-        //~^ ERROR can't call method
-        //~| HELP surround the range in parentheses
-    }
-
-    let _res = ..10.contains(3);
-    //~^ ERROR can't call method
-    //~| HELP surround the range in parentheses
-
-    if 1..end.error_method() {
-        //~^ ERROR no method named `error_method`
-        //~| ERROR mismatched types [E0308]
-        // Won't suggest
-    }
-
-    let _res = b.take(1)..a;
-    //~^ ERROR `usize` is not an iterator
-
-    let _res: i32 = ..6.take(2).sum();
-    //~^ ERROR can't call method `take` on ambiguous numeric type
-    //~| HELP you must specify a concrete type for this numeric value
-    // Won't suggest because `RangeTo` dest not implemented `take`
-}
diff --git a/src/test/ui/methods/issues/issue-90315.stderr b/src/test/ui/methods/issues/issue-90315.stderr
deleted file mode 100644
index 4d3c086ff6e..00000000000
--- a/src/test/ui/methods/issues/issue-90315.stderr
+++ /dev/null
@@ -1,190 +0,0 @@
-error[E0689]: can't call method `rev` on type `usize`
-  --> $DIR/issue-90315.rs:4:28
-   |
-LL |     for _i in 0..arr.len().rev() {
-   |                            ^^^ can't call method `rev` on type `usize`
-   |
-help: you must surround the range in parentheses to call its `rev` function
-   |
-LL |     for _i in (0..arr.len()).rev() {
-   |               +            +
-
-error[E0689]: can't call method `rev` on type `{integer}`
-  --> $DIR/issue-90315.rs:12:20
-   |
-LL |     for i in 1..11.rev() {
-   |                    ^^^ can't call method `rev` on type `{integer}`
-   |
-help: you must surround the range in parentheses to call its `rev` function
-   |
-LL |     for i in (1..11).rev() {
-   |              +     +
-
-error[E0689]: can't call method `rev` on type `usize`
-  --> $DIR/issue-90315.rs:18:21
-   |
-LL |     for i in 1..end.rev() {
-   |                     ^^^ can't call method `rev` on type `usize`
-   |
-help: you must surround the range in parentheses to call its `rev` function
-   |
-LL |     for i in (1..end).rev() {
-   |              +      +
-
-error[E0689]: can't call method `rev` on type `usize`
-  --> $DIR/issue-90315.rs:23:27
-   |
-LL |     for i in 1..(end + 1).rev() {
-   |                           ^^^ can't call method `rev` on type `usize`
-   |
-help: you must surround the range in parentheses to call its `rev` function
-   |
-LL |     for i in (1..(end + 1)).rev() {
-   |              +            +
-
-error[E0689]: can't call method `is_empty` on type `usize`
-  --> $DIR/issue-90315.rs:28:21
-   |
-LL |     if 1..(end + 1).is_empty() {
-   |                     ^^^^^^^^ can't call method `is_empty` on type `usize`
-   |
-help: you must surround the range in parentheses to call its `is_empty` function
-   |
-LL |     if (1..(end + 1)).is_empty() {
-   |        +            +
-
-error[E0308]: mismatched types
-  --> $DIR/issue-90315.rs:28:8
-   |
-LL |     if 1..(end + 1).is_empty() {
-   |        ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<{integer}>`
-
-error[E0689]: can't call method `is_sorted` on type `usize`
-  --> $DIR/issue-90315.rs:34:21
-   |
-LL |     if 1..(end + 1).is_sorted() {
-   |                     ^^^^^^^^^ can't call method `is_sorted` on type `usize`
-   |
-help: you must surround the range in parentheses to call its `is_sorted` function
-   |
-LL |     if (1..(end + 1)).is_sorted() {
-   |        +            +
-
-error[E0308]: mismatched types
-  --> $DIR/issue-90315.rs:34:8
-   |
-LL |     if 1..(end + 1).is_sorted() {
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<{integer}>`
-
-error[E0689]: can't call method `take` on type `{integer}`
-  --> $DIR/issue-90315.rs:40:26
-   |
-LL |     let _res: i32 = 3..6.take(2).sum();
-   |                          ^^^^ can't call method `take` on type `{integer}`
-   |
-help: you must surround the range in parentheses to call its `take` function
-   |
-LL |     let _res: i32 = (3..6).take(2).sum();
-   |                     +    +
-
-error[E0308]: mismatched types
-  --> $DIR/issue-90315.rs:40:21
-   |
-LL |     let _res: i32 = 3..6.take(2).sum();
-   |               ---   ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Range`
-   |               |
-   |               expected due to this
-   |
-   = note: expected type `i32`
-            found struct `std::ops::Range<{integer}>`
-
-error[E0689]: can't call method `sum` on type `{integer}`
-  --> $DIR/issue-90315.rs:45:26
-   |
-LL |     let _sum: i32 = 3..6.sum();
-   |                          ^^^ can't call method `sum` on type `{integer}`
-   |
-help: you must surround the range in parentheses to call its `sum` function
-   |
-LL |     let _sum: i32 = (3..6).sum();
-   |                     +    +
-
-error[E0308]: mismatched types
-  --> $DIR/issue-90315.rs:45:21
-   |
-LL |     let _sum: i32 = 3..6.sum();
-   |               ---   ^^^^^^^^^^ expected `i32`, found struct `Range`
-   |               |
-   |               expected due to this
-   |
-   = note: expected type `i32`
-            found struct `std::ops::Range<{integer}>`
-
-error[E0689]: can't call method `rev` on type `usize`
-  --> $DIR/issue-90315.rs:53:21
-   |
-LL |     for _a in a..=b.rev() {
-   |                     ^^^ can't call method `rev` on type `usize`
-   |
-help: you must surround the range in parentheses to call its `rev` function
-   |
-LL |     for _a in (a..=b).rev() {
-   |               +     +
-
-error[E0689]: can't call method `contains` on type `{integer}`
-  --> $DIR/issue-90315.rs:58:21
-   |
-LL |     let _res = ..10.contains(3);
-   |                     ^^^^^^^^ can't call method `contains` on type `{integer}`
-   |
-help: you must surround the range in parentheses to call its `contains` function
-   |
-LL |     let _res = (..10).contains(3);
-   |                +    +
-
-error[E0599]: no method named `error_method` found for type `usize` in the current scope
-  --> $DIR/issue-90315.rs:62:15
-   |
-LL |     if 1..end.error_method() {
-   |               ^^^^^^^^^^^^ method not found in `usize`
-
-error[E0308]: mismatched types
-  --> $DIR/issue-90315.rs:62:8
-   |
-LL |     if 1..end.error_method() {
-   |        ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<{integer}>`
-
-error[E0599]: `usize` is not an iterator
-  --> $DIR/issue-90315.rs:68:18
-   |
-LL |     let _res = b.take(1)..a;
-   |                  ^^^^ `usize` is not an iterator
-   |
-   = note: the following trait bounds were not satisfied:
-           `usize: Iterator`
-           which is required by `&mut usize: Iterator`
-
-error[E0689]: can't call method `take` on ambiguous numeric type `{integer}`
-  --> $DIR/issue-90315.rs:71:25
-   |
-LL |     let _res: i32 = ..6.take(2).sum();
-   |                         ^^^^
-   |
-help: you must specify a concrete type for this numeric value, like `i32`
-   |
-LL |     let _res: i32 = ..6_i32.take(2).sum();
-   |                       ~~~~~
-
-error: aborting due to 18 previous errors
-
-Some errors have detailed explanations: E0308, E0599, E0689.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/methods/issues/issue-94581.rs b/src/test/ui/methods/issues/issue-94581.rs
deleted file mode 100644
index df393e91db0..00000000000
--- a/src/test/ui/methods/issues/issue-94581.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-fn get_slice() -> &'static [i32] {
-    &[1, 2, 3, 4]
-}
-
-fn main() {
-    let sqsum = get_slice().map(|i| i * i).sum(); //~ ERROR [E0599]
-}
diff --git a/src/test/ui/methods/issues/issue-94581.stderr b/src/test/ui/methods/issues/issue-94581.stderr
deleted file mode 100644
index d6be29cf582..00000000000
--- a/src/test/ui/methods/issues/issue-94581.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0599]: `&'static [i32]` is not an iterator
-  --> $DIR/issue-94581.rs:6:29
-   |
-LL |     let sqsum = get_slice().map(|i| i * i).sum();
-   |                             ^^^ `&'static [i32]` is not an iterator; try calling `.iter()`
-   |
-   = note: the following trait bounds were not satisfied:
-           `&'static [i32]: Iterator`
-           which is required by `&mut &'static [i32]: Iterator`
-           `[i32]: Iterator`
-           which is required by `&mut [i32]: Iterator`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.