rust-lang / discord-mods-bot

discord moderation bot
MIT License
72 stars 30 forks source link

Better code handling in ?eval #70

Closed technetos closed 3 years ago

technetos commented 3 years ago

Prevent users from passing code containing fn main to play.rust-lang.org and inform them about the error.

technetos commented 3 years ago

This has some degree of vulnerability to false positives.... but I think it's safe enough.

Yeah its problematic if someone puts in code that happens to contain fn main and its not intended to be run as fn main() { // their code } but actually part of // their code.