I'm looking at making a new error that would naturally fit in between two existing codes (namely E0222). That one is commented out with
Error code E0045 (variadic function must have C or cdecl calling convention) duplicate. Googling around doesn't show any real results about it. It was never part of the index. The new error would be a more targeted subset of E0221 and E0224. Should I not worry and just use a new error code, even though that would put the documentation for it far away from related issues?
Normally I don't care, but in this case I'm tempted at reusing it.
Looks like it was commented out in June 2015 (#26503).
Indeed, it seems like one of those rare cases where there wouldn't be a real conflict (but as a matter of policy, it feels icky to mess around with this because I don't want to endorse doing this)
i personally recommend using a new error code
Its possible that we should have a hierarchy of error codes, but we don't, and I think error code reuse in the fashion you describe will only lead people to mistakenly think the numbers are significant.
@Esteban Küber I do not believe that the "numbering" is meaningful in any particular way
So yes, what @pnkfelix said, I guess
FWIW, this is the code I wanted to add https://github.com/rust-lang/rust/pull/67268/files#diff-7f976ff24a89d1a1719487d8e7b1e5f7
I would also like some holes poked into it because I feel that there should be more conditions for that one case to be triggered
people have mentioned it before, but has there been a serious discussion about moving to more meaningful (non-numeric) error codes?
@varkor you might be interested in https://github.com/rust-lang/rust/issues/67068
but I think the loose summary -- that I need to write up -- is "we have many existing users who use the current error codes"
that makes it hard to migrate/change effectively
and any new solution I think needs to be obviously and significantly better, because otherwise the existing is "too good" (due to being existing, not on its own merits)
ah, I haven't been able to keep up with the meetings recently, thanks for writing that issue up
that makes sense
we probably ought to be stricter about how error codes are used now, because I think they have been repurposed in the past
but that was probably all discussed, so I'll catch up before adding anything else
we have not had any official meetings on this I think
just some ad-hoc discussion in discord
which didn't have all stakeholders present for sure