1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-25 23:49:54 +02:00

Preserve line numbers by not injecting a newline (#2653)

The `dbg!` macro, being deployed more widely in #2478, shows the line
number. But if we inject `#![allow(..)]\n` then the printed numbers do
not match those in the textarea. It turns out that `\n` is not required!

cc @egithinji
This commit is contained in:
Dustin J. Mitchell 2025-02-21 15:32:31 -05:00 committed by GitHub
parent 63cc474ba0
commit 63d716de90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -130,7 +130,7 @@ function playground_text(playground, hidden = true) {
// Unless the code block has `warnunused`, allow all "unused" lints to avoid cluttering
// the output.
if(!classes.contains("warnunused")) {
text = '#![allow(unused)]\n' + text;
text = '#![allow(unused)] ' + text;
}
let edition = "2015";
if(classes.contains("edition2018")) {