Stream: t-compiler

Topic: Reusing error codes


Esteban Küber (Dec 12 2019 at 16:45, on Zulip):

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.

davidtwco (Dec 12 2019 at 16:51, on Zulip):

Looks like it was commented out in June 2015 (#26503).

Esteban Küber (Dec 12 2019 at 17:02, on Zulip):

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)

pnkfelix (Dec 13 2019 at 14:27, on Zulip):

i personally recommend using a new error code

pnkfelix (Dec 13 2019 at 14:28, on Zulip):

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.

nikomatsakis (Dec 13 2019 at 14:50, on Zulip):

@Esteban Küber I do not believe that the "numbering" is meaningful in any particular way

nikomatsakis (Dec 13 2019 at 14:50, on Zulip):

So yes, what @pnkfelix said, I guess

Esteban Küber (Dec 13 2019 at 16:25, on Zulip):

FWIW, this is the code I wanted to add https://github.com/rust-lang/rust/pull/67268/files#diff-7f976ff24a89d1a1719487d8e7b1e5f7

Esteban Küber (Dec 13 2019 at 16:26, on Zulip):

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

varkor (Dec 17 2019 at 02:21, on Zulip):

people have mentioned it before, but has there been a serious discussion about moving to more meaningful (non-numeric) error codes?

simulacrum (Dec 17 2019 at 03:02, on Zulip):

@varkor you might be interested in https://github.com/rust-lang/rust/issues/67068

simulacrum (Dec 17 2019 at 03:03, on Zulip):

but I think the loose summary -- that I need to write up -- is "we have many existing users who use the current error codes"

simulacrum (Dec 17 2019 at 03:03, on Zulip):

that makes it hard to migrate/change effectively

simulacrum (Dec 17 2019 at 03:04, on Zulip):

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)

varkor (Dec 17 2019 at 22:16, on Zulip):

ah, I haven't been able to keep up with the meetings recently, thanks for writing that issue up

varkor (Dec 17 2019 at 22:17, on Zulip):

that makes sense

varkor (Dec 17 2019 at 22:17, on Zulip):

we probably ought to be stricter about how error codes are used now, because I think they have been repurposed in the past

varkor (Dec 17 2019 at 22:17, on Zulip):

but that was probably all discussed, so I'll catch up before adding anything else

simulacrum (Dec 17 2019 at 22:22, on Zulip):

we have not had any official meetings on this I think

simulacrum (Dec 17 2019 at 22:22, on Zulip):

just some ad-hoc discussion in discord

simulacrum (Dec 17 2019 at 22:22, on Zulip):

which didn't have all stakeholders present for sure

Last update: Jan 21 2020 at 08:20UTC