about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-03-13 19:28:14 -0700
committerEsteban Küber <esteban@kuber.com.ar>2020-03-29 13:13:17 -0700
commit2c71894657bc0ac7a250170e3733f140750498a3 (patch)
tree7a0fb70e4b6889c2d83056468f9dfce68ec9029d /src/test/ui/impl-trait
parent285519d412ef9c65df3bcd2de2b1a3d6ca16a255 (diff)
Tweak `suggest_constraining_type_param`
Some of the bound restriction structured suggestions were incorrect
while others had subpar output.
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/issue-55872-1.stderr18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/test/ui/impl-trait/issue-55872-1.stderr b/src/test/ui/impl-trait/issue-55872-1.stderr
index d62b8b1c253..6cb2c9fb892 100644
--- a/src/test/ui/impl-trait/issue-55872-1.stderr
+++ b/src/test/ui/impl-trait/issue-55872-1.stderr
@@ -4,13 +4,12 @@ error[E0277]: the trait bound `S: std::marker::Copy` is not satisfied in `(S, T)
 LL |     type E = impl Copy;
    |     ^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `S`
    |
-help: consider further restricting this bound with `+ std::marker::Copy`
-  --> $DIR/issue-55872-1.rs:11:9
-   |
-LL | impl<S: Default> Bar for S {
-   |         ^^^^^^^
    = note: required because it appears within the type `(S, T)`
    = note: the return type of a function must have a statically known size
+help: consider further restricting this bound
+   |
+LL | impl<S: Default + std::marker::Copy> Bar for S {
+   |                 ^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied in `(S, T)`
   --> $DIR/issue-55872-1.rs:12:5
@@ -18,13 +17,12 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied in `(S, T)
 LL |     type E = impl Copy;
    |     ^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `T`
    |
-help: consider further restricting this bound with `+ std::marker::Copy`
-  --> $DIR/issue-55872-1.rs:16:15
-   |
-LL |     fn foo<T: Default>() -> Self::E {
-   |               ^^^^^^^
    = note: required because it appears within the type `(S, T)`
    = note: the return type of a function must have a statically known size
+help: consider further restricting this bound
+   |
+LL |     fn foo<T: Default + std::marker::Copy>() -> Self::E {
+   |                       ^^^^^^^^^^^^^^^^^^^
 
 error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
   --> $DIR/issue-55872-1.rs:16:37