about summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-11-19 03:00:46 +0000
committerbors <bors@rust-lang.org>2021-11-19 03:00:46 +0000
commitce3f3a5ffa7452131cde06c003cc2eaa7c729bfb (patch)
tree6c0492edfde76c9496cf09fcc6500f0c0f59fdda /compiler/rustc_session/src
parent548c1088eff51fd92ad94d56b8c5b2d48b7088f0 (diff)
parent6ad626fb5c79bbaafcf533780e30b03d73737c57 (diff)
downloadrust-ce3f3a5ffa7452131cde06c003cc2eaa7c729bfb.tar.gz
rust-ce3f3a5ffa7452131cde06c003cc2eaa7c729bfb.zip
Auto merge of #90329 - nbdd0121:typeck, r=nagisa
Try all stable method candidates first before trying unstable ones

Currently we try methods in this order in each step:
* Stable by value
* Unstable by value
* Stable autoref
* Unstable autoref
* ...

This PR changes it to first try pick methods without any unstable candidates, and if none is found, try again to pick unstable ones.

Fix #90320
CC #88971, hopefully would allow us to rename the "unstable_*" methods for integer impls back.

`@rustbot` label T-compiler T-libs-api
Diffstat (limited to 'compiler/rustc_session/src')
-rw-r--r--compiler/rustc_session/src/options.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 2c217e40aba..cba05f6aa59 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -1240,6 +1240,8 @@ options! {
         and set the maximum total size of a const allocation for which this is allowed (default: never)"),
     perf_stats: bool = (false, parse_bool, [UNTRACKED],
         "print some performance-related statistics (default: no)"),
+    pick_stable_methods_before_any_unstable: bool = (true, parse_bool, [TRACKED],
+        "try to pick stable methods first before picking any unstable methods (default: yes)"),
     plt: Option<bool> = (None, parse_opt_bool, [TRACKED],
         "whether to use the PLT when calling into shared libraries;
         only has effect for PIC code on systems with ELF binaries