diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-12-15 22:20:30 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-01-08 09:30:27 -0800 |
| commit | 0dcdbaec0b49a149316719b32241d8975bd192c9 (patch) | |
| tree | b27c7c6580e22fe4acc7d4b4b64f95ac0b9613e9 /src/test/ui/impl-trait | |
| parent | c55615155d161c8abb307db0019ab58545cd246b (diff) | |
| download | rust-0dcdbaec0b49a149316719b32241d8975bd192c9.tar.gz rust-0dcdbaec0b49a149316719b32241d8975bd192c9.zip | |
Point at the def span of trait refs E0277
Diffstat (limited to 'src/test/ui/impl-trait')
| -rw-r--r-- | src/test/ui/impl-trait/auto-trait-leak.stderr | 3 | ||||
| -rw-r--r-- | src/test/ui/impl-trait/auto-trait-leak2.stderr | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr index d11941fee18..20815e80acb 100644 --- a/src/test/ui/impl-trait/auto-trait-leak.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak.stderr @@ -77,6 +77,9 @@ LL | fn send<T: Send>(_: T) {} ... LL | send(cycle2().clone()); | ^^^^ `std::rc::Rc<std::string::String>` cannot be sent between threads safely +... +LL | fn cycle2() -> impl Clone { + | ---------- within this `impl std::clone::Clone` | = help: within `impl std::clone::Clone`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::string::String>` = note: required because it appears within the type `impl std::clone::Clone` diff --git a/src/test/ui/impl-trait/auto-trait-leak2.stderr b/src/test/ui/impl-trait/auto-trait-leak2.stderr index d163e1dff7a..a93b3dbc71b 100644 --- a/src/test/ui/impl-trait/auto-trait-leak2.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak2.stderr @@ -1,6 +1,9 @@ error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely --> $DIR/auto-trait-leak2.rs:13:5 | +LL | fn before() -> impl Fn(i32) { + | ------------ within this `impl std::ops::Fn<(i32,)>` +... LL | fn send<T: Send>(_: T) {} | ---- ---- required by this bound in `send` ... @@ -19,6 +22,9 @@ LL | fn send<T: Send>(_: T) {} ... LL | send(after()); | ^^^^ `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely +... +LL | fn after() -> impl Fn(i32) { + | ------------ within this `impl std::ops::Fn<(i32,)>` | = help: within `impl std::ops::Fn<(i32,)>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::Cell<i32>>` = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22 p:std::rc::Rc<std::cell::Cell<i32>>]` |
