File tree Expand file tree Collapse file tree 4 files changed +18
-29
lines changed Expand file tree Collapse file tree 4 files changed +18
-29
lines changed Original file line number Diff line number Diff line change 11//@ run-pass 
2- #![ allow( non_camel_case_types) ]  
32
43use  std:: cell:: Cell ; 
54
65// This test should behave exactly like issue-2735-3 
7- struct  defer < ' a >  { 
6+ struct  Defer < ' a >  { 
87    b :  & ' a  Cell < bool > , 
98} 
109
11- impl < ' a >  Drop  for  defer < ' a >  { 
10+ impl < ' a >  Drop  for  Defer < ' a >  { 
1211    fn  drop ( & mut  self )  { 
1312        self . b . set ( true ) ; 
1413    } 
1514} 
1615
17- fn  defer ( b :  & Cell < bool > )  -> defer < ' _ >  { 
18-     defer  { 
19-         b :  b
20-     } 
16+ fn  defer ( b :  & Cell < bool > )  -> Defer < ' _ >  { 
17+     Defer  {  b } 
2118} 
2219
2320pub  fn  main ( )  { 
2421    let  dtor_ran = & Cell :: new ( false ) ; 
25-     let  _   = defer ( dtor_ran) ; 
22+     let  _ = defer ( dtor_ran) ; 
2623    assert ! ( dtor_ran. get( ) ) ; 
2724} 
Original file line number Diff line number Diff line change 11//@ run-pass 
2- #![ allow( non_camel_case_types) ]  
32
43use  std:: cell:: Cell ; 
54
65// This test should behave exactly like issue-2735-2 
7- struct  defer < ' a >  { 
6+ struct  Defer < ' a >  { 
87    b :  & ' a  Cell < bool > , 
98} 
109
11- impl < ' a >  Drop  for  defer < ' a >  { 
10+ impl < ' a >  Drop  for  Defer < ' a >  { 
1211    fn  drop ( & mut  self )  { 
1312        self . b . set ( true ) ; 
1413    } 
1514} 
1615
17- fn  defer ( b :  & Cell < bool > )  -> defer < ' _ >  { 
18-     defer  { 
19-         b :  b
20-     } 
16+ fn  defer ( b :  & Cell < bool > )  -> Defer < ' _ >  { 
17+     Defer  {  b } 
2118} 
2219
2320pub  fn  main ( )  { 
Original file line number Diff line number Diff line change 11//@ run-pass 
22#![ allow( dead_code) ]  
3- #![ allow( non_camel_case_types) ]  
43
5- 
6- trait  hax  { 
7-     fn  dummy ( & self )  {  } 
4+ trait  Hax  { 
5+     fn  dummy ( & self )  { } 
86} 
9- impl < A >  hax  for  A  {   } 
7+ impl < A >  Hax  for  A  { } 
108
11- fn  perform_hax < T :  ' static > ( x :  Box < T > )  -> Box < dyn  hax + ' static >  { 
12-     Box :: new ( x)  as  Box < dyn  hax + ' static > 
9+ fn  perform_hax < T :  ' static > ( x :  Box < T > )  -> Box < dyn  Hax  +  ' static >  { 
10+     Box :: new ( x)  as  Box < dyn  Hax  +  ' static > 
1311} 
1412
1513fn  deadcode ( )  { 
Original file line number Diff line number Diff line change 11//@ run-pass 
2- #![ allow( non_camel_case_types) ]  
32
43use  std:: cell:: Cell ; 
54
6- struct  r < ' a >  { 
5+ struct  R < ' a >  { 
76    b :  & ' a  Cell < isize > , 
87} 
98
10- impl < ' a >  Drop  for  r < ' a >  { 
9+ impl < ' a >  Drop  for  R < ' a >  { 
1110    fn  drop ( & mut  self )  { 
1211        self . b . set ( self . b . get ( )  + 1 ) ; 
1312    } 
1413} 
1514
16- fn  r ( b :  & Cell < isize > )  -> r < ' _ >  { 
17-     r  { 
18-         b :  b
19-     } 
15+ fn  r ( b :  & Cell < isize > )  -> R < ' _ >  { 
16+     R  {  b } 
2017} 
2118
2219pub  fn  main ( )  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments