@@ -2808,9 +2808,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
28082808 } else {
28092809 // is the missing argument of type `()`?
28102810 let sugg_unit = if expected_arg_tys. len ( ) == 1 && supplied_arg_count == 0 {
2811- self . resolve_type_vars_if_possible ( & expected_arg_tys[ 0 ] ) . is_nil ( )
2811+ self . resolve_type_vars_if_possible ( & expected_arg_tys[ 0 ] ) . is_unit ( )
28122812 } else if fn_inputs. len ( ) == 1 && supplied_arg_count == 0 {
2813- self . resolve_type_vars_if_possible ( & fn_inputs[ 0 ] ) . is_nil ( )
2813+ self . resolve_type_vars_if_possible ( & fn_inputs[ 0 ] ) . is_unit ( )
28142814 } else {
28152815 false
28162816 } ;
@@ -3958,7 +3958,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
39583958 if let Some ( ref e) = * expr_opt {
39593959 coerce. coerce ( self , & cause, e, e_ty) ;
39603960 } else {
3961- assert ! ( e_ty. is_nil ( ) ) ;
3961+ assert ! ( e_ty. is_unit ( ) ) ;
39623962 coerce. coerce_forced_unit ( self , & cause, & mut |_| ( ) , true ) ;
39633963 }
39643964 } else {
@@ -4752,7 +4752,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
47524752 expression : & ' gcx hir:: Expr ,
47534753 expected : Ty < ' tcx > ,
47544754 cause_span : Span ) {
4755- if expected. is_nil ( ) {
4755+ if expected. is_unit ( ) {
47564756 // `BlockTailExpression` only relevant if the tail expr would be
47574757 // useful on its own.
47584758 match expression. node {
@@ -4795,7 +4795,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
47954795 can_suggest : bool ) {
47964796 // Only suggest changing the return type for methods that
47974797 // haven't set a return type at all (and aren't `fn main()` or an impl).
4798- match ( & fn_decl. output , found. is_suggestable ( ) , can_suggest, expected. is_nil ( ) ) {
4798+ match ( & fn_decl. output , found. is_suggestable ( ) , can_suggest, expected. is_unit ( ) ) {
47994799 ( & hir:: FunctionRetTy :: DefaultReturn ( span) , true , true , true ) => {
48004800 err. span_suggestion_with_applicability (
48014801 span,
0 commit comments