about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-10 13:05:05 +0000
committerbors <bors@rust-lang.org>2020-04-10 13:05:05 +0000
commitdbc3cfdd25ccd56edf3ea364f86ab32967636c26 (patch)
treea75c01452eed404a4610f586ab4efd89938b6107 /src/test/ui
parent167510f776891f2b0b18d1168ed42377a63493a7 (diff)
parent68e0e6ba848087734be581afe5478635a647aa7c (diff)
Auto merge of #70983 - Centril:rollup-npabk7c, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #70784 (Consider methods on fundamental `impl` when method is not found on numeric type)
 - #70843 (Remove the Ord bound that was plaguing drain_filter)
 - #70913 (Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.)
 - #70932 (De-abuse TyKind::Error in pattern type checking)
 - #70952 (Clean up E0511 explanation)
 - #70964 (rustc_session CLI lint parsing: mark a temporary hack as such)
 - #70969 (Fix JSON file_name documentation for macros.)
 - #70975 (Fix internal doc comment nits.)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/error-codes/E0152.rs2
-rw-r--r--src/test/ui/error-codes/E0152.stderr2
-rw-r--r--src/test/ui/error-codes/E0718.rs4
-rw-r--r--src/test/ui/error-codes/E0718.stderr6
-rw-r--r--src/test/ui/issues/issue-29181.rs2
-rw-r--r--src/test/ui/issues/issue-29181.stderr16
6 files changed, 23 insertions, 9 deletions
diff --git a/src/test/ui/error-codes/E0152.rs b/src/test/ui/error-codes/E0152.rs
index dcaf9208835..94467b9bdde 100644
--- a/src/test/ui/error-codes/E0152.rs
+++ b/src/test/ui/error-codes/E0152.rs
@@ -1,6 +1,6 @@
 #![feature(lang_items)]
 
-#[lang = "arc"]
+#[lang = "owned_box"]
 struct Foo; //~ ERROR E0152
 
 fn main() {
diff --git a/src/test/ui/error-codes/E0152.stderr b/src/test/ui/error-codes/E0152.stderr
index 29981991ee0..fbaa276ce10 100644
--- a/src/test/ui/error-codes/E0152.stderr
+++ b/src/test/ui/error-codes/E0152.stderr
@@ -1,4 +1,4 @@
-error[E0152]: found duplicate lang item `arc`
+error[E0152]: found duplicate lang item `owned_box`
   --> $DIR/E0152.rs:4:1
    |
 LL | struct Foo;
diff --git a/src/test/ui/error-codes/E0718.rs b/src/test/ui/error-codes/E0718.rs
index 82ab2d4af1b..909cae0ba25 100644
--- a/src/test/ui/error-codes/E0718.rs
+++ b/src/test/ui/error-codes/E0718.rs
@@ -1,7 +1,7 @@
 #![feature(lang_items)]
 
-// Arc is expected to be a struct, so this will error.
-#[lang = "arc"] //~ ERROR language item must be applied to a struct
+// Box is expected to be a struct, so this will error.
+#[lang = "owned_box"] //~ ERROR language item must be applied to a struct
 static X: u32 = 42;
 
 fn main() {}
diff --git a/src/test/ui/error-codes/E0718.stderr b/src/test/ui/error-codes/E0718.stderr
index 412c856ce06..30378dd1674 100644
--- a/src/test/ui/error-codes/E0718.stderr
+++ b/src/test/ui/error-codes/E0718.stderr
@@ -1,8 +1,8 @@
-error[E0718]: `arc` language item must be applied to a struct
+error[E0718]: `owned_box` language item must be applied to a struct
   --> $DIR/E0718.rs:4:1
    |
-LL | #[lang = "arc"]
-   | ^^^^^^^^^^^^^^^ attribute should be applied to a struct, not a static item
+LL | #[lang = "owned_box"]
+   | ^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a struct, not a static item
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-29181.rs b/src/test/ui/issues/issue-29181.rs
index 45752ad4f62..70e5bc01920 100644
--- a/src/test/ui/issues/issue-29181.rs
+++ b/src/test/ui/issues/issue-29181.rs
@@ -4,4 +4,6 @@ extern crate issue_29181 as foo;
 
 fn main() {
     0.homura(); //~ ERROR no method named `homura` found
+    // Issue #47759, detect existing method on the fundamental impl:
+    let _ = |x: f64| x * 2.0.exp(); //~ ERROR can't call method `exp` on ambiguous numeric type
 }
diff --git a/src/test/ui/issues/issue-29181.stderr b/src/test/ui/issues/issue-29181.stderr
index 250b158ab8e..b66dcb88d00 100644
--- a/src/test/ui/issues/issue-29181.stderr
+++ b/src/test/ui/issues/issue-29181.stderr
@@ -4,6 +4,18 @@ error[E0599]: no method named `homura` found for type `{integer}` in the current
 LL |     0.homura();
    |       ^^^^^^ method not found in `{integer}`
 
-error: aborting due to previous error
+error[E0689]: can't call method `exp` on ambiguous numeric type `{float}`
+  --> $DIR/issue-29181.rs:8:30
+   |
+LL |     let _ = |x: f64| x * 2.0.exp();
+   |                              ^^^
+   |
+help: you must specify a concrete type for this numeric value, like `f32`
+   |
+LL |     let _ = |x: f64| x * 2.0_f32.exp();
+   |                          ^^^^^^^
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0599`.
+Some errors have detailed explanations: E0599, E0689.
+For more information about an error, try `rustc --explain E0599`.