Repository navigation
Closed
Closed
Copy link
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
Description
Code
fn main() {
println!(
"Hello \
• world!"
);
}Current output
warning: non-ASCII whitespace symbol '\u{2022}' is not skipped
--> experiment\src\main.rs:3:16
|
3 | "Hello \
| ________________^
4 | | • world!"
| | ^ non-ASCII whitespace symbol '\u{2022}' is not skipped
| |_____|
|Desired output
No warning, since U+2022 "•" is not whitespace.
Anything else?
stable-x86_64-pc-windows-msvc - rustc 1.68.0 (2c8cc3432 2023-03-06)
Weirdly, this warning only occurs on Windows. Unfortunately, I have no Windows systems to test on other than GitHub Actions, so it isn't convenient to test further. I hope this bug report is useful anyway.
Reacted by Mingwei Samuel
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Activity
Teapot4195 commentedon Mar 13, 2023
I have a spare windows system, I'll test further once I get home
ehuss commentedon Mar 13, 2023
Hm, I can't seem to see a way to reproduce this. There isn't any platform-specific code involved in that warning. Are the logs from the GItHub Actions run publicly available?
kpreid commentedon Mar 13, 2023
To clarify, do you mean that you compiled the above code using a Windows system and saw no warnings?
I'm not very familiar with Windows, but isn't it the case that Git checkout puts CRLF in text files on Windows, by default? That could have an influence while not being actually due to platform dependence in
rustc, because rustc would be seeing'\\' CR LF spaces '•'instead of'\\' LF spaces '•'Yep — https://github.com/kpreid/all-is-cubes/actions/runs/4400743620/jobs/7706316716 is the run I used to test the above code. (It has a lot of other noise because it's just a quick hack upon my regular CI — if I have to I could set up a whole new repository with a custom setup.)
ChrisDenton commentedon Mar 13, 2023
I can reproduce locally using stable msvc rustc:
Switching between Unix and Windows line endings does not seem to make a difference.
Using windows-gnu does not have this warning. But that makes no sense to me.
ChrisDenton commentedon Mar 13, 2023
Ok, this is super weird. It only appears to affect x86_64-msvc:
ehuss commentedon Mar 13, 2023
Ah, I see, I was using aarch64-pc-windows-msvc. I tried x86_64-pc-windows-msvc, and that reproduces. How strange!
ehuss commentedon Mar 13, 2023
I did a quick bisect, and it points to #103591 as where the regression started (cc @lqd).
ehuss commentedon Mar 13, 2023
I did a little bit of poking around. Inside
rustc, it definitely believes'£'.is_whitespace()is true. I don't particularly enjoy investigating inlining or llvm issues, so I probably won't poke around much more.11 remaining items
apiraino commentedon Mar 14, 2023
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-critical
[-]Miscompilation of `is_whitespace` inside rustc on Windows-msvc (with thin-LTO)[/-][+]Miscompilation of `is_whitespace` inside rustc on Windows-msvc (with -Zdylib-lto)[/+]Noratrieb commentedon Mar 14, 2023
I've split up this issue "we have shipped a miscompiled rustc" from "-Zdylib-lto is broken on windows-msvc (#109114)" so that we can close this issue soon after the backport while still keeping track of the other one.
Noratrieb commentedon Mar 17, 2023
#108978, a crash in rusc seen by multiple people was also caused by the same issue.
Mark-Simulacrum commentedon Mar 21, 2023
If folks here could verify this is fixed on the dev-static build (https://internals.rust-lang.org/t/rust-1-68-1-pre-release-testing/18547 for instructions) that would be great - we're expecting a point release on Thursday with what is believed to be a fix.
lqd commentedon Mar 21, 2023
There's no warning on the MCVE in the OP on 1.68.1.
kpreid commentedon Mar 21, 2023
I can confirm that the program which I originally found the problem in now compiles without the warning.
mac198442 commentedon Mar 26, 2023
Seems to me the entire idea of doing this for dist builds before testing it on nightly builds was a bad idea.
Noratrieb commentedon Mar 26, 2023
"dist builds" refers to all distributed builds including stable, beta, nightly and CI artifacts from master or try builds. This went through the normal nightly/beta release cycle, but apparently no one found issues there.
jyn514 commentedon Mar 26, 2023
I'm going to close this since we've published a 1.68.1 point release.