@@ -120,7 +120,7 @@ use syntax::feature_gate::{GateIssue, emit_feature_err};
120
120
use syntax:: ptr:: P ;
121
121
use syntax:: symbol:: { Symbol , InternedString , keywords} ;
122
122
use syntax:: util:: lev_distance:: find_best_match_for_name;
123
- use syntax_pos:: { self , BytePos , Span , DUMMY_SP } ;
123
+ use syntax_pos:: { self , BytePos , Span } ;
124
124
125
125
use rustc:: hir:: intravisit:: { self , Visitor , NestedVisitorMap } ;
126
126
use rustc:: hir:: itemlikevisit:: ItemLikeVisitor ;
@@ -1901,14 +1901,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
1901
1901
value)
1902
1902
}
1903
1903
1904
- pub fn write_nil ( & self , node_id : ast:: NodeId ) {
1905
- self . write_ty ( node_id, self . tcx . mk_nil ( ) ) ;
1906
- }
1907
-
1908
- pub fn write_error ( & self , node_id : ast:: NodeId ) {
1909
- self . write_ty ( node_id, self . tcx . types . err ) ;
1910
- }
1911
-
1912
1904
pub fn require_type_meets ( & self ,
1913
1905
ty : Ty < ' tcx > ,
1914
1906
span : Span ,
@@ -4020,11 +4012,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
4020
4012
pub fn check_stmt ( & self , stmt : & ' gcx hir:: Stmt ) {
4021
4013
// Don't do all the complex logic below for DeclItem.
4022
4014
match stmt. node {
4023
- hir:: StmtDecl ( ref decl, id ) => {
4015
+ hir:: StmtDecl ( ref decl, _ ) => {
4024
4016
match decl. node {
4025
4017
hir:: DeclLocal ( _) => { }
4026
4018
hir:: DeclItem ( _) => {
4027
- self . write_nil ( id) ;
4028
4019
return ;
4029
4020
}
4030
4021
}
@@ -4040,34 +4031,22 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
4040
4031
self . diverges . set ( Diverges :: Maybe ) ;
4041
4032
self . has_errors . set ( false ) ;
4042
4033
4043
- let ( node_id , _span ) = match stmt. node {
4044
- hir:: StmtDecl ( ref decl, id ) => {
4045
- let span = match decl. node {
4034
+ match stmt. node {
4035
+ hir:: StmtDecl ( ref decl, _ ) => {
4036
+ match decl. node {
4046
4037
hir:: DeclLocal ( ref l) => {
4047
4038
self . check_decl_local ( & l) ;
4048
- l. span
4049
4039
}
4050
- hir:: DeclItem ( _) => { /* ignore for now */
4051
- DUMMY_SP
4052
- }
4053
- } ;
4054
- ( id, span)
4040
+ hir:: DeclItem ( _) => { /* ignore for now */ }
4041
+ }
4055
4042
}
4056
- hir:: StmtExpr ( ref expr, id ) => {
4043
+ hir:: StmtExpr ( ref expr, _ ) => {
4057
4044
// Check with expected type of ()
4058
4045
self . check_expr_has_type ( & expr, self . tcx . mk_nil ( ) ) ;
4059
- ( id, expr. span )
4060
4046
}
4061
- hir:: StmtSemi ( ref expr, id ) => {
4047
+ hir:: StmtSemi ( ref expr, _ ) => {
4062
4048
self . check_expr ( & expr) ;
4063
- ( id, expr. span )
4064
4049
}
4065
- } ;
4066
-
4067
- if self . has_errors . get ( ) {
4068
- self . write_error ( node_id) ;
4069
- } else {
4070
- self . write_nil ( node_id) ;
4071
4050
}
4072
4051
4073
4052
// Combine the diverging and has_error flags.
0 commit comments