Under Section 523(8) of the Bankruptcy Code student loans are excluded from discharge in bankruptcy. This means that in most cases after you go bankrupt (Chapter 7 or Chapter 13) you will still owe your student loans.
So you have a great idea, right? Why not pay your student loans with a credit card, which you could then discharge? WRONG!
Credit card debts can be discharged except for a few exceptions. For example, credit card debt is non-dischargeable when the funds were obtained with the intention of filing bankruptcy, or otherwise fraudulently (like filing a false application).
Furthermore, if a credit card is used to pay a non-dischargeable debt like a student loan or taxes, that portion of the debt will be treated the same as the original debt.
This means that even if the credit card company doesn't object to the discharge, they still might be able to pursue you after the discharge, just like a student loan company could (although best practice for the credit card company would be to object prior to the discharge).
Even worse, if the bankruptcy court found that you were attempting to commit a fraud upon the Court by moving this debt, the Court could deny your discharge altogether.
If you are looking for creative ways to pay down your student loans you should consult with an attorney regarding your options.