Closed CreepySkeleton closed 4 years ago
And in general, please only include style changes that are justified by the official Rust styleguide (i.e. what rustfmt does).
I didn't do any style adjustments except that one match () => if
, the blame is on rustfmt entirely :)
Here's an attempt to integrate rustfmt and make it match your code style. Unfortunately, those options are nightly, but who cares?
Of course it would be fine to use abort!
only but in most cases it's quite useful to keep working, looking for other errors to report. I tweaked the code in a way that functions return as late as possible, take a look.
knock knock @LukasKalbertodt
@CreepySkeleton Please excuse the delay, I have plenty of other stuff to do :( But I have not forgotten this and planned on completely reviewing this PR this week still!
Ugh, I must admit I completely forgot about this PR, sorry about it @LukasKalbertodt :( In my defense, nobody tried to ping me anyway.
I fixed all of the suggestions above If you sill have an appetite for this changes.
No problem for the delay ;-) Thanks for fixing everything! Great work with this PR.
This PR is on top of #59
Deleted files
diag.rs
: no need for it anymoreI also got rid of
emit_with_attr_note
, in my opinion it's just useless noise. If people have made use of#[auto_impl]
attribute they already know where it was requested, user wants to know where the error is.spanned.rs
: no need either. To be honest, your implementation was no better than the one fromproc_macro2
(if not worse). Anyway, you don't needproc_macro::Span
anymore -proc-macro-error
works withproc-macro2::Span
.I also added helpful notes where applicable, made some refactoring here and there (not much), fixed some typos.
I didn't touch some
panic!
invocations - they look like bug catching and this is just the job of panic. Some other panics were replaced withabort!
.Btw,
nightly
feature fromproc_macro2
doesn't really do anything, I suggest to remove it.Also, I would like to propose not to use
Trybuid::compile_pass
- it literally executes a separatecargo build
run for every each file which is slow.