Here's a good article about the Luongo/Weber/etc rule:
pensionplanpuppets.com/2013/1/9/3854426/luongo-and-the-new-cbas-luongo-rule
I recommend reading through the entire article, but, to summarize, every team that signed players to cap-circumventing deals will eventually suffer potentially substantial cap penalties, especially if the player retires directly before his salary drops off.
The Canucks would actually save money and minimize long-term cap risk if they trade Luongo before this season starts. The team who receives him will also be penalized, but it would be comparatively negligible.