Skip to content

Commit 06a47dc

Browse files
committed
Rollup merge of rust-lang#50360 - kennytm:fix-50232-clarify-unstable-name-collision, r=nikomatsakis
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 rust-lang#50232. [varkor's comment]: rust-lang#50232 (comment)
2 parents 73042c5 + a78028d commit 06a47dc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc/lint/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
507507

508508
let explanation = if lint_id == LintId::of(::lint::builtin::UNSTABLE_NAME_COLLISION) {
509509
"once this method is added to the standard library, \
510-
there will be ambiguity here, which will cause a hard error!"
510+
the ambiguity may cause an error or change in behavior!"
511511
.to_owned()
512512
} else if let Some(edition) = future_incompatible.edition {
513513
format!("{} in the {} edition!", STANDARD_MESSAGE, edition)

src/test/ui/inference_unstable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ use inference_unstable_itertools::IpuItertools;
2525
fn main() {
2626
assert_eq!('x'.ipu_flatten(), 1);
2727
//~^ WARN a method with this name may be added to the standard library in the future
28-
//~^^ WARN once this method is added to the standard library, there will be ambiguity here
28+
//~^^ WARN once this method is added to the standard library, the ambiguity may cause an error
2929
}

src/test/ui/inference_unstable.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | assert_eq!('x'.ipu_flatten(), 1);
55
| ^^^^^^^^^^^
66
|
77
= note: #[warn(unstable_name_collision)] on by default
8-
= warning: once this method is added to the standard library, there will be ambiguity here, which will cause a hard error!
8+
= warning: once this method is added to the standard library, the ambiguity may cause an error or change in behavior!
99
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
1010
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method
1111
= note: add #![feature(ipu_flatten)] to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`

0 commit comments

Comments
 (0)