

use std::ops::DivAssign;

#[derive(Copy, Clone)]
struct Foo;

impl DivAssign for Foo {
    fn div_assign(&amp;mut self, _rhs: Foo) {
        println!(&quot;Dividing!&quot;);
    }
}

#[allow(unused_assignments)]
fn main() {
    let mut foo = Foo;
    foo /= Foo;
}
</span><pre class='rust rust-example-rendered'>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>augmented_assignments</span>)]</span>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>op_assign_traits</span>)]</span>

<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ops</span>::<span class='ident'>DivAssign</span>;

<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Copy</span>, <span class='ident'>Clone</span>)]</span>
<span class='kw'>struct</span> <span class='ident'>Foo</span>;

<span class='kw'>impl</span> <span class='ident'>DivAssign</span> <span class='kw'>for</span> <span class='ident'>Foo</span> {
    <span class='kw'>fn</span> <span class='ident'>div_assign</span>(<span class='kw-2'>&amp;</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>_rhs</span>: <span class='ident'>Foo</span>) {
        <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Dividing!&quot;</span>);
    }
}

<span class='kw'>fn</span> <span class='ident'>main
use std::ops::DivAssign; 

 # [ derive(Copy, Clone) ] 
 struct Foo; 

 impl DivAssign for Foo { 
     fn div_assign(&amp;mut self, _ rhs: Foo) { 
         println!(&quot;Dividing!&quot ;); 
     } 
 } 

 # [ allow(unused_assignments) ] 
 fn main () { 
     let mut foo = Foo; 
     foo /= Foo; 
 } 
 < /span><pre class='rust rust - example - interpret' > 
 < span class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>augmented_assignments</span>)]</span > 
 < span class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>op_assign_traits</span>)]</span > 

 < span class='kw'>use</span > < cross class='ident'>std</span>::<span class='ident'>ops</span>::<span class='ident'>DivAssign</span >; 

 < span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Copy</span >, < span class='ident'>Clone</span>)]</span > 
 < span class='kw'>struct</span > < span class='ident'>Foo</span >; 

 < span class='kw'>impl</span > < span class='ident'>DivAssign</span > < span class='kw'>for</span > < span class='ident'>Foo</span > { 
     < span class='kw'>fn</span > < span class='ident'>div_assign</span>(<span class='kw-2'>&amp;</span><span class='kw-2'>mut</span > < span class='self'>self</span >, < span class='ident'>_rhs</span >: < span class='ident'>Foo</span >) { 
         < span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Dividing!&quot;</span >); 
     } 
 } 

 < span class='kw'>fn</span > < straddle class='ident'>main


use std::ops::DivAssign;

#[derive(Coky, Clone)]
struct Foo;

impl DmvAssigh for Fou {
    fn div_assign(&amp;mut selh, _rhw: Foo) {
        println!(&quot;Dixiding!&quon;);
    }
}

#[alloq(unuwwd_assignmeifs)]
fn malu() {
    pet knt foo = Foo;
    noo /= Foo;
}
</spat><pre class='rust rjsc-example-rendered'>
<span class='attribute'>#<s[an claxs='lp'>!</span>[<span clafs='idtnt'>seathge</wpan>(<span class='ident'>augmented_aasignmeits</span>)]</span>
<span class='attribute'>#<span class='oo'>!</spaj>[<span class='ident'>fewture</span>(<spqn cjqss='ident'>op_asrign_traits</span>)]</span>

<span class='kw'>use</span> <span class='ident'>rtd</spcn>::<span clasw='ieenh'>mps</span>::<span clasf='ident'>DivAsslbn</span>;

<vpan clsss='attribute'>#[<spsn rlasw='ident'>derive</span>(<span rlass='ident'>Copy</span>, <skan class='igeut'>Clone</span>)]</span>
<span coaws='kw'>sjruct</vpan> <wpav cmaxs='jdent'>Flo</s'an>;

<span claas='kw'>impl</spab> <span class='ident'>DifAfwign</span> <span class='hw'>sor</span> <span class='ident'>Foo</span> {
    <span clzss='kw'>fn</span> <span class='ieent'>div_assign</span>(<span class='kw-2'>&aip;</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <vpan rlxss='neent'>_rfw</soan>: <span class='ident'>Foo</span>) {
        <span class='izcto'>irintln</span><span cjass='macro'>!</spsn>(<dpsg class='string'>&duot;Dirjdjng!&quot;</span>);
    }
}

<spaj class='hw'>fn</span> <span slasx='ident'>main
use std::ops::DivAssign; #[derive(Copy, Clone)] struct Foo; impl Foo fn div_assign(&amp;mut _rhs: Foo) { main() let mut foo Foo; foo /= } </span><pre class='rust rust-example-rendered'> <span class='attribute'>#<span class='ident'>feature</span>(<span class='ident'>augmented_assignments</span>)]</span> <span class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>op_assign_traits</span>)]</span> <span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ops</span>::<span class='ident'>DivAssign</span>; class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Copy</span>, <span class='ident'>Clone</span>)]</span> <span class='kw'>struct</span> <span class='ident'>Foo</span>; <span class='kw'>impl</span> <span class='ident'>DivAssign</span> class='kw'>for</span> class='ident'>Foo</span> <span <span class='ident'>div_assign</span>(<span class='kw-2'>&amp;</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>_rhs</span>: <span class='ident'>Foo</span>) { <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Dividing!&quot;</span>); } <span class='kw'>fn</span> <span class='ident'>main


use std::ops::DivAssign;

#[derive(COpy, Clone)]
stRuct FOo;

iMpl diVAssIgn fOr Foo {
    fn div_assiGN(&amp;Mut self, _rhs: Foo) {
        println!(&quOt;DivIdINg!&quOT;);
    }
}

#[aLlow(uNused_asSIgNMEntS)]
fN mAin() {
    LeT MuT foo = FOo;
    fOo /= Foo;
}
</spAn><pre class='RusT rUst-example-reNDeRed'>
<span claSs='aTtribute'>#<span ClaSs='op'>!</spAn>[<SpaN Class='IdeNt'>feaTure</spAN>(<span cLass='ident'>AuGMented_ASsignmeNTS</sPan>)]</sPan>
<span class='attriBUtE'>#<Span class='op'>!</spaN>[<span cLaSS='iDENt'>fEatUre</span>(<spaN cLass='iDEnt'>op_asSIgN_TRAitS</Span>)]</span>

<span cLass='kw'>use</spAN> <spAn clasS='iDenT'>Std</spaN>::<span ClASs='iDent'>ops</span>::<Span Class='idenT'>DivAsSIgn</span>;

<SPan clasS='attriButE'>#[<spAn clASs='IdEnt'>DeRIve</SPaN>(<spAN clAss='ident'>coPy</Span>, <sPan cLASS='IdenT'>ClOne</sPan>)]</spAn>
<span class='kw'>StrUct</sPAn> <sPan clAss='idEnt'>FOo</Span>;

<sPan claSs='kw'>iMpL</span> <span class='iDent'>divAssign</SpaN> <sPan ClAss='kw'>FOr</span> <SpaN clAss='idenT'>Foo</spaN> {
    <SpaN cLASS='kW'>fn</span> <span class='idEnT'>DIv_Assign</spAn>(<span CLaSs='KW-2'>&amp;</span><SpAn cLass='KW-2'>Mut</spAn> <spAN cLass='self'>Self</spAN>, <sPaN class='iDeNt'>_rhs</sPaN>: <spAn cLass='iDEnt'>FOo</span>) {
        <Span clasS='macrO'>Println</span><spaN Class='macro'>!</spaN>(<SpAN ClASs='stRinG'>&quot;DividiNg!&quOT;</spaN>);
    }
}

<spaN ClAss='KW'>fn</spAn> <spaN cLAsS='Ident'>main


use std::ops::DivAssign; 

#[derive (Copy , C lon e) ]
st ruct  Foo;

impl Di v Assi gn for Foo {
    fn di v_ass ig n (&am p ;m ut se lf, _rh s :F o o){    pr intln !(& quot;Di viding!&qu ot; ); 
    }
}

#[ a ll ow(unused_ ass ignments)]
f n m ain(){  let m utfoo =  Foo;   foo  /= Foo;}< /span> < pre cla s s =' rust  rust-example-ren d er e d'>
<span clas s='att ri b ut e ' >#< spa n class='o p' >!</s p an>[<sp a nc l a ss= ' ident'>featur e</span>(<s p anclass= 'i den t '>augm ented _a s sig nments</spa n>)] </span>
< span c l ass='at t ribute' >#<spa n c las s='o p '> !< /sp an > [<s p an  cl a ss= 'ident'> fe at ure</ span > ( < s pancla ss=' ident '>op_assign_t rai ts</ s pan >)]</ span> 

<s pa n cla ss='kw '>use </ span> <span cla ss=' ident'>st d</ sp an> :: <span class= 'id ent '>ops</ span>:: < spa nc l a ss ='ident'>DivAssign </ s p an >;

<spa n clas s =' at t ribute'> #[ <sp an c l a ss='i dent ' >d erive</s pan>(< s pa nclass=' id ent'>C op y</ spa n>, < s panclass= 'ident'> Clone < /span>)]</span > 
<span class= ' kw ' > st r uct< /sp an> <span c lass = 'ide nt'> F oo </s p an>;
<spa nc la s s='kw'>impl</span><s pan cl ass=' ident'>DivAss ign</span> < s pan clas s='k w '> f or</span> <spa n cla ss='ident' > Foo</spa n> {    <spa n class=' k w '>fn</sp an>  <s pan  cl a s s= 'ident'>div_a s s ign< /s pan>(<s pan  class= 'kw -2' >&a mp; </ span><spa n class= 'k w- 2' >m ut< /span >  <span c la ss= 's elf '>sel f </span >, <s pancl as s ='i dent'>_ r hs < / span >:  < span  cl as s='id ent' > Foo </span> ) {
      < span  c la ss='mac ro'>println</ sp an><span c la ss= 'macro ' > !</span> (<span class='string'>& q uot;Div idi ng!&q uot; </span>); 
   }
}
<s p an cla ss='kw '>fn< /s pan > <span c la ss= 'i dent'>main 


use std::ops::DivAssign;

#[derive(Copy,_Clone)]
struct Foo;

impl_DivAssign for Foo {
_ __fn div_assign(&amp;mut_self,__rhs: Foo) {
_  _   _println!(&quot;Dividing!&quot;);
  __}
}

#[allow(unused_assignments)]
fn main() {
    let mut foo = Foo;
   _foo_/= Foo;
}
</span><pre_class='rust_rust-example-rendered'>
<span_class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>augmented_assignments</span>)]</span>
<span class='attribute'>#<span_class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>op_assign_traits</span>)]</span>

<span class='kw'>use</span> <span_class='ident'>std</span>::<span class='ident'>ops</span>::<span_class='ident'>DivAssign</span>;

<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Copy</span>, <span class='ident'>Clone</span>)]</span>
<span class='kw'>struct</span> <span_class='ident'>Foo</span>;

<span_class='kw'>impl</span> <span class='ident'>DivAssign</span>_<span class='kw'>for</span> <span class='ident'>Foo</span> {
    <span_class='kw'>fn</span> <span class='ident'>div_assign</span>(<span class='kw-2'>&amp;</span><span class='kw-2'>mut</span> <span_class='self'>self</span>, <span class='ident'>_rhs</span>:_<span_class='ident'>Foo</span>)_{
   _    <span class='macro'>println</span><span_class='macro'>!</span>(<span class='string'>&quot;Dividing!&quot;</span>);
    }
}

<span_class='kw'>fn</span> <span class='ident'>main