Yes…I have been wanting to go over the NLL errors in particular and try to whittle down and reduce the amount of terminology involved.
One thing I have noticed in the compiler is that when the smart errors are wrong, they give too little information. For example, @tmandry was recently showing me this error:
error[E0621]: explicit lifetime required in the type of `tcx`
--> librustc_traits/implied_outlives_bounds.rs:43:5
|
37 | tcx: TyCtxt<'_, 'tcx, 'tcx>,
| --- consider changing the type of `tcx` to `rustc::ty::TyCtxt<'tcx, 'tcx, 'tcx>`
...
43 | / tcx.infer_ctxt()
44 | | .enter_canonical_trait_query(&goal, |infcx, fulfill_cx, key| {
45 | | let (param_env, ty) = key.into_parts();
46 | | compute_implied_outlives_bounds(&infcx, param_env, ty)
47 | | })
| |_________^ lifetime `'tcx` required
the problem here was that compute_implied_outlives_bounds had the wrong type (it was InferCtxt<'_, 'tcx, 'tcx> and should have been InferCtxt<'_, 'gcx, 'tcx>).
I think the compiler’s suggestion was good, but it would have been better if it could’ve included more tips on how it came to its conclusions.
This suggests to me that my premise of “specialized errors” is a bit flawed – that is, the ideal might be if more and more we can incorporate the specialized errors into the same basic framework for reporting region errors, so that we can also have information about how the compiler came to its conclusions.
Yeah, I’ve been going back and forth. I think my conclusion is sort of the same but I look at it differently. That is, giving them names is very hard, because it’s hard to find a wording for it. But if we can find a way to give them names, it’ll make almost everything easier.
That said, names like '1 seem like they are just going to be sort of inherently confusing, which is why I’ve been toying with using the variable name etc.
But still, without some anonymous names, I don’t know how to handle cases like identifying the second argument of TyCtxt<'_, '_, 'tcx>.