rust/compiler
bors f42888c15f Auto merge of #82436 - osa1:issue80258, r=nikomatsakis
Allow calling *const methods on *mut values

This allows `*const` methods to be called on `*mut` values.

TODOs:

- [x] ~~Remove debug logs~~ Done.
- [x] ~~I haven't tested, but I think this currently won't work when the `self` value has type like `&&&&& *mut X` because I don't do any autoderefs when probing. To fix this the new code in `rustc_typeck::check::method::probe` needs to reuse `pick_method` somehow as I think that's the function that autoderefs.~~ This works, because autoderefs are done before calling `pick_core`, in `method_autoderef_steps`, called by `probe_op`.
- [x] ~~I should probably move the new `Pick` to `pick_autorefd_method`. If not, I should move it to its own function.~~ Done.
- [ ] ~~Test this with a `Pick` with `to_ptr = true` and `unsize = true`.~~ I think this case cannot happen, because we don't have any array methods with `*mut [X]` receiver. I should confirm that this is true and document this. I've placed two assertions about this.
- [x] ~~Maybe give `(Mutability, bool)` a name and fields~~ I now have a `to_const_ptr` field in `Pick`.
- [x] ~~Changes in `adjust_self_ty` is quite hacky. The problem is we can't deref a pointer, and even if we don't have an adjustment to get the address of a value, so to go from `*mut` to `*const` we need a special case.~~ There's still a special case for `to_const_ptr`, but I'm not sure if we can avoid this.
- [ ] Figure out how `reached_raw_pointer` stuff is used. I suspect only for error messages.

Fixes #80258
2021-03-13 04:38:39 +00:00
..
rustc Rollup merge of #82642 - sfackler:jemalloc-zone, r=pnkfelix 2021-03-08 13:13:22 +01:00
rustc_apfloat bumped smallvec deps 2021-02-14 18:03:11 +03:00
rustc_arena Update the bootstrap compiler 2021-02-20 17:19:30 -05:00
rustc_ast Rollup merge of #82841 - hvdijk:x32, r=joshtriplett 2021-03-09 09:05:24 +00:00
rustc_ast_lowering Rollup merge of #82984 - camsteffen:lower-block, r=cjgillot 2021-03-13 09:44:42 +09:00
rustc_ast_passes rustc_target: add "unwind" payloads to Abi 2021-03-09 14:38:29 -05:00
rustc_ast_pretty Rollup merge of #82238 - petrochenkov:nocratemod, r=Aaron1011 2021-02-19 02:49:08 +01:00
rustc_attr Auto merge of #71481 - estebank:inherit-stability, r=nikomatsakis 2021-03-05 05:28:07 +00:00
rustc_builtin_macros Rollup merge of #82217 - m-ou-se:edition-prelude, r=nikomatsakis 2021-03-10 17:55:38 +01:00
rustc_codegen_cranelift Auto merge of #76570 - cratelyn:implement-rfc-2945-c-unwind-abi, r=Amanieu 2021-03-10 16:44:04 +00:00
rustc_codegen_llvm Remove the -Zinsert-sideeffect 2021-03-10 12:21:43 +02:00
rustc_codegen_ssa Rollup merge of #83020 - hi-rustin:rustin-patch-enum, r=lcnr 2021-03-13 09:44:44 +09:00
rustc_data_structures Auto merge of #82641 - camelid:lang-item-docs, r=jyn514 2021-03-11 06:38:22 +00:00
rustc_driver Add -Z unpretty flag for the THIR 2021-03-11 19:42:40 +01:00
rustc_error_codes Rollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomez 2021-03-04 20:01:01 +09:00
rustc_errors Change x64 size checks to not apply to x32. 2021-03-06 16:02:48 +00:00
rustc_expand Auto merge of #82422 - petrochenkov:allunst, r=oli-obk 2021-03-12 11:46:50 +00:00
rustc_feature Auto merge of #76570 - cratelyn:implement-rfc-2945-c-unwind-abi, r=Amanieu 2021-03-10 16:44:04 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir Auto merge of #82641 - camelid:lang-item-docs, r=jyn514 2021-03-11 06:38:22 +00:00
rustc_hir_pretty Use BTreeMap to store attributes. 2021-03-09 19:28:01 +01:00
rustc_incremental Deduplicate unchecked_attrs errors. 2021-03-09 19:28:00 +01:00
rustc_index Remove useless Clone bound in IndexVec. 2021-03-09 18:51:36 +01:00
rustc_infer Change x64 size checks to not apply to x32. 2021-03-06 16:02:48 +00:00
rustc_interface Auto merge of #82884 - nagisa:nagisa/remove-most-of-sideeffect-inserts, r=nikic 2021-03-10 14:03:00 +00:00
rustc_lexer
rustc_lint Track HirId when visiting attributes. 2021-03-09 19:27:59 +01:00
rustc_lint_defs Rollup merge of #79208 - LeSeulArtichaut:stable-unsafe_op_in_unsafe_fn, r=nikomatsakis 2021-03-10 08:01:25 +09:00
rustc_llvm Support merge_functions option in NewPM since LLVM >= 12 2021-03-12 08:16:10 +09:00
rustc_macros replaced some map_or with map_or_else 2021-02-24 02:43:35 +03:00
rustc_metadata Remove hir::Item::attrs. 2021-03-09 19:27:50 +01:00
rustc_middle Auto merge of #82964 - Nicholas-Baron:shorten_middle_ty, r=jackh726 2021-03-11 04:09:44 +00:00
rustc_mir Auto merge of #82935 - henryboisdequin:diagnostic-cleanups, r=estebank 2021-03-12 09:05:38 +00:00
rustc_mir_build Rollup merge of #83018 - oli-obk:float_check, r=davidtwco 2021-03-12 08:55:22 +09:00
rustc_parse Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov 2021-03-09 09:05:20 +00:00
rustc_parse_format parse_format: treat r" as a literal 2021-02-06 15:01:07 +00:00
rustc_passes Track HirId when visiting attributes. 2021-03-09 19:27:59 +01:00
rustc_plugin_impl Remove hir::Item::attrs. 2021-03-09 19:27:50 +01:00
rustc_privacy Remove hir::MacroDef::attrs. 2021-03-09 19:09:36 +01:00
rustc_query_impl Simplify hashing. 2021-02-21 12:22:22 +01:00
rustc_query_system Simplify hashing. 2021-02-21 12:22:22 +01:00
rustc_resolve Auto merge of #79519 - cjgillot:noattr, r=wesleywiser 2021-03-10 08:40:51 +00:00
rustc_save_analysis Remove hir::Item::attrs. 2021-03-09 19:27:50 +01:00
rustc_serialize Update the bootstrap compiler 2021-02-20 17:19:30 -05:00
rustc_session Add -Z unpretty flag for the THIR 2021-03-11 19:42:40 +01:00
rustc_span Auto merge of #82982 - Dylan-DPC:rollup-mt497z7, r=Dylan-DPC 2021-03-10 19:12:53 +00:00
rustc_symbol_mangling rustc_target: add "unwind" payloads to Abi 2021-03-09 14:38:29 -05:00
rustc_target Auto merge of #82982 - Dylan-DPC:rollup-mt497z7, r=Dylan-DPC 2021-03-10 19:12:53 +00:00
rustc_trait_selection Auto merge of #82935 - henryboisdequin:diagnostic-cleanups, r=estebank 2021-03-12 09:05:38 +00:00
rustc_traits Fix tests 2021-03-03 11:22:44 +01:00
rustc_ty_utils Auto merge of #82159 - BoxyUwU:uwu, r=varkor 2021-02-24 21:54:52 +00:00
rustc_type_ir New pass to deduplicate blocks 2021-02-21 21:51:54 +01:00
rustc_typeck Auto merge of #82436 - osa1:issue80258, r=nikomatsakis 2021-03-13 04:38:39 +00:00