Stream: t-compiler/wg-diagnostics

Topic: meeting 2019-05-24


oli (May 24 2019 at 16:00, on Zulip):

Hey @WG-diagnostics we're having a meeting in two hours right here

oli (May 24 2019 at 17:56, on Zulip):

I've started creating a hackmd script for us to follow for meetings: https://hackmd.io/T9yQwLQ0SIOguR1auo3SHQ

oli (May 24 2019 at 18:00, on Zulip):

@WG-diagnostics meeting time :mantelpiece_clock:

Esteban Küber (May 24 2019 at 18:00, on Zulip):

Should we reuse the old https://github.com/rust-lang/rust/labels/WG-compiler-errors?

Esteban Küber (May 24 2019 at 18:00, on Zulip):

or rename it at least?

oli (May 24 2019 at 18:01, on Zulip):

huh, I didn't know that existed

Esteban Küber (May 24 2019 at 18:01, on Zulip):

It was used by me to gather things I thought I could get to, mostly :grimacing:

Esteban Küber (May 24 2019 at 18:01, on Zulip):

it's super old and no one other than me ever used it

oli (May 24 2019 at 18:01, on Zulip):

do we need a WG label (since A-diagnostics exists)?

davidtwco (May 24 2019 at 18:02, on Zulip):

I’m not sure we’d need a label. Unless we feel there’s value in separating tasks from this from general diagnostic improvements.

oli (May 24 2019 at 18:02, on Zulip):

hmm... ok about that I have an idea

Esteban Küber (May 24 2019 at 18:02, on Zulip):

probably not, but I'd like to start categorizing in two axis using the existing A-diagnostics:
easy <-> hard
nice-to-have <-> urgent

oli (May 24 2019 at 18:02, on Zulip):

so I've checked, we have a few priority labels on A-diagnostics

oli (May 24 2019 at 18:02, on Zulip):

around 5-10% or so have a priority label

oli (May 24 2019 at 18:03, on Zulip):

we have no P-high, so that's good xD

Esteban Küber (May 24 2019 at 18:03, on Zulip):

mostly low, I'd assume

oli (May 24 2019 at 18:03, on Zulip):

we have 18 P-medium: https://github.com/rust-lang/rust/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3AA-diagnostics+label%3AP-medium

oli (May 24 2019 at 18:03, on Zulip):

and 700 unlabeled

oli (May 24 2019 at 18:04, on Zulip):

:shock:

oli (May 24 2019 at 18:04, on Zulip):

that means around 15% of all Rust issues are diagnostics issues

oli (May 24 2019 at 18:05, on Zulip):

I think we can use priority labels for nice-to-have <-> urgent

oli (May 24 2019 at 18:06, on Zulip):

how do y'all feel about doing a quick triage of P-medium? Downvote means we should go into our main WG goals first.

oli (May 24 2019 at 18:08, on Zulip):

(this is also about future meetings, I'll change the order in the hackmd accordingly)

Esteban Küber (May 24 2019 at 18:08, on Zulip):

(In that case +1)

davidtwco (May 24 2019 at 18:08, on Zulip):

If we do triage first then in future meetings it won’t take as long at the start of future meetings.

oli (May 24 2019 at 18:09, on Zulip):

right

oli (May 24 2019 at 18:09, on Zulip):

Ok, let's go through them quickly then

oli (May 24 2019 at 18:09, on Zulip):

https://github.com/rust-lang/rust/issues/22750 Two different versions of a crate interacting leads to unhelpful error messages

oli (May 24 2019 at 18:09, on Zulip):

very old

oli (May 24 2019 at 18:10, on Zulip):

Medium seems ok, since this is not just nice to have, it really helps with figuring out the problem

oli (May 24 2019 at 18:10, on Zulip):

leaving at medium

oli (May 24 2019 at 18:11, on Zulip):

https://github.com/rust-lang/rust/issues/23286 Very confusing error on attempt to pass path::Path by value

Esteban Küber (May 24 2019 at 18:11, on Zulip):

Still far from ideal, and would love to revisit it, but it is E-hard :-/

Esteban Küber (May 24 2019 at 18:12, on Zulip):

(like everything around E0277)

Esteban Küber (May 24 2019 at 18:12, on Zulip):

removing E-mentor because it'll be a huge undertaking for anyone to actually fix this

oli (May 24 2019 at 18:12, on Zulip):

ok, so I'll add E-hard, too

oli (May 24 2019 at 18:13, on Zulip):

https://github.com/rust-lang/rust/issues/23980 Coherence error messages can be inscrutable

oli (May 24 2019 at 18:13, on Zulip):

wow, has like 10 PRs mentioning it

oli (May 24 2019 at 18:14, on Zulip):

ok, also seems E-hard, I'm not sure where to even start

oli (May 24 2019 at 18:14, on Zulip):

https://github.com/rust-lang/rust/issues/32777 Add error explanations for all error codes

oli (May 24 2019 at 18:15, on Zulip):

meta issue, nothing to see here, is that really P-medium?

Esteban Küber (May 24 2019 at 18:15, on Zulip):

I think the checkmarks are not up to date

Esteban Küber (May 24 2019 at 18:15, on Zulip):

I think it is fine, as it isn't critical but makes to the general experience

Esteban Küber (May 24 2019 at 18:15, on Zulip):

It's already tagged T-doc as well, which I feel is appropriate

oli (May 24 2019 at 18:16, on Zulip):

yea, also assigned, let's leave it at that

oli (May 24 2019 at 18:16, on Zulip):

left a comment

oli (May 24 2019 at 18:16, on Zulip):

https://github.com/rust-lang/rust/issues/34421 error message for macro in wrong context is missing context

oli (May 24 2019 at 18:18, on Zulip):

somewhat hard to decipher the problem

Esteban Küber (May 24 2019 at 18:18, on Zulip):

All of the macro errors need a revamp

oli (May 24 2019 at 18:18, on Zulip):

so... P-medium seems ok

Esteban Küber (May 24 2019 at 18:19, on Zulip):

but I don't think it is medium

Esteban Küber (May 24 2019 at 18:19, on Zulip):

it might even be fixed given the current output

oli (May 24 2019 at 18:19, on Zulip):

jseyfried wants there to be a note about expressions not being items

Esteban Küber (May 24 2019 at 18:19, on Zulip):

Yeah, and there's no complaint about B either..

Esteban Küber (May 24 2019 at 18:19, on Zulip):

still don't think it's medium

oli (May 24 2019 at 18:20, on Zulip):

so users actually know what's going on, because it seems they are trying to create an item

oli (May 24 2019 at 18:20, on Zulip):

ok

oli (May 24 2019 at 18:21, on Zulip):

https://github.com/rust-lang/rust/issues/42226 Unclear errors with type annotations on functions instead of their traits

Esteban Küber (May 24 2019 at 18:22, on Zulip):

Medium, tag as diagnostic-suggestions too

oli (May 24 2019 at 18:23, on Zulip):

overflow during drop-check on a recursive type #44933

oli (May 24 2019 at 18:24, on Zulip):

P-low imo, or at least E-hard

oli (May 24 2019 at 18:25, on Zulip):

marking as hard, continue

Esteban Küber (May 24 2019 at 18:25, on Zulip):

Both, I'd say

oli (May 24 2019 at 18:26, on Zulip):

done

oli (May 24 2019 at 18:26, on Zulip):

rustc recommends specialization for type parameters inside an extern block #45092

Esteban Küber (May 24 2019 at 18:27, on Zulip):

P-low, A-diagnostic-suggestions

oli (May 24 2019 at 18:27, on Zulip):

huh, is that literally just explaining more in the message?

oli (May 24 2019 at 18:27, on Zulip):

so E-easy, too?

Esteban Küber (May 24 2019 at 18:27, on Zulip):

E-medium, I think, if we want to actually suggest replacing the T with a concrete type

Esteban Küber (May 24 2019 at 18:27, on Zulip):

but easy if only wording

oli (May 24 2019 at 18:29, on Zulip):

you'd have to look at the callers to do that

oli (May 24 2019 at 18:29, on Zulip):

and there probably aren't any yet

oli (May 24 2019 at 18:29, on Zulip):

Pattern errors are too imprecise and should be removed in favor of MIR borrowck #45600

Esteban Küber (May 24 2019 at 18:29, on Zulip):

yeah, let's leave it at wording change

oli (May 24 2019 at 18:30, on Zulip):

ooh, that one was in T-compiler some time ago

oli (May 24 2019 at 18:30, on Zulip):

let's leave it as is, but marking as E-medium

oli (May 24 2019 at 18:31, on Zulip):

No docs for error code E0280 #50028

oli (May 24 2019 at 18:31, on Zulip):

seems like this belongs into the big docs issue

Esteban Küber (May 24 2019 at 18:31, on Zulip):

E-easy, link from the tracking issue

oli (May 24 2019 at 18:32, on Zulip):

closing, there's a checkbox in the tracking issue

oli (May 24 2019 at 18:33, on Zulip):

cannot infer an appropriate lifetime for pattern should have fix suggestions #50195

oli (May 24 2019 at 18:34, on Zulip):

pasted current output

oli (May 24 2019 at 18:34, on Zulip):

still needs a suggestion on how to resolve the error I guess?

oli (May 24 2019 at 18:35, on Zulip):

leaving as is, will revisit

oli (May 24 2019 at 18:35, on Zulip):

Unclear "cannot infer" error message instead of expected "cannot move out of borrowed content" #51759

oli (May 24 2019 at 18:36, on Zulip):

hmm... wontfix?

Esteban Küber (May 24 2019 at 18:36, on Zulip):

I was inclined at that

Esteban Küber (May 24 2019 at 18:37, on Zulip):

given matthew's comment

oli (May 24 2019 at 18:39, on Zulip):

ack

oli (May 24 2019 at 18:39, on Zulip):

NLL: Poor borrow checker error message when extension of borrow happens indirectly (e.g. via method) #54256

oli (May 24 2019 at 18:40, on Zulip):

we could state why a mutable borrow is happening

oli (May 24 2019 at 18:40, on Zulip):

not just "mutable borrow occurs here"

Esteban Küber (May 24 2019 at 18:42, on Zulip):

that sounds reasonable, I would mark this E-medium or E-hard to discourage newcomers from jumping in blind

Esteban Küber (May 24 2019 at 18:43, on Zulip):

It should probably add a new span pointing at the right spot in loops

oli (May 24 2019 at 18:43, on Zulip):

jop

oli (May 24 2019 at 18:43, on Zulip):

Compiler panic using 'static_assertions' #54327

davidtwco (May 24 2019 at 18:44, on Zulip):

Maybe edit the title?

oli (May 24 2019 at 18:44, on Zulip):

blocked on lazy norm, ignoring

Esteban Küber (May 24 2019 at 18:44, on Zulip):

should we keep the diagnostics label?

davidtwco (May 24 2019 at 18:45, on Zulip):

On mobile, is it still an ICE or is that fixed and it’s just a diagnostics improvement?

davidtwco (May 24 2019 at 18:45, on Zulip):

(assumed the latter, hence suggesting a rename)

oli (May 24 2019 at 18:45, on Zulip):

still an ICE

davidtwco (May 24 2019 at 18:45, on Zulip):

Ignore me then.

oli (May 24 2019 at 18:45, on Zulip):

It's the default lazy norm ICE

oli (May 24 2019 at 18:46, on Zulip):

confusing error message around trait object bound #54779

oli (May 24 2019 at 18:46, on Zulip):

assigned, leaving as it is, will revisit

oli (May 24 2019 at 18:46, on Zulip):

nll: strange suggestion to "consider removing the * #54985

oli (May 24 2019 at 18:47, on Zulip):

E-easy, just remove the suggestion

oli (May 24 2019 at 18:47, on Zulip):

NLL accepts higher-ranked subtype that non-NLL rejects #57642

oli (May 24 2019 at 18:48, on Zulip):

not sure why marked as A-diagnostics

Esteban Küber (May 24 2019 at 18:48, on Zulip):

That doesn't seem like a diagnostic issue

Esteban Küber (May 24 2019 at 18:48, on Zulip):

yeah

oli (May 24 2019 at 18:49, on Zulip):

Infinite "recursive requirements" compiler error #60603

oli (May 24 2019 at 18:49, on Zulip):

while it's a diagnostics issue, this is actually a trait solver issue

oli (May 24 2019 at 18:50, on Zulip):

and the result of weird trait solving causes a bad diagnostic

oli (May 24 2019 at 18:50, on Zulip):

leaving as is, but adding E-hard

oli (May 24 2019 at 18:51, on Zulip):

wooo, done!

oli (May 24 2019 at 18:51, on Zulip):

next time I'll do pre-triage before the meeting

oli (May 24 2019 at 18:51, on Zulip):

now, let's get to business in the last 9 minutes: https://hackmd.io/T9yQwLQ0SIOguR1auo3SHQ

Esteban Küber (May 24 2019 at 18:51, on Zulip):

It's fine, from now on it should get faster and faster

oli (May 24 2019 at 18:51, on Zulip):

How are we doing on "Make diagnostics emitting independent of the happy code path"?

Esteban Küber (May 24 2019 at 18:52, on Zulip):

For Parser we're on track, everywhere else it's been piece meal

davidtwco (May 24 2019 at 18:52, on Zulip):

I’m somewhat out of the loop on what the plan has been to achieve these goals.

Esteban Küber (May 24 2019 at 18:52, on Zulip):

We need a more concerted "pack of locusts" approach on a per crate level

oli (May 24 2019 at 18:52, on Zulip):

IIRC @Esteban Küber suggested we'd create structs that have all data that's needed and put the actual diagnostic rendering code elsewhere?

davidtwco (May 24 2019 at 18:52, on Zulip):

Not sure if there was a meeting I missed here or at all hands.

oli (May 24 2019 at 18:53, on Zulip):

@davidtwco I think that was just some informal discussions

davidtwco (May 24 2019 at 18:53, on Zulip):

IIRC Esteban Küber suggested we'd create structs that have all data that's needed and put the actual diagnostic rendering code elsewhere?

I took that approach in some parts of NLL and felt it went well.

Esteban Küber (May 24 2019 at 18:53, on Zulip):

I think that rustc_errors should define a trait AsError { fn to_error(self) -> DiagnosticBuilder {} fn emit(self) {} }

Esteban Küber (May 24 2019 at 18:54, on Zulip):

and then each part of the compiler can make their own structs as needed and implement that trait

oli (May 24 2019 at 18:54, on Zulip):

needs a session for to_error, right?

Esteban Küber (May 24 2019 at 18:54, on Zulip):

I think so, yes

oli (May 24 2019 at 18:54, on Zulip):

or go through tls?

Esteban Küber (May 24 2019 at 18:54, on Zulip):

the problem is it depends on where in the compiler we are...
some times we only have a Session (or a ParseSess)

oli (May 24 2019 at 18:54, on Zulip):

so... emit is defaulted?

oli (May 24 2019 at 18:55, on Zulip):

heh, yea, maybe we need a trait for these, too in order to abstract away their API

Esteban Küber (May 24 2019 at 18:55, on Zulip):

didn't give it much thought ^_^

oli (May 24 2019 at 18:55, on Zulip):

bascially offer the Session API but just skip impossible parts in ParseSess

Esteban Küber (May 24 2019 at 18:55, on Zulip):

but my thinking is having each crate define their own builder structs

Esteban Küber (May 24 2019 at 18:56, on Zulip):
struct TypeError {
    expected: Ty,
    found: Ty,
    context: Option<_>,
    ...
}
oli (May 24 2019 at 18:56, on Zulip):

maybe we can start small and have an AsParseError and AsError trait for the different situations?

Esteban Küber (May 24 2019 at 18:56, on Zulip):

and then

let type_err = TypeError::new(expected, found).with_context(context).build().emit();
oli (May 24 2019 at 18:56, on Zulip):

we can think about merging later

Esteban Küber (May 24 2019 at 18:56, on Zulip):

sounds reasonable

oli (May 24 2019 at 18:57, on Zulip):

ok, seems like a plan. Any volunteers for writing up an issue from this convo? Otherwise I'll do it XD

davidtwco (May 24 2019 at 18:57, on Zulip):

It would be nice to define the “session” type as an associated type or something like that. I can imagine in some places you would want a TyCtxt, not just a Session, to get the type of a DefId for some kinds of error output.

oli (May 24 2019 at 18:58, on Zulip):

right

oli (May 24 2019 at 18:58, on Zulip):

ok, 2 minutes

oli (May 24 2019 at 18:58, on Zulip):

How are we doing on "Separate the diagnostics rendering from the compiler so it can be reused by others."

oli (May 24 2019 at 18:58, on Zulip):

there is https://crates.io/crates/annotate-snippets

oli (May 24 2019 at 18:59, on Zulip):

we should totally figure out how to use it even for just a few things

oli (May 24 2019 at 18:59, on Zulip):

maybe add a feature flag so we can alternate between the diagnostic emitters?

oli (May 24 2019 at 18:59, on Zulip):

not sure if that is even possible

oli (May 24 2019 at 18:59, on Zulip):

the way everything is entangled

davidtwco (May 24 2019 at 18:59, on Zulip):

Are there things that crate is missing that we’d need?

oli (May 24 2019 at 18:59, on Zulip):

probably, not sure

oli (May 24 2019 at 19:00, on Zulip):

I haven't looked too closely

Esteban Küber (May 24 2019 at 19:00, on Zulip):

We could fork and go back into the fold if that slows us down

Esteban Küber (May 24 2019 at 19:00, on Zulip):

but we should probably just bite the bullet and try it out

oli (May 24 2019 at 19:00, on Zulip):

oh, idea

oli (May 24 2019 at 19:00, on Zulip):

we can add a new kind of output format

oli (May 24 2019 at 19:01, on Zulip):

and see if we can just use it as a diagnostics renderer for now

oli (May 24 2019 at 19:01, on Zulip):

instead of going all in even with the builder frontend

Esteban Küber (May 24 2019 at 19:01, on Zulip):

mmm...
that should work

Esteban Küber (May 24 2019 at 19:01, on Zulip):

and decouple DiagnosticBuilder and the emitter more than now, I like it

oli (May 24 2019 at 19:01, on Zulip):

sounds like a plan

oli (May 24 2019 at 19:02, on Zulip):

meeting time is over! I'll open two issues for our "newly" "discovered" ideas

oli (May 24 2019 at 19:03, on Zulip):

I'll also try to setup a new meeting time planner

oli (May 24 2019 at 19:03, on Zulip):

thanks everyone!

Esteban Küber (May 24 2019 at 19:03, on Zulip):

for the later you could extend the exisitng annotated-snippets-rs ticket

Esteban Küber (May 24 2019 at 19:03, on Zulip):

thanks!

oli (May 24 2019 at 19:03, on Zulip):

will do, thanks, good idea

Last update: Nov 15 2019 at 10:25UTC