You can't discharge a student loan in bankruptcy. This makes sense. If you borrow money to purchase a car or a home the lender always has the option of repossessing the goods as a last resort.
You cannot legally repossess someone's human capital. So the current law is set to avoid the moral hazard of someone borrowing $100k in student loans and then declaring bankruptcy right after graduation.