about summary refs log tree commit diff
path: root/src/test/ui/suggestions
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2021-09-14 10:52:36 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2021-09-16 12:12:28 +0000
commit4951e3ad9ecc653bd2097c6a80e2e1c841edec66 (patch)
treedf518e51a2dccf8d172a8bd56a48102edcac9bf8 /src/test/ui/suggestions
parent1d8290568506e5d85422f23ab73ce79519201995 (diff)
downloadrust-4951e3ad9ecc653bd2097c6a80e2e1c841edec66.tar.gz
rust-4951e3ad9ecc653bd2097c6a80e2e1c841edec66.zip
Point at argument when evaluating `Path`'s bounds
When evaluating an `ExprKind::Call`, we first have to `check_expr` on it's
callee. When this one is a `ExprKind::Path`, we had to evaluate the bounds
introduced for its arguments, but by the time we evaluated them we no
longer had access to the argument spans. Now we special case this so
that we can point at the right place on unsatisfied bounds. This also
allows the E0277 deduplication to kick in correctly, so we now emit
fewer errors.
Diffstat (limited to 'src/test/ui/suggestions')
-rw-r--r--src/test/ui/suggestions/issue-84973-blacklist.rs1
-rw-r--r--src/test/ui/suggestions/issue-84973-blacklist.stderr14
2 files changed, 2 insertions, 13 deletions
diff --git a/src/test/ui/suggestions/issue-84973-blacklist.rs b/src/test/ui/suggestions/issue-84973-blacklist.rs
index db954530b1b..6813b07a2ee 100644
--- a/src/test/ui/suggestions/issue-84973-blacklist.rs
+++ b/src/test/ui/suggestions/issue-84973-blacklist.rs
@@ -21,7 +21,6 @@ fn main() {
     let ref_cl: &dyn Fn() -> () = &cl;
     f_sized(*ref_cl);
     //~^ ERROR: the size for values of type `dyn Fn()` cannot be known at compilation time [E0277]
-    //~| ERROR: the size for values of type `dyn Fn()` cannot be known at compilation time [E0277]
 
     use std::rc::Rc;
     let rc = Rc::new(0);
diff --git a/src/test/ui/suggestions/issue-84973-blacklist.stderr b/src/test/ui/suggestions/issue-84973-blacklist.stderr
index 72d9f5d26a2..ae55c96702a 100644
--- a/src/test/ui/suggestions/issue-84973-blacklist.stderr
+++ b/src/test/ui/suggestions/issue-84973-blacklist.stderr
@@ -55,7 +55,7 @@ LL | fn f_sized<T: Sized>(t: T) {}
    |            ^ required by this bound in `f_sized`
 
 error[E0277]: `Rc<{integer}>` cannot be sent between threads safely
-  --> $DIR/issue-84973-blacklist.rs:28:12
+  --> $DIR/issue-84973-blacklist.rs:27:12
    |
 LL |     f_send(rc);
    |     ------ ^^ `Rc<{integer}>` cannot be sent between threads safely
@@ -69,16 +69,6 @@ note: required by a bound in `f_send`
 LL | fn f_send<T: Send>(t: T) {}
    |              ^^^^ required by this bound in `f_send`
 
-error[E0277]: the size for values of type `dyn Fn()` cannot be known at compilation time
-  --> $DIR/issue-84973-blacklist.rs:22:5
-   |
-LL |     f_sized(*ref_cl);
-   |     ^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `dyn Fn()`
-   = note: all function arguments must have a statically known size
-   = help: unsized fn params are gated as an unstable feature
-
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0277`.