-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rollup of 10 pull requests #91627
Rollup of 10 pull requests #91627
Conversation
…n it existed. Also, no tests fail when turning that arm into an ICE
Adds the minimial repro test case from rust-lang#85360. The fix for rust-lang#85360 was supposed to be rust-lang#85868 however the repro was resolved in the 2021-07-05 nightly while rust-lang#85360 didn't land until 2021-09-03. The reason for that is d34a3a4 **also** resolves that issue. To test if rust-lang#85868 actually fixes rust-lang#85360, I reverted d34a3a4 and found that rust-lang#85868 does indeed resolve rust-lang#85360. With that question resolved, add a test case to our incremental test suite for the original Ok(EvaluatedToOkModuloRegions) ICE. Thanks to @lqd for helping track this down!
As suggested via reviewer feedback.
Signed-off-by: TennyZhuang <zty0826@gmail.com>
Currently fails with: ---- [pretty] pretty/async.rs stdout ---- error: pretty-printed source does not match expected source expected: ------------------------------------------ // pp-exact // pretty-compare-only // edition:2021 async fn f() { let first = async { 1 }; let second = async move { 2 }; join(first, second).await } ------------------------------------------ actual: ------------------------------------------ // pp-exact // pretty-compare-only // edition:2021 async fn f() { let first = async { 1 }; let second = async move { 2 }; join(first, second).await } ------------------------------------------ diff: ------------------------------------------ 3 // edition:2021 4 5 async fn f() { - let first = async { 1 }; - let second = async move { 2 }; + let first = async { 1 }; + let second = async move { 2 }; 8 join(first, second).await 9 } 10
`array::IntoIter` has a bunch of really handy logic for dealing with partial arrays, but it's currently hamstrung by only being creatable from a fully-initialized array. This PR adds two new constructors: - a safe & const `empty`, since `[].into_iter()` gives `<T, 0>`, not `<T, N>`. - an unsafe `from_raw_parts`, to allow experimentation with new uses. (Slice & vec iterators don't need `from_raw_parts` because you `from_raw_parts` the slice or vec instead, but there's no useful way to made a `<[T; N]>::from_raw_parts`, so I think this is a reasonable place to have one.)
Add test Apply suggestions Switch to match Apply cargofmt
…rk-Simulacrum Recommend fix `count()` -> `len()` on slices Fixes rust-lang#87302
Add test for evaluate_obligation: Ok(EvaluatedToOkModuloRegions) ICE Adds the minimial repro test case from rust-lang#85360. The fix for rust-lang#85360 was supposed to be rust-lang#85868 however the repro was resolved in the 2021-07-05 nightly while rust-lang#85868 didn't land until 2021-09-03. The reason for that is d34a3a4 **also** resolves that issue. To test if rust-lang#85868 actually fixes rust-lang#85360, I reverted d34a3a4 and found that rust-lang#85868 does indeed resolve rust-lang#85360. With that question resolved, add a test case to our incremental test suite for the original Ok(EvaluatedToOkModuloRegions) ICE. Thanks to ````@lqd```` for helping track this down!
…kh726 Fix AnonConst ICE I am not sure if this is even the correct place to fix this issue, but i went down the path where the generic args came from and i wasn't able to find a clear cause for this down there. But if anybody has a suggestion what i should do, just tell me. This fixes: rust-lang#91267
Add `array::IntoIter::{empty, from_raw_parts}` `array::IntoIter` has a bunch of really handy logic for dealing with partial arrays, but it's currently hamstrung by only being creatable from a fully-initialized array. This PR adds two new constructors: - a safe & const `empty`, since `[].into_iter()` can only give `IntoIter<T, 0>`, not `IntoIter<T, N>`. - an unsafe `from_raw_parts`, to allow experimentation with new uses. (Slice & vec iterators don't need `from_raw_parts` because you `from_raw_parts` the slice or vec instead, but there's no useful way to made a `<[T; N]>::from_raw_parts`, so I think this is a reasonable place to have one.)
Remove a dead code path. It is neither documented nor can I see any way it could ever be reached. Also, no tests fail when turning that arm into an ICE
…rister Tweak "call this function" suggestion to have smaller span
…scottmcm Suggest try_reserve in try_reserve_exact During developing rust-lang#91529 , I found that `try_reserve_exact` suggests `reserve` for further insertions. I think it's a mistake by copy&paste, `try_reserve` is better here.
Pretty print async block without redundant space **Repro:** ```rust macro_rules! m { ($e:expr) => { stringify!($e) }; } fn main() { println!("{:?}", m!(async {})); } ``` **Before:** <code>"async {}"</code> **After:** `"async {}"` <br> In this function: https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/compiler/rustc_ast_pretty/src/pprust/state.rs#L2049-L2051 the `print_capture_clause` and `word_nbsp`/`word_space` calls already put a space after the `async` and `move` keywords being printed. The extra `self.s.space()` call removed by this PR resulted in the redundant double space. https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/compiler/rustc_ast_pretty/src/pprust/state.rs#L2640-L2645 https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/compiler/rustc_ast_pretty/src/helpers.rs#L34-L37 https://github.com/rust-lang/rust/blob/65c55bf931a55e6b1e5ed14ad8623814a7386424/compiler/rustc_ast_pretty/src/helpers.rs#L5-L8
Update books ## nomicon 1 commits in c6b4bf831e9a40aec34f53067d20634839a6778b..49681ea4a9fa81173dbe9ffed74b4d4a35eae9e3 2021-11-09 02:30:56 +0900 to 2021-11-24 16:27:28 +0900 - Clarify that drop flag fields only apply to older Rust versions (rust-lang/nomicon#324) ## reference 2 commits in c0f222da23568477155991d391c9ce918e381351..954f3d441ad880737a13e241108f791a4d2a38cd 2021-11-22 10:30:57 -0800 to 2021-11-29 11:11:30 -0800 - Say that bare trait objects are rejected in the 2021 edition (rust-lang/reference#1111) - Update 'Subtyping and Variance' example to use `dyn Trait` syntax (rust-lang/reference#1110) ## book 5 commits in a5e0c5b2c5f9054be3b961aea2c7edfeea591de8..5f9358faeb1f46e19b8a23a21e79fd7fe150491e 2021-11-19 17:06:19 -0500 to 2021-12-05 21:33:16 -0500 - 1.57 - Update to 1.56 - Snapshot of ch 11 for nostarch - Clarify how to check for an error in tests returning Result - Update book repo links for default branch rename ## rust-by-example 1 commits in 43f82530210b83cf888282b207ed13d5893da9b2..1ca6a7bd1d73edc4a3e6c7d6a40f5d4b66c1e517 2021-11-21 22:31:50 -0300 to 2021-11-23 17:48:53 -0300 - Removed `u32` at the end of ints (rust-lang/rust-by-example#1477) ## rustc-dev-guide 10 commits in a2fc963..a374e7d 2021-11-18 13:31:13 -0500 to 2021-12-03 09:26:47 -0800 - Update LLVM coverage mapping format version supported by rustc (rust-lang/rustc-dev-guide#1267) - Improve 'Running tests manually' section - Fix some links - Update for review comments. - Document rustfix-only-machine-applicable - Apply suggestions from pierwill - Document more compiletest headers. - make it compile with 1.56.0 no warning - make it compile with 1.56.0 - make it compile with 1.56.0 ## edition-guide 1 commits in 8e0ec8c77d8b28b86159fdee9d33a758225ecf9c..beea0a3cdc3885375342fd010f9ad658e6a5e09a 2021-11-12 06:30:23 -0800 to 2021-12-05 07:06:45 -0800 - Fix typo (neccesary -> necessary) (rust-lang/edition-guide#274)
…=lnicola ⬆️ rust-analyzer r? `@ghost`
@bors r+ rollup=never p=10 |
📌 Commit 099412e has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c5c9494): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Successful merges:
count()
->len()
on slices #87614 (Recommend fixcount()
->len()
on slices)array::IntoIter::{empty, from_raw_parts}
#91341 (Addarray::IntoIter::{empty, from_raw_parts}
)Failed merges:
s
field in favor of deref #91571 (Remove unneeded access to pretty printer'ss
field in favor of deref)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup