Okay – gonna skip what everyone said and point out something really quickly here. If I remember correctly, the Canon T1i had pretty much the same sensor as the 50D. The Canon T2i and T3i both have very similar (if not identical) sensors to the 7D and 60D. Yes, you are going to miss out on things (though I suspect trickle down will still actually improve much of the technology vs. your 40D) vs going with a pro-type body, including weight and size (I like the feel of the larger cameras in my hands), but if you buy new with that, especially a T3i, you will also have a year warranty coverage as well.
Also, depending on what lenses you have already bought, going full-frame like with a used 5D you might have a lot of lenses that won’t work anymore. If you go to a Rebel series for now you will still be able to use your lenses. With the 5D those same lenses could actually damage your camera (anything with an EF-S designation will not work with a 5D or other full-frame – some will just put a circle in the frame with everything dark outside of it, some will actually have parts that can interfere with your mirror).
Purists love full-frame cameras because they are so similar to film, but if you’re used to working in APS-C land dealing with the 1.6x crop factor isn’t going to throw you.
People look down on Rebels, but internally there is a lot more about them that is similar to the higher end APS-C camera than different. Yes, they cost less. Yes, they have the cute little scene modes on them and the other modes that are kind of like training wheels before you move to Av,Tv and Manual (I started with manual and worked backwards when it came to SLR-type cameras), etc.
SO – my two cents – depending on what you are looking for and what lenses you have available right now, a Rebel is NOT a bad camera. My Rebel was drowned in an unfortunate incident last summer (my son pulled a raft out from under me when we were already beached and somehow my foot caught my camera where it was sitting as I fell backwards and it was kicked into a river) and for some things, like ‘traveling light’ moments I really miss it, even if it was only a 15.1MP T1i. I love the feel and handling of my 7D – it is definitely “more substantial,” but I’ve gotten beautiful shots with ‘just a Rebel.’
I am one of those ‘it’s the glass’ kind of people mostly as far as what really affects your image quality (after knowledge). As long as the Rebel does what you need it to and provides the functions you want, don’t rule it out as a possibility.