Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 29c8276

Browse files
committedFeb 7, 2018
Auto merge of #48053 - Manishearth:rollup, r=Manishearth
Rollup of 10 pull requests - Successful merges: #47613, #47631, #47810, #47883, #47922, #47944, #48014, #48018, #48020, #48028 - Failed merges:
2 parents fee39ba + 732c830 commit 29c8276

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+983
-181
lines changed
 

‎src/libcore/fmt/mod.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,12 @@ impl<'a> Display for Arguments<'a> {
530530
/// }
531531
/// ```
532532
#[stable(feature = "rust1", since = "1.0.0")]
533-
#[rustc_on_unimplemented = "`{Self}` cannot be formatted using `:?`; if it is \
534-
defined in your crate, add `#[derive(Debug)]` or \
535-
manually implement it"]
533+
#[rustc_on_unimplemented(
534+
on(crate_local, label="`{Self}` cannot be formatted using `:?`; \
535+
add `#[derive(Debug)]` or manually implement `{Debug}`"),
536+
message="`{Self}` doesn't implement `{Debug}`",
537+
label="`{Self}` cannot be formatted using `:?` because it doesn't implement `{Debug}`",
538+
)]
536539
#[lang = "debug_trait"]
537540
pub trait Debug {
538541
/// Formats the value using the given formatter.
@@ -593,9 +596,11 @@ pub trait Debug {
593596
///
594597
/// println!("The origin is: {}", origin);
595598
/// ```
596-
#[rustc_on_unimplemented = "`{Self}` cannot be formatted with the default \
597-
formatter; try using `:?` instead if you are using \
598-
a format string"]
599+
#[rustc_on_unimplemented(
600+
message="`{Self}` doesn't implement `{Display}`",
601+
label="`{Self}` cannot be formatted with the default formatter; \
602+
try using `:?` instead if you are using a format string",
603+
)]
599604
#[stable(feature = "rust1", since = "1.0.0")]
600605
pub trait Display {
601606
/// Formats the value using the given formatter.

‎src/libcore/iter/iterator.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ fn _assert_is_object_safe(_: &Iterator<Item=()>) {}
2828
/// [module-level documentation]: index.html
2929
/// [impl]: index.html#implementing-iterator
3030
#[stable(feature = "rust1", since = "1.0.0")]
31-
#[rustc_on_unimplemented = "`{Self}` is not an iterator; maybe try calling \
32-
`.iter()` or a similar method"]
31+
#[rustc_on_unimplemented(
32+
on(
33+
_Self="&str",
34+
label="`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`"
35+
),
36+
label="`{Self}` is not an iterator; maybe try calling `.iter()` or a similar method"
37+
)]
3338
#[doc(spotlight)]
3439
pub trait Iterator {
3540
/// The type of the elements being iterated over.

0 commit comments

Comments
 (0)
Please sign in to comment.