rust/compiler
Matthias Krüger 6d58ff7fe6
Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkov
Check uniqueness of impl items by trait item when applicable.

When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items.  This means that a plain item and one generated by a macro 2.0 do not collide.

This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls.

This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice.

There should be no stable breakage, since macros 2.0 are still unstable.

r? ``@petrochenkov``
cc ``@RalfJung``

Fixes https://github.com/rust-lang/rust/issues/71614.
2022-10-11 18:59:45 +02:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Rollup merge of #102868 - compiler-errors:rename-assoc-tyalias-to-ty, r=TaKO8Ki 2022-10-10 13:43:43 +05:30
rustc_ast_lowering Rename AssocItemKind::TyAlias to AssocItemKind::Type 2022-10-10 02:31:37 +00:00
rustc_ast_passes Rollup merge of #102868 - compiler-errors:rename-assoc-tyalias-to-ty, r=TaKO8Ki 2022-10-10 13:43:43 +05:30
rustc_ast_pretty Rename AssocItemKind::TyAlias to AssocItemKind::Type 2022-10-10 02:31:37 +00:00
rustc_attr Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_borrowck Rollup merge of #99818 - aliemjay:fix-closure-normalize, r=jackh726 2022-10-08 18:14:59 -07:00
rustc_builtin_macros Rename AssocItemKind::TyAlias to AssocItemKind::Type 2022-10-10 02:31:37 +00:00
rustc_codegen_cranelift Remove mir::CastKind::Misc 2022-10-06 15:32:41 +03:00
rustc_codegen_gcc Remove type argument of array_alloca and rename to byte_array_alloca 2022-10-02 13:42:14 +00:00
rustc_codegen_llvm Rollup merge of #102725 - nnethercote:rm-Z-time, r=davidtwco 2022-10-06 16:29:45 +02:00
rustc_codegen_ssa Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obk 2022-10-08 14:38:18 +02:00
rustc_const_eval Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obk 2022-10-08 14:38:18 +02:00
rustc_data_structures Rollup merge of #102725 - nnethercote:rm-Z-time, r=davidtwco 2022-10-06 16:29:45 +02:00
rustc_driver Remove -Ztime option. 2022-10-06 15:49:44 +11:00
rustc_error_codes Cleanup some error code explanations 2022-10-03 08:53:06 +02:00
rustc_error_messages Rollup merge of #102718 - compiler-errors:opaque-bound-lint-ice, r=fee1-dead 2022-10-06 16:29:44 +02:00
rustc_errors Fix doc lint error 2022-10-10 18:28:29 +02:00
rustc_expand Temporarily reinstate doctest=false 2022-10-05 09:53:49 +09:00
rustc_feature Stabilize half_open_range_patterns 2022-10-08 11:00:13 +02:00
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8Ki 2022-10-10 00:09:42 +09:00
rustc_hir_analysis Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkov 2022-10-11 18:59:45 +02:00
rustc_hir_pretty Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8Ki 2022-10-10 00:09:42 +09:00
rustc_incremental Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8Ki 2022-10-10 00:09:42 +09:00
rustc_index Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_infer Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8Ki 2022-10-10 00:09:42 +09:00
rustc_interface Move lifetime resolution module to rustc_hir_analysis. 2022-10-10 17:40:52 +00:00
rustc_lexer Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_lint Rollup merge of #102868 - compiler-errors:rename-assoc-tyalias-to-ty, r=TaKO8Ki 2022-10-10 13:43:43 +05:30
rustc_lint_defs Auto merge of #100720 - camsteffen:representable, r=cjgillot 2022-10-08 11:53:25 +00:00
rustc_llvm Avoid LLVM-deprecated Optional::hasValue 2022-09-26 16:51:18 -07:00
rustc_log
rustc_macros errors: rename typeck.ftl to hir_analysis.ftl 2022-10-03 13:52:17 +01:00
rustc_metadata Rewrite representability 2022-10-07 09:33:46 -05:00
rustc_middle Fix compiler docs 2022-10-10 18:28:29 +02:00
rustc_mir_build Rollup merge of #102853 - cjgillot:skip-opaque-cast, r=jackh726 2022-10-10 13:43:42 +05:30
rustc_mir_dataflow Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obk 2022-10-08 14:38:18 +02:00
rustc_mir_transform Rollup merge of #102778 - nbdd0121:mir, r=tmiasko 2022-10-08 14:38:19 +02:00
rustc_monomorphize Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_parse Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgr 2022-10-11 00:36:26 +00:00
rustc_parse_format Fix span of byte-escaped left format args brace 2022-09-28 13:47:17 -07:00
rustc_passes Rename AssocItemKind::TyAlias to AssocItemKind::Type 2022-10-10 02:31:37 +00:00
rustc_plugin_impl Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_privacy ImplItemKind::TyAlias => ImplItemKind::Type 2022-10-09 07:09:57 +00:00
rustc_query_impl Rewrite representability 2022-10-07 09:33:46 -05:00
rustc_query_system Rewrite representability 2022-10-07 09:33:46 -05:00
rustc_resolve Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkov 2022-10-11 18:59:45 +02:00
rustc_save_analysis ImplItemKind::TyAlias => ImplItemKind::Type 2022-10-09 07:09:57 +00:00
rustc_serialize remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_session Remove -Ztime option. 2022-10-06 15:49:44 +11:00
rustc_smir
rustc_span Rollup merge of #102860 - GuillaumeGomez:missing-docs-FileNameDisplayPreference, r=nagisa 2022-10-10 10:23:05 +09:00
rustc_symbol_mangling Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_target rustc_target: Refactor internal linker flavors 2022-10-06 13:41:12 +04:00
rustc_trait_selection Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgr 2022-10-11 00:36:26 +00:00
rustc_traits Change InferCtxtBuilder from enter to build 2022-10-07 07:10:40 -05:00
rustc_transmute Remove TypeckResults from InferCtxt 2022-10-07 07:06:19 -05:00
rustc_ty_utils Rollup merge of #102786 - compiler-errors:no-tuple-candidate, r=lcnr 2022-10-10 13:43:41 +05:30
rustc_type_ir Remove from compiler/ crates 2022-09-29 16:49:04 +09:00