rust/compiler
Guillaume Gomez bdd70622e2
Rollup merge of #85709 - Aaron1011:fix-pat-crate-edition, r=petrochenkov
Use correct edition when parsing `:pat` matchers

As described in issue #85708, we currently do not properly decode
`SyntaxContext::root()` and `ExpnId::root()` from foreign crates. As a
result, when we decode a span from a foreign crate with
`SyntaxContext::root()`, we end up up considering it to have the edition
of the *current* crate, instead of the foreign crate where it was
originally created.

A full fix for this issue will be a fairly significant undertaking.
Fortunately, it's possible to implement a partial fix, which gives us
the correct edition-dependent behavior for `:pat` matchers when the
macro is loaded from another crate. Since we have the edition of the
macro's defining crate available, we can 'recover' from seeing a
`SyntaxContext::root()` and use the edition of the macro's defining
crate.

Any solution to issue #85708 must reproduce the behavior of this
targeted fix - properly preserving a foreign `SyntaxContext::root()`
means (among other things) preserving its edition, which by definition
is the edition of the foreign crate itself. Therefore, this fix moves us
closer to the correct overall solution, and does not expose any new
incorrect behavior to macros.
2021-05-30 21:06:44 +02:00
..
rustc
rustc_apfloat remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_arena
rustc_ast Specialize implementations 2021-05-26 18:07:09 -04:00
rustc_ast_lowering remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_ast_passes
rustc_ast_pretty remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_attr remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_builtin_macros remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_codegen_cranelift Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into sync_cg_clif-2021-05-27 2021-05-27 13:08:14 +02:00
rustc_codegen_llvm Fix static relocation model for PowerPC64 2021-05-28 03:48:39 +02:00
rustc_codegen_ssa Rollup merge of #85649 - ChrisDenton:update-cc, r=matthewjasper 2021-05-27 03:02:09 +02:00
rustc_data_structures Don't panic when failing to initialize incremental directory. 2021-05-25 14:40:33 -07:00
rustc_driver
rustc_error_codes
rustc_errors
rustc_expand Use correct edition when parsing :pat matchers 2021-05-29 13:09:14 -05:00
rustc_feature stabilize member constraints 2021-05-26 06:01:53 -04:00
rustc_fs_util
rustc_graphviz
rustc_hir Fix test 2021-05-30 12:51:36 +02:00
rustc_hir_pretty remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_incremental Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_index Unify feature flags as step_trait 2021-05-26 18:07:10 -04:00
rustc_infer Specialize implementations 2021-05-26 18:07:09 -04:00
rustc_interface Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_lexer
rustc_lint Lint against non-camelCase trait alias names 2021-05-26 19:55:27 -04:00
rustc_lint_defs
rustc_llvm Update cc 2021-05-24 23:34:12 +01:00
rustc_macros
rustc_metadata Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_middle Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_mir Auto merge of #83772 - jhpratt:revamp-step-trait, r=Mark-Simulacrum 2021-05-30 01:21:39 +00:00
rustc_mir_build Auto merge of #83772 - jhpratt:revamp-step-trait, r=Mark-Simulacrum 2021-05-30 01:21:39 +00:00
rustc_parse remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_parse_format remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_passes Specialize implementations 2021-05-26 18:07:09 -04:00
rustc_plugin_impl
rustc_privacy remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_query_impl Auto merge of #85319 - cjgillot:query-simp, r=Mark-Simulacrum 2021-05-30 10:11:23 +00:00
rustc_query_system Auto merge of #85319 - cjgillot:query-simp, r=Mark-Simulacrum 2021-05-30 10:11:23 +00:00
rustc_resolve Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_save_analysis Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_serialize
rustc_session Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_span Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_symbol_mangling Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_target Specialize implementations 2021-05-26 18:07:09 -04:00
rustc_trait_selection stabilize member constraints 2021-05-26 06:01:53 -04:00
rustc_traits
rustc_ty_utils Merge CrateDisambiguator into StableCrateId 2021-05-30 12:51:34 +02:00
rustc_type_ir Specialize implementations 2021-05-26 18:07:09 -04:00
rustc_typeck Auto merge of #84968 - FabianWolff:master, r=estebank 2021-05-28 03:38:28 +00:00