]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/trait-suggest-deferences-multiple-1.rs
1 use std
::ops
::{Deref, DerefMut}
;
5 impl Happy
for &mut LDM {}
12 fn deref(&self) -> &Self::Target
{
18 fn deref(&self) -> &Self::Target
{
24 fn deref(&self) -> &Self::Target
{
28 impl DerefMut
for Foo
{
29 fn deref_mut(&mut self) -> &mut Self::Target
{
33 impl DerefMut
for Bar
{
34 fn deref_mut(&mut self) -> &mut Self::Target
{
38 impl DerefMut
for Baz
{
39 fn deref_mut(&mut self) -> &mut Self::Target
{
45 fn foo
<T
>(_
: T
) where T
: Happy {}
48 // Currently the compiler doesn't try to suggest dereferences for situations
49 // where DerefMut involves. So this test is meant to ensure compiler doesn't
50 // generate incorrect help message.
51 let mut baz
= Baz(Bar(Foo(LDM
)));
53 //~^ ERROR the trait bound `&mut Baz: Happy` is not satisfied