-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Implement Eq for Bitv and BitvSet #15035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This addresses the font lock regression introduced by the earlier pull request #14818 - attributes are no longer be highligted inside of comments and strings. Also add some font lock test infrastructure and some tests for attribute font locking.
The collapse/unindent passes were run in the wrong order, generating different markdown for indented tests.
No need to duplicate the compiler's work! Closes #14999
Commits have the descriptions.
…ht, r=pnkfelix This addresses the font lock regression introduced by the earlier pull request #14818 - attributes are no longer be highligted inside of comments and strings. Also add some font lock test infrastructure and some tests for attribute font locking and fix some minor nits.
1. After recursively processing an ExprWhile, need to pop loop_scopes the same way we do for ExprLoop. 2. Proposed fix for flowgraph handling of ExprInlineAsm: we need to represent the flow into the subexpressions of an `asm!` block.
Fix #6298. This is instead of the prior approach of emulating cfg traversal privately by traversing AST in same way). Of special note, this removes a special case handling of `ExprParen` that was actually injecting a bug (since it was acting like an expression like `(*func)()` was consuming `*func` *twice*: once from `(*func)` and again from `*func`). nikomatsakis was the first one to point out that it might suffice to simply have the outer `ExprParen` do the consumption of the contents (alone). (This version has been updated to incorporate feedback from Niko's review of PR 14873.)
Namely: 1. Now that cfg mod is used for dataflow, we do not need to turn on the `allow(deadcode)` to placate the linter. 2. remove dead struct defn.
…ext. Details: in a program like: ``` type T = proc(int) -> int; /* 4 */ pub fn outer(captured /* pat 16 */: T) -> T { (proc(x /* pat 23 */) { ((captured /* 29 */).foo((x /* 30 */)) /* 28 */) } /* block 27 */ /* 20 */) } /* block 19 */ /* 12 */ ``` the `captured` arg is moved from the outer fn into the inner proc (id=20). The old dataflow analysis for flowed_move_data_moves, when looking at the inner proc, would attempt to add a kill bit for `captured` at the end of its scope; the problem is that it thought the end of the `captured` arg's scope was the outer fn (id=12), even though at that point in the analysis, the `captured` arg's scope should now be restricted to the proc itself (id=20). This patch fixes handling of upvars so that dataflow of a fn/proc should never attempts to add a gen or kill bit to any NodeId outside of the current fn/proc. It accomplishes this by adding an `LpUpvar` variant to `borrowck::LoanPath`, so for cases like `captured` above will carry both their original `var_id`, as before, as well as the `NodeId` for the closure that is capturing them. As a drive-by fix to another occurrence of a similar bug that nikomatsakis pointed out to me earlier, this also fixes `gather_loans::compute_kill_scope` so that it computes the kill scope of the `captured` arg to be block 27; that is, the block for the proc itself (id=20). (This is an updated version that generalizes the new loan path variant to cover all upvars, and thus renamed the variant from `LpCopiedUpvar` to just `LpUpvar`.)
thereof.) PR 14739 injected the new message that this removes from one test case: borrowck-vec-pattern-loan-from-mut.rs When reviewing the test case, I was not able to convince myself that the error message was a legitimate thing to start emitting. Niko did not see an obvious reason for it either, so I am going to remove it and wait for someone (maybe Cameron Zwarich) to explain to me why we should be emitting it.
…tsakis Fix #6298. Fix #13767. This also includes some drive by fixes for some other issues, noted in the commits. I still need to integrate regression tests for some cases that I noticed were missing from our unit test suite (i.e. things that compiling rustc exposes that should have been exposed when doing `make check-stage1`). So do not land this yet, until I get the chance to add those tests. I just wanted to get the review process started soon, since this has been long in the coming.
This test was added long time ago and marked as ignored. The same test was added later in #8485 as run-fail/issue-3907.rs, but the old one was not deleted.
Teach StringReader how to emit errors for arbitrary spans, so we don't need to modify peek_span. This allows for emitting errors without having a &mut borrow of the StringReader.
The nightly builds on linux have been failing over the past few days due to a malformed LD_LIBRARY_PATH. It appears that the underlying cause is that one of the tests, dep-info-custom, recursively invokes make but the RUSTC variable passed down has the string "$LD_LIBRARY_PATH". This is intended to read the host's original LD_LIBRARY_PATH, but it appears that the makefile is eagerly expanding the "$L" to nothing, causing the original host's LD_LIBRARY_PATH to be ignored. This fix removes passing the string "$LD_LIBRARY_PATH" and rather expands it eagerly to ensure that escaping doesn't happen at a later stage. I'm still not entirely sure why the makefile is interpreting the dollar as a variable, but this seems to fix the issue.
Update placeholder text to make keyboard shortcuts more apparent.
Replace its usage with byte string literals, except in `bytes!()` tests. Also add a new snapshot, to be able to use the new b"foo" syntax. The src/etc/2014-06-rewrite-bytes-macros.py script automatically rewrites `bytes!()` invocations into byte string literals. Pass it filenames as arguments to generate a diff that you can inspect, or `--apply` followed by filenames to apply the changes in place. Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
Closes #14480 (vim: Add :RustRun and associated commands) Closes #14917 (Deprecate free-standing endian conversions in favor of methods on Int. Merge Bitwise into Int and add more bit operations.) Closes #14981 (librustc: Use expr_ty_adjusted in trans_overloaded_call.) Closes #14989 (std::task - Revamp TaskBuilder API) Closes #14997 (Reject double moves out of array elements) Closes #14998 (Vim: highlight escapes for byte literals.) Closes #15002 (Fix FIXME #5275) Closes #15004 (Fix #14865) Closes #15007 (debuginfo: Add test case for issue #14411.) Closes #15012 ((doc) Change search placeholder text.) Closes #15013 (Update compiler-rt.) Closes #15017 (Deprecate the bytes!() macro.)
This creates a stability baseline for all crates that we distribute that are not `std`. In general, all library code must start as experimental and progress in stages to become stable.
The lexer already ignores CRLF in between tokens, but it doesn't properly handle carriage returns inside strings and doc comments. Teach it to treat CRLF as LF inside these tokens, and to disallow carriage returns that are not followed by linefeeds. This includes handling an escaped CRLF inside a regular string token the same way it handles an escaped LF. This is technically a breaking change, as bare carriage returns are no longer allowed, and CRLF sequences are now treated as LF inside strings and doc comments, but it's very unlikely to actually affect any real-world code. This change is necessary to have Rust code compile on Windows the same way it does on Unix. The mozilla/rust repository explicitly sets eol=lf for Rust source files, but other Rust repositories don't. Notably, rust-http cannot be compiled on Windows without converting the CRLF line endings back to LF. [breaking-change]
The lexer already ignores CRLF in between tokens, but it doesn't properly handle carriage returns inside strings and doc comments. Teach it to treat CRLF as LF inside these tokens, and to disallow carriage returns that are not followed by linefeeds. This includes handling an escaped CRLF inside a regular string token the same way it handles an escaped LF. This is technically a breaking change, as bare carriage returns are no longer allowed, and CRLF sequences are now treated as LF inside strings and doc comments, but it's very unlikely to actually affect any real-world code. This change is necessary to have Rust code compile on Windows the same way it does on Unix. The mozilla/rust repository explicitly sets eol=lf for Rust source files, but other Rust repositories don't. Notably, rust-http cannot be compiled on Windows without converting the CRLF line endings back to LF. [breaking-change]
Updated search bar to match help text. Used correct, normalized hotkeys in search. Updated shortcut menu with working shortcuts (tabs). Changed height of search help.
This test was added long time ago and marked as ignored. The same test was added later in #8485 as run-fail/issue-3907.rs, but the old one was not deleted.
Continuing from #15012, this makes four changes to the `rustdoc` static files. - Change the placeholder text of the search bar to `Click or press 'S' to search, '?' for more options...` to make keyboard hotkeys more apparent (capitalizing the `S` to match the help text). - Change the `main.js` file to use browser-normalized key codes (`e.which`, from `jQuery`), instead of `e.keyCode`. - Change the key code for `?` to be the correct `191` instead of `188`, so that the hotkey works to bring up search information. - Change the search information to display `tab` and `shift+tab` instead of `up` and `down`, as those do not yet work outside of Firefox (see #15011). Also, adjust the height so it does not cut off the help text. <s>I've also opened up #15038 about the non-functional `up` and `down` functionality, although this does nothing to fix it.</s>
```test_harness #[test] fn foo() {} ``` will now compile and run the tests, rather than just ignoring & stripping them (i.e. it is as if `--test` was passed). Also, the specific example in #12242 was fixed (but that issue is broader than that example).
…o impl_eq_for_bitv_bitvset
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Sep 4, 2025
As discussed in [#clippy > rust-lang#15035](https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/.2315035) Fixes rust-lang/rust-clippy#15035 changelog: [`unused_unit`] don't lint on closure return types
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.