Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
master
rust/tests/coverage/assert-ne.rs

23 lines
497 B
Rust
Raw Permalink Normal View History

coverage: Add `tests/coverage/assert-ne.rs` This test extracts a fragment of `issue-84561.rs` that has historically proven troublesome when trying to modify how spans are extracted from MIR.
2024-06-11 22:13:40 +10:00
//@ edition: 2021
use core::hint::black_box;
#[derive(Debug, PartialEq)]
struct Foo(u32);
fn main() {
assert_ne!(
coverage: Tweak tests/coverage/assert-ne.rs This test is intended to demonstrate that a particular macro-argument span doesn't get lost during span-refinement, but it turns out that span-extraction currently doesn't yield any MIR spans for this position. This patch therefore tweaks the test to add a function call in that position, so that it still remains relevant to span refinement.
2025-03-29 18:34:44 +11:00
black_box(Foo(5)), // Make sure this expression's span isn't lost.
coverage: Add `tests/coverage/assert-ne.rs` This test extracts a fragment of `issue-84561.rs` that has historically proven troublesome when trying to modify how spans are extracted from MIR.
2024-06-11 22:13:40 +10:00
if black_box(false) {
Foo(0) //
} else {
Foo(1) //
}
);
()
}
// This test is a short fragment extracted from `issue-84561.rs`, highlighting
// a particular span of code that can easily be lost if overlapping spans are
// processed incorrectly.
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 207ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API