]> git.lizzy.rs Git - rust.git/commitdiff
Clarify wordings of the `unstable_name_collision` lint.
authorkennytm <kennytm@gmail.com>
Tue, 1 May 2018 08:52:03 +0000 (16:52 +0800)
committerkennytm <kennytm@gmail.com>
Tue, 1 May 2018 08:54:25 +0000 (16:54 +0800)
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

src/librustc/lint/mod.rs
src/test/ui/inference_unstable.rs
src/test/ui/inference_unstable.stderr

index 0d4fd99995f7ed2d57d4fefe61d16cb20ab4b28f..d6c6f9dc0f61a0b1e5c72fee9af09b4b2634d6e3 100644 (file)
@@ -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)
index 816c443a06c21c6c38fb9600fde1173b0c082636..5a70dffd4c8c2f91b14e0da642c20f99b62d12d2 100644 (file)
@@ -25,5 +25,5 @@
 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
 }
index 9c614d659d36f79319f9ec78b011ddb4bc33fe9c..a217bc57b367028cae9be7e8e5d30aba7e79d83a 100644 (file)
@@ -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`