Skip to content

Conversation

@masklinn
Copy link
Contributor

I saw that it was bounded by Show but the implication is no guarantee (and had only 0.10 to test, where this behavior has been added to 0.11)

@alexcrichton
Copy link
Member

Could you tweak the documentation to say that instead of printing the task fails with E's Show implementation? You can suppress printing with set_stderr or redirect to any location.

@masklinn
Copy link
Contributor Author

Sure. Maybe model the precise message after Option.expect's, e.g.

Fails if the value is an Err, with a custom failure message provided by the Err's value.

would that work?

Should I squash the new commit atop the old one?

@alexcrichton
Copy link
Member

That sounds good to me! And yes, I'm a fan of squashing :)

It is implied by the Show bound, but that implication can be missed.
@masklinn
Copy link
Contributor Author

Here's a version with error messages matching that of Option.expect, I also added a Failure section title since that seems to be pretty common.

@steveklabnik
Copy link
Contributor

:shipit:

bors added a commit that referenced this pull request Jul 14, 2014
I saw that it was bounded by `Show` but the implication is no guarantee (and had only 0.10 to test, where this behavior has been added to 0.11)
@bors bors closed this Jul 14, 2014
@bors bors merged commit ded48c5 into rust-lang:master Jul 14, 2014
@masklinn masklinn deleted the patch-1 branch July 15, 2014 19:59
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2023
scip: Use load_workspace_at.

This honors the build script config, and is also simpler.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 16, 2025
- only lint on definitions of offending mutexes, not all their uses
(fixes rust-lang/rust-clippy#13378)
- give more orderly help messages
- stop linting on `Mutex<*const T>` (see the corresponding commit for
context)
- offer (partial) suggestions

The last change might be deemed a bit too much for the feature freeze,
but it can be easily extracted out into a separate PR.

changelog: [`mutex_atomic`]: only lint the definitions, not uses
changelog: [`mutex_atomic`]: better help messages, and suggestions
changelog: [`mutex_atomic`]: don't lint `Mutex<*const T>`
changelog: [`mutex_integer`]: only lint the definitions, not uses
changelog: [`mutex_integer`]: better help messages, and suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants