about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-05-01 16:52:03 +0800
committerkennytm <kennytm@gmail.com>2018-05-01 16:54:25 +0800
commita78028d742e80002feca0be67a5f4f8ce183c82b (patch)
tree7aa4fa2dab9b17b98f7df2d18b4aad78c40bfe71
parent491512ba1ed37a20b514c216c3eddaa732689de9 (diff)
downloadrust-a78028d742e80002feca0be67a5f4f8ce183c82b.tar.gz
rust-a78028d742e80002feca0be67a5f4f8ce183c82b.zip
Clarify wordings of the `unstable_name_collision` lint.
Stabilizing an inherent method may cause change in behavior instead of
inference error. Updated to use the wording from [varkor's comment].

Closes #50232.

[varkor's comment]: https://github.com/rust-lang/rust/issues/50232#issuecomment-384678097
-rw-r--r--src/librustc/lint/mod.rs2
-rw-r--r--src/test/ui/inference_unstable.rs2
-rw-r--r--src/test/ui/inference_unstable.stderr2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs
index 0d4fd99995f..d6c6f9dc0f6 100644
--- a/src/librustc/lint/mod.rs
+++ b/src/librustc/lint/mod.rs
@@ -507,7 +507,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
 
         let explanation = if lint_id == LintId::of(::lint::builtin::UNSTABLE_NAME_COLLISION) {
             "once this method is added to the standard library, \
-             there will be ambiguity here, which will cause a hard error!"
+             the ambiguity may cause an error or change in behavior!"
                 .to_owned()
         } else if let Some(edition) = future_incompatible.edition {
             format!("{} in the {} edition!", STANDARD_MESSAGE, edition)
diff --git a/src/test/ui/inference_unstable.rs b/src/test/ui/inference_unstable.rs
index 816c443a06c..5a70dffd4c8 100644
--- a/src/test/ui/inference_unstable.rs
+++ b/src/test/ui/inference_unstable.rs
@@ -25,5 +25,5 @@ use inference_unstable_itertools::IpuItertools;
 fn main() {
     assert_eq!('x'.ipu_flatten(), 1);
     //~^ WARN a method with this name may be added to the standard library in the future
-    //~^^ WARN once this method is added to the standard library, there will be ambiguity here
+    //~^^ WARN once this method is added to the standard library, the ambiguity may cause an error
 }
diff --git a/src/test/ui/inference_unstable.stderr b/src/test/ui/inference_unstable.stderr
index 9c614d659d3..a217bc57b36 100644
--- a/src/test/ui/inference_unstable.stderr
+++ b/src/test/ui/inference_unstable.stderr
@@ -5,7 +5,7 @@ LL |     assert_eq!('x'.ipu_flatten(), 1);
    |                    ^^^^^^^^^^^
    |
    = note: #[warn(unstable_name_collision)] on by default
-   = warning: once this method is added to the standard library, there will be ambiguity here, which will cause a hard error!
+   = warning: once this method is added to the standard library, the ambiguity may cause an error or change in behavior!
    = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
    = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method
    = note: add #![feature(ipu_flatten)] to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`