Raonic was eliminated from the Australian Open on Monday after losing his fourth-round match 6-4, 7-6 (4), 6-2 to Federer, a winner of 17 Grand Slam titles and currently ranked No. 2 in the world.
Raonic revealed after the match that he was battling a foot injury and wasn't given the green light to play until just moments before he stepped on the court.
"I had a tough day today," said the native of Thornhill, Ont. "It wasn't as smooth of a day as I would have liked to have. Until probably 45 minutes to an hour before the match, I wasn't even sure I'd play. I rushed over to get a quick MRI on my foot."
He said there was concern he may have a stress fracture, which was weighing on him mentally.
"I was able to actually clear it out of my mind pretty well before the match and just sort of go along with everything and just play as well as I could," he said.
Raonic, who had 19 aces and 41 unforced errors in less than two hours, said he was having issues walking. The eventual diagnosis was inflammation in the joints.
"I just had an anesthesia injection into my foot," he said.
Federer won the first set after Raonic sent over a double-fault to give set point to the Swiss star, who hit a volley winner to secure the early lead.
Federer won the second in a tiebreaker and began the third with a double-break, a gap which Raonic could not close.
Federer put the game away on his second match point, a winner to the empty court.
Raonic has lost all four career matches he's had with Federer and has yet to advance past the fourth round of a major, but he said he's happy with how he managed under the circumstances.
"I just kept pushing," he said.
He said his condition should not affect his availability for Canada's Davis Cup tie against Spain next week, adding the injury "just needs a few days to sort out."
Meanwhile, Toronto's Daniel Nestor suffered his earliest doubles loss at the tournament since 2009 as he and new partner Mahesh Bhupathi fell 6-3, 4-6, 6-3 to Simone Bolelli and Fabio Fognini.
The 40-year-old Nestor, who has won the most doubles titles in history, was unable to nose his fifth-seeded team into the quarter-finals.
"They put a lot of pressure on us and conditions favoured them a bit more," Nestor said. "Every day feels different here. It depends on what court you are on.
"This one felt slower than where we had practised. Conditions were also heavier with the balls and the air."
The third-round defeat in just under two hours was a disappointment for Nestor, who split with Max Mirnyi of Belarus last season to team up with India's Bhupathi.
Monday's match was marred by eight double-faults from Nestor and Bhupathi, who also converted on just three of ten break chances.
Note to readers: This is a corrected story. An earlier version reported that Raonic was the 15th seed.Suggest a correction