You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, there is no standard library method that matches on Unicode Pattern_White_Space (or the ASCII or u8 subset). So the fix should call the Rust compiler function, or create a new function with the correct filters by escape or character code.
Steps to Fix these Bugs
You can use AI for your understanding, but don't use it to write messages, comments, or code. We want to talk to you, and we want you to contribute your own work!
You must have a code example PR merged for either the Overloading or Build System project. If you don't, open a PR for Overloading (Build System is closed to new applicants), or work on your open PR until it is finished.
Choose one bug from the list of bugs. There is a strict limit of one bug per Outreachy applicant. Claim the issue by commenting on this ticket. If someone else has claimed it, choose another bug.
Read the contribution instructions for the Rust tool you're fixing.
Checkout the tool's git repository.
Create a commit with a test that shows the issue, this test should fail until you fix the bug.
Fix the issue in another commit, and update the tests or test outputs so they pass.
Instead, it should accept trailing whitespace, and ban trailing non whitespace. This is roughly !any(!u8::is_ascii_whitespace), or more simply, all(u8::is_ascii_whitespace).
The Rust language specification (specifically, the lexer) defines "whitespace" including the "vertical tab" character.
But some tools that process Rust use the standard library's
is_ascii_whitespacewhich doesn't include vertical tab. This is a bug.This ticket is based on this Zulip discussion
Impacted Functions
Any standard library (or crate) functions that call
is_ascii_whitespaceare also impacted:trim_ascii*split_ascii_whitespaceascii::Char::is_whitespaceHow to Fix this Bug
Unfortunately, there is no standard library method that matches on Unicode
Pattern_White_Space(or the ASCII oru8subset). So the fix should call the Rust compiler function, or create a new function with the correct filters by escape or character code.Steps to Fix these Bugs
You can use AI for your understanding, but don't use it to write messages, comments, or code. We want to talk to you, and we want you to contribute your own work!
You must have a code example PR merged for either the Overloading or Build System project. If you don't, open a PR for Overloading (Build System is closed to new applicants), or work on your open PR until it is finished.
Unusual whitespace is deleted by
rustfmt, so you might need to put#[rustfmt::skip]in your test code. (Or#![rustfmt::skip]at the top of the file.)For more details, see the Zulip discussion.
List of Bugs that exclude Vertical Tab
These bugs don't include Vertical Tab. They also don't include Unicode
Pattern_White_Space, but that might be intentional.Extra steps for these bugs:
7. On the PR, ask if you should switch from checking ASCII to Unicode.
Clippy
rustfmt
Pattern_White_Spacein the line splitting regex - regex docsRust Analyzer
List of Related Bugs
If all bugs above are claimed, you can do one of these related bugs or cleanups instead.
Rust run-make-supportimplement shell whitespace splitting correctlyRust Compiler
!any(!u8::is_ascii_whitespace), or more simply,all(u8::is_ascii_whitespace).List of Cleanups
Rust Compiler
trim_ascii_startfunction with the standard library functionList of Bugs that include too much Unicode Whitespace
These bugs include all Unicode
White_Spaceusingis_whitespacemethods. But the Rust language uses UnicodePattern_White_Spaceas whitespace.No confirmed bugs, in most tools (except the lexer), ignoring more whitespace is not a significant bug.
If you think you've found a significant buggy use of
is_whitespace,trimor similar in a Rust parser, please comment below.If there aren't any bugs left
Add tests for the rust compiler, clippy, rustfmt, or other Rust tools, which process Rust source code files containing:
You might need to use a character picker or Rust code to write the Unicode whitespace to the file.
List of tools: