@@ -398,7 +398,7 @@ impl IrMaps {
398
398
399
399
( * v) . push ( id) ;
400
400
}
401
- Arg ( _, _, by_ref) | Arg ( _ , _ , by_mutbl_ref ) |
401
+ Arg ( _, _, by_ref) |
402
402
Arg ( _, _, by_val) | Self | Field ( _) | ImplicitRet |
403
403
Local ( LocalInfo { kind : FromMatch ( bind_by_implicit_ref) , _} ) => {
404
404
debug ! ( "--but it is not owned" ) ;
@@ -919,7 +919,7 @@ impl Liveness {
919
919
// inputs passed by & mode should be considered live on exit:
920
920
for decl. inputs. each |arg| {
921
921
match ty:: resolved_mode( self . tcx, arg. mode) {
922
- by_mutbl_ref | by_ref | by_val => {
922
+ by_ref | by_val => {
923
923
// These are "non-owned" modes, so register a read at
924
924
// the end. This will prevent us from moving out of
925
925
// such variables but also prevent us from registering
@@ -1573,7 +1573,7 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) {
1573
1573
let targs = ty:: ty_fn_args ( ty:: expr_ty ( self . tcx , f) ) ;
1574
1574
for vec:: each2( args, targs) |arg_expr, arg_ty| {
1575
1575
match ty:: resolved_mode ( self . tcx , arg_ty. mode ) {
1576
- by_val | by_copy | by_ref | by_mutbl_ref => { }
1576
+ by_val | by_copy | by_ref => { }
1577
1577
by_move => {
1578
1578
self . check_move_from_expr ( * arg_expr, vt) ;
1579
1579
}
@@ -1865,24 +1865,7 @@ impl @Liveness {
1865
1865
fn warn_about_unused_args ( sp : span , decl : fn_decl , entry_ln : LiveNode ) {
1866
1866
for decl. inputs. each |arg| {
1867
1867
let var = self . variable ( arg. id , arg. ty . span ) ;
1868
- match ty:: resolved_mode ( self . tcx , arg. mode ) {
1869
- by_mutbl_ref => {
1870
- // for mutable reference arguments, something like
1871
- // x = 1;
1872
- // is not worth warning about, as it has visible
1873
- // side effects outside the fn.
1874
- match self . assigned_on_entry ( entry_ln, var) {
1875
- Some ( _) => { /*ok*/ }
1876
- None => {
1877
- // but if it is not written, it ought to be used
1878
- self . warn_about_unused ( sp, entry_ln, var) ;
1879
- }
1880
- }
1881
- }
1882
- by_val | by_ref | by_move | by_copy => {
1883
- self . warn_about_unused ( sp, entry_ln, var) ;
1884
- }
1885
- }
1868
+ self . warn_about_unused ( sp, entry_ln, var) ;
1886
1869
}
1887
1870
}
1888
1871
0 commit comments