rust/compiler/rustc_expand/src
Matthias Krüger c52d58f346
Rollup merge of #105570 - Nilstrieb:actual-best-failure, r=compiler-errors
Properly calculate best failure in macro matching

Previously, we used spans. This was not good. Sometimes, the span of the token that failed to match may come from a position later in the file which has been transcribed into a token stream way earlier in the file. If precisely this token fails to match, we think that it was the best match because its span is so high, even though other arms might have gotten further in the token stream.

We now try to properly use the location in the token stream.

This needs a little cleanup as the `best_failure` field is getting out of hand but it should be mostly good to go. I hope I didn't violate too many abstraction boundaries..
2022-12-28 22:22:19 +01:00
..
mbe Rollup merge of #105570 - Nilstrieb:actual-best-failure, r=compiler-errors 2022-12-28 22:22:19 +01:00
mut_visit rustc_ast: Turn MutVisitor::token_visiting_enabled into a constant 2021-10-18 00:23:24 +03:00
parse Split MacArgs in two. 2022-11-22 09:04:15 +11:00
tokenstream Remove TokenStreamBuilder. 2022-10-05 12:42:54 +11:00
base.rs Auto merge of #105160 - nnethercote:rm-Lit-token_lit, r=petrochenkov 2022-12-12 05:16:50 +00:00
build.rs Recover fn keyword as Fn trait in bounds 2022-12-27 06:14:46 +00:00
config.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
errors.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
expand.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
lib.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
mbe.rs Move macro_rules diagnostics to diagnostics module 2022-11-20 13:06:44 +01:00
module.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
placeholders.rs Split MacArgs in two. 2022-11-22 09:04:15 +11:00
proc_macro_server.rs Remove three uses of LitKind::synthesize_token_lit. 2022-12-05 16:33:20 +11:00
proc_macro.rs Add the #[derive_const] attribute 2022-09-20 11:57:58 +00:00
tests.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00