Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upFind a good place to document this thing #290
Comments
sgrif
added
good first issue
documentation
labels
Apr 20, 2016
This comment has been minimized.
gregcline
commented
Apr 30, 2016
|
Maybe it could go in the LoadDSL trait documentation here: http://docs.diesel.rs/diesel/prelude/trait.LoadDsl.html |
This comment has been minimized.
|
LoadDsl feels like a really weird place to document it, since this affects On Sat, Apr 30, 2016 at 5:00 AM gregcline notifications@github.com wrote:
|
killercup
added this to Contributors and internal docs
in Documentation
Feb 12, 2017
This comment has been minimized.
|
@sgrif Perhaps it would make sense to put it on this page somewhere? http://docs.diesel.rs/diesel/prelude/index.html It's a tad but awkward here too but seems closer? If you think this may sure, I can whip something up. Maybe on the bottom? Or above traits? @killercup @Eijebong, thoughts? |
This comment has been minimized.
|
Actually, I think it should go here: http://docs.diesel.rs/diesel/index.html Under a debugging section. I also think the main page should have more stuff. Rocket's main API docs page does a good job and mimicking their format would make diesel's API docs seem more inviting. |
This comment has been minimized.
|
I'm going to do the same thing that I did in #1343 to |
sgrif commentedApr 20, 2016
•
edited
TL;DR: UFCS can improve our error messages, and we should document this, but I'm not sure where the right place is.
Random trick for debugging when Diesel gives an unhelpful error message. Yesterday when I was implementing
QueryIdfor our entire AST, I got the following error for a node I had missed:(This is much noisier when your terminal is soft wrapping).
Unfortunately, Rust doesn't give the best error messages when the error is a "no method named x" that results from a trait not being implemented properly. The error is much more clear if we switch to UFCS.
By changing the code from:
to
the error message becomes:
Which gives the exact bound needed. This can be extremely useful for user code as well, though in those cases it's likely due to user error and not a missing constraint in Diesel (e.g. something missing
SelectableExpression). We should document this trick somewhere prominent, but I'm not sure where.