Skip to content

Conversation

ShE3py
Copy link
Contributor

@ShE3py ShE3py commented Jan 27, 2025

More legible imo

#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}

Before:

note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`

After:

note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"

Also removed the comma as assert_eq! / assert_ne! don't use one.

@rustbot label +A-libtest

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

r? @thomcc

rustbot has assigned @thomcc.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. A-libtest Area: `#[test]` / the `test` library labels Jan 27, 2025
@ShE3py ShE3py force-pushed the should-panic-backticks branch from b227014 to afb78f0 Compare January 27, 2025 23:12
@thomcc thomcc added the T-testing-devex Relevant to the testing devex team (testing DX), which will review and decide on the PR/issue. label Jan 28, 2025
@thomcc thomcc removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Mar 16, 2025
@thomcc
Copy link
Member

thomcc commented Mar 16, 2025

I doubt anybody feels strongly about this, but I guess it is superfluous.

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Mar 16, 2025

Team member @thomcc has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Mar 16, 2025
@epage
Copy link
Contributor

epage commented Mar 17, 2025

My comment from [zulip](#t-testing-devex > Backticks around should_panic output)

I feel like I can go either way. I understand why backticks are used (literal code) and why its superfluous (its just strings).

If none of us feel strongly about something, how do we break the indifference-tie?

@ShE3py
Copy link
Contributor Author

ShE3py commented Mar 17, 2025

I don't mind it that much, it's just that I find `"foo"` hard to read. It will also matches assert_eq!, which doesn't use backticks:

assertion `left == right` failed
  left: "a"
 right: "b"

@epage
Copy link
Contributor

epage commented Mar 17, 2025

Thanks for calling out the inconsistency. That is reason enough to change one and assert_eq is the one people have seen more and likely put more attention into, so I'm fine matching it.

@weihanglo
Copy link
Member

@rfcbot reviewed

I am okay with either way.

To check whether Cargo's test suite need to change any output snapshot, I am going to do a try build.

@bors try

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Mar 18, 2025
@rfcbot
Copy link

rfcbot commented Mar 18, 2025

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Mar 18, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2025
Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`

More legible imo
```rs
#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}
```
Before:
```
note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`
```
After:
```
note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"
```
Also removed the comma as `assert_eq!` / `assert_ne!` don't use one.

`@rustbot` label +A-libtest
@bors
Copy link
Collaborator

bors commented Mar 18, 2025

⌛ Trying commit afb78f0 with merge f95fba5...

@bors
Copy link
Collaborator

bors commented Mar 18, 2025

☀️ Try build successful - checks-actions
Build commit: f95fba5 (f95fba5bf499cd1aca21c54617540bd025a84653)

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Mar 28, 2025
@rfcbot
Copy link

rfcbot commented Mar 28, 2025

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@thomcc
Copy link
Member

thomcc commented Apr 27, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 27, 2025

📌 Commit afb78f0 has been approved by thomcc

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 27, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 27, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 28, 2025
…homcc

Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`

More legible imo
```rs
#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}
```
Before:
```
note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`
```
After:
```
note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"
```
Also removed the comma as `assert_eq!` / `assert_ne!` don't use one.

`@rustbot` label +A-libtest
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 28, 2025
…enton

Rollup of 10 pull requests

Successful merges:

 - rust-lang#136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`)
 - rust-lang#138395 (Download GCC from CI on test builders)
 - rust-lang#138737 (uefi: Update r-efi)
 - rust-lang#138939 (Add `Arc::is_unique`)
 - rust-lang#139224 (fix(test): Expose '--no-capture' in favor of `--nocapture`)
 - rust-lang#139546 (std(docs): clarify how std::fs::set_permisions works with symlinks)
 - rust-lang#139883 (crashes: more tests)
 - rust-lang#140345 (Avoid re-interning in `LateContext::get_def_path`)
 - rust-lang#140351 (docs: fix incorrect stability markers on `std::{todo, matches}`)
 - rust-lang#140359 (specify explicit safety guidance for from_utf8_unchecked)

r? `@ghost`
`@rustbot` modify labels: rollup
@ChrisDenton
Copy link
Member

@bors r-

failed in #140376 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 28, 2025
@ShE3py ShE3py force-pushed the should-panic-backticks branch from afb78f0 to 55a419f Compare April 28, 2025 19:43
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blessed this file (from PR #138603.)
@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 28, 2025
@thomcc
Copy link
Member

thomcc commented Apr 30, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 30, 2025

📌 Commit 55a419f has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 30, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 30, 2025
…homcc

Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`

More legible imo
```rs
#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}
```
Before:
```
note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`
```
After:
```
note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"
```
Also removed the comma as `assert_eq!` / `assert_ne!` don't use one.

`@rustbot` label +A-libtest
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`)
 - rust-lang#138087 (Initial implementation of `core_float_math`)
 - rust-lang#139059 (uses_power_alignment: wording tweaks)
 - rust-lang#139192 (mention provenance in the pointer::wrapping_offset docs)
 - rust-lang#140312 (Improve pretty-printing of braces)
 - rust-lang#140404 (rm `TypeVistable` impls for `Canonical`)
 - rust-lang#140437 (enable msa feature for mips in codegen tests)
 - rust-lang#140438 (Add `rust.debug-assertions-tools` option)
 - rust-lang#140439 (miri: algebraic intrinsics: bring back float non-determinism)
 - rust-lang#140445 (Treat ManuallyDrop as ~const Destruct)
 - rust-lang#140446 (chore: fix some tests)
 - rust-lang#140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`)

Failed merges:

 - rust-lang#140456 (Fix test simd/extract-insert-dyn on s390x)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`)
 - rust-lang#139059 (uses_power_alignment: wording tweaks)
 - rust-lang#139192 (mention provenance in the pointer::wrapping_offset docs)
 - rust-lang#140312 (Improve pretty-printing of braces)
 - rust-lang#140404 (rm `TypeVistable` impls for `Canonical`)
 - rust-lang#140437 (enable msa feature for mips in codegen tests)
 - rust-lang#140438 (Add `rust.debug-assertions-tools` option)
 - rust-lang#140439 (miri: algebraic intrinsics: bring back float non-determinism)
 - rust-lang#140445 (Treat ManuallyDrop as ~const Destruct)
 - rust-lang#140446 (chore: fix some tests)
 - rust-lang#140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bd3e447 into rust-lang:master Apr 30, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 30, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
Rollup merge of rust-lang#136160 - ShE3py:should-panic-backticks, r=thomcc

Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`

More legible imo
```rs
#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}
```
Before:
```
note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`
```
After:
```
note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"
```
Also removed the comma as `assert_eq!` / `assert_ne!` don't use one.

``@rustbot`` label +A-libtest
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request May 9, 2025
…homcc

Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`

More legible imo
```rs
#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}
```
Before:
```
note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`
```
After:
```
note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"
```
Also removed the comma as `assert_eq!` / `assert_ne!` don't use one.

``@rustbot`` label +A-libtest
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jun 26, 2025
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Jun 29, 2025
Pkgsrc changes:
 * Adjust patches to adapt to upstream changes and new versions.
 * associated checksums

Upstream changes relative to 1.87.0:

Version 1.88.0 (2025-06-26)
==========================

Language
--------
- [Stabilize `#![feature(let_chains)]` in the 2024 edition.]
  (rust-lang/rust#132833)
  This feature allows `&&`-chaining `let` statements inside `if`
  and `while`, allowing intermixture with boolean expressions. The
  patterns inside the `let` sub-expressions can be irrefutable or
  refutable.
- [Stabilize `#![feature(naked_functions)]`.]
  (rust-lang/rust#134213)
  Naked functions allow writing functions with no compiler-generated
  epilogue and prologue, allowing full control over the generated
  assembly for a particular function.
- [Stabilize `#![feature(cfg_boolean_literals)]`.]
  (rust-lang/rust#138632)
  This allows using boolean literals as `cfg` predicates, e.g.
  `#[cfg(true)]` and `#[cfg(false)]`.
- [Fully de-stabilize the `#[bench]` attribute]
  (rust-lang/rust#134273). Usage of `#[bench]`
  without `#![feature(custom_test_frameworks)]` already triggered
  a deny-by-default future-incompatibility lint since Rust 1.77,
  but will now become a hard error.
- [Add warn-by-default `dangerous_implicit_autorefs` lint against
  implicit autoref of raw pointer dereference.]
  (rust-lang/rust#123239) The
  lint [will be bumped to deny-by-default]
  (rust-lang/rust#141661) in the next
  version of Rust.
- [Add `invalid_null_arguments` lint to prevent invalid usage of
  null pointers.] (rust-lang/rust#119220)
  This lint is uplifted from `clippy::invalid_null_ptr_usage`.
- [Change trait impl candidate preference for builtin impls and
  trivial where-clauses.] (rust-lang/rust#138176)
- [Check types of generic const parameter defaults]
  (rust-lang/rust#139646)

Compiler
--------
- [Stabilize `-Cdwarf-version` for selecting the version of DWARF
  debug information to generate.]
  (rust-lang/rust#136926)

Platform Support
----------------
- [Demote `i686-pc-windows-gnu` to Tier 2.]
  (https://blog.rust-lang.org/2025/05/26/demoting-i686-pc-windows-gnu/)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html

Libraries
---------
- [Remove backticks from `#[should_panic]` test failure message.]
  (rust-lang/rust#136160)
- [Guarantee that `[T; N]::from_fn` is generated in order of
  increasing indices.] (rust-lang/rust#139099),
  for those passing it a stateful closure.
- [The libtest flag `--nocapture` is deprecated in favor of the
  more consistent `--no-capture` flag.]
  (rust-lang/rust#139224)
- [Guarantee that `{float}::NAN` is a quiet NaN.]
  (rust-lang/rust#139483)

Stabilized APIs
---------------

- [`Cell::update`]
  (https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.update)
- [`impl Default for *const T`]
  (https://doc.rust-lang.org/nightly/std/primitive.pointer.html#impl-Default-for-*const+T)
- [`impl Default for *mut T`]
  (https://doc.rust-lang.org/nightly/std/primitive.pointer.html#impl-Default-for-*mut+T)
- [`HashMap::extract_if`]
  (https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.extract_if)
- [`HashSet::extract_if`]
  (https://doc.rust-lang.org/stable/std/collections/struct.HashSet.html#method.extract_if)
- [`proc_macro::Span::line`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.line)
- [`proc_macro::Span::column`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.column)
- [`proc_macro::Span::start`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.start)
- [`proc_macro::Span::end`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.end)
- [`proc_macro::Span::file`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.file)
- [`proc_macro::Span::local_file`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.local_file)

These previously stable APIs are now stable in const contexts:

- [`NonNull<T>::replace`]
  (https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.replace)
- [`<*mut T>::replace`]
  (https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.replace)
- [`std::ptr::swap_nonoverlapping`]
  (rust-lang/rust#137280)
- [`Cell::{replace, get, get_mut, from_mut, as_slice_of_cells}`]
  (rust-lang/rust#137928)

Cargo
-----
- [Stabilize automatic garbage collection.]
  (rust-lang/cargo#14287)
- [use `zlib-rs` for gzip compression in rust code]
  (rust-lang/cargo#15417)

Rustdoc
-----
- [Doctests can be ignored based on target names using `ignore-*` attributes.]
  (rust-lang/rust#137096)
- [Stabilize the `--test-runtool` and `--test-runtool-arg` CLI
  options to specify a program (like qemu) and its arguments to run
  a doctest.] (rust-lang/rust#137096)

Compatibility Notes
-------------------
- [Finish changing the internal representation of pasted tokens]
  (rust-lang/rust#124141). Certain invalid
  declarative macros that were previously accepted in obscure
  circumstances are now correctly rejected by the compiler. Use of
  a `tt` fragment specifier can often fix these macros.
- [Fully de-stabilize the `#[bench]` attribute]
  (rust-lang/rust#134273). Usage of `#[bench]`
  without `#![feature(custom_test_frameworks)]` already triggered
  a deny-by-default future-incompatibility lint since Rust 1.77,
  but will now become a hard error.
- [Fix borrow checking some always-true patterns.]
  (rust-lang/rust#139042) The borrow checker
  was overly permissive in some cases, allowing programs that
  shouldn't have compiled.
- [Update the minimum external LLVM to 19.]
  (rust-lang/rust#139275)
- [Make it a hard error to use a vector type with a non-Rust ABI
  without enabling the required target feature.]
  (rust-lang/rust#139309)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-libtest Area: `#[test]` / the `test` library disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-testing-devex Relevant to the testing devex team (testing DX), which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants