It was a 22nd consecutive win at the tournament for Federer who has won the title on the last four occasions he has taken part in Basel.
The two were due to meet in the quarter-finals in Basel but Wawrinka was forced to pull out following a mammoth last-16 clash with Frances Tiafoe.
Wawrinka hammered 14 aces - his final two within the penultimate recreation.
"Not to be able to play this match in Switzerland is very sad". Tiafoe saved a Wawrinka match point with an ace of his own in the final game before the home favourite got the crowd on its feet with a backhand victor down the line to seal the success.
Third seed Stefanos Tsitsipas beat Ricardas Berankis 6-7 (4-7) 6-2 6-4 to reach his 13th quarter-final of the year.
The Lithuanian, ranked 70th, won the first set in a tiebreak before Tsitsipas took control of his service games to secure the remaining two sets comfortably for a 6-7 (4) 6-2 6-4 win. I've always had tough matches against him even though on the hard courts I've been good against him.
Goffin entered this week at provisional 10th in the race and is duelling with Italy's Matteo Berrettini, who now stands eighth, and ninth-placed Roberto Bautista Agut.
The Spaniard claimed his 40th victory of the season as he works to become a first-time qualifier into the season showpiece in London which starts on 10 November.