Some of the TFA Mary Sue accusations were countered with "yeah, but I'm sure they'll cover that point in Episode 8". e.g. to explain why she could use Jedi Mind Tricks perfectly mere minutes after finding out that they exist. I think we can agree that if someone is resorting to "I'm sure the next movie will explain it" then they probably don't have good points to back it up in the first place.
It's worth noting Luke vs Rey because one of the counters is "but Luke was a Mary Sue too!". Which is not the case. Luke needs Han to save his ass, and Obi Wan to remind him to use the force, when attacking the Death Star. Needing assistance is "anti-sue" writing. Other points I've read are that Luke wanted to storm off after meeting Han/Chewie, but Obi Wan puts a firm hand on his shoulder and pushes him back into the seat. Obi Wan saves his ass multiple times (e.g. the sand raiders totally had Luke's number). So Luke starts as an unwise, impetuous, naive farmboy with delusions of grandeur, but has to mature through the guidance and assistance of others. This is why he's not a Mary Sue: his flaws do get him into trouble, other people have to save him, he learns from the experiences. Also note that first movie Luke has zero hand-to-hand combat ability. He only really pulls out the saber stuff in the second movie, after he's spent years practicing, and still gets beat, even after training with two top masters. Rey however, pulls out tricky light saber moves right from the start, never having even laid eyes on a Jedi.
Additionally, Luke is shown being trained in blind-fighting by Obi Wan (remember the helmet and the flying remote laser droid), so the movie even covers how he was trained to pull off the feat that he did at the end: Luke didn't just pull "special moves" out of his ass: he remembered what he'd been trained in earlier in the movie and utilized that to pull off the Death Star shot. And it only amounts to getting the timing right on pushing a firing button. He didn't warp reality or anything the way Rey constantly does. The ANH movie also makes sure to point out multiple times that Luke owned a speeder (which would have been paid for by his family), used it for target practice, and dreamed of becoming a pilot, so even the "he's a good pilot" parts are completely foreshadowed and believable, unlike Rey, who's some junkyard orphan who can somehow fly anything better than anyone else, despite the fact that it's not believable in the slightest that she'd be able to get flight training. Sure they "explain" it in the supplementary material, but it's one of those completely bullshit "explanations" that only makes her more of a Mary Sue*.
*note, if you need convoluted backstory that's not in the movie to explain away why someone is otherwise inexplicably overpowered, they're a Mary Sue. That's what Mary Sues do: they have convoluted unlikely backstories to explain away how awesome they are at everything. Luke's backstory is much more sedate and believable than Rey's, even given that Rey didn't have "special" parents. Luke's dad was Anakin: that's neither here nor there, parentage alone doesn't make you a Mary Sue. After all, Anakin is someone they made up for the story, and everyone has a father. Luke loved piloting. Again, believable, as e.g. separated twins sometimes have the same hobbies: it's believable that Luke would aspire to be a pilot, even not knowing that his real father was one. Luke has latent force powers. Again, that could make you a Mary Sue, however, Luke is shown constantly struggling to manifest those powers in a meaningful way.
By the second movie, Luke is shown to be able to retrieve his lightsaber using the Force, but watch how he needs to go all meditative and concentrate before he can pull it off. Several years had passed between the first and second movies, and Luke had been diligently training his Force skills based on what he learned from Obi Wan the whole time. The scene in the ice cave is therefore well-written because of what it says without any words: Luke's entire attitude displays that of someone trying to manifest a skill they've spent a long time trying to master.
Luke fails e.g. when he's unable to raise the X-Wing on Dagobah. Yoda has to save his ass: and Luke isn't ever shown actually pulling that trick off: the scene doesn't exist to showcase how awesome Luke is, but to underline how far he still has to go. That makes it all the more empowering when the competent and mature third movie Luke does his stuff. Lucas planned for the long haul. Rey on the other hand succeeds wherever Luke failed, either soon after seeing a trick done, or even before she knows the trick should exist.