about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-02-03Use PrimTy in builtin type shadow lintCameron Steffen-18/+4
2021-02-03Refactor out PrimitiveTypeTableCameron Steffen-62/+67
2021-02-02Auto merge of #80843 - Mark-Simulacrum:fmt-bump, r=petrochenkovbors-164/+224
Bump rustfmt version
2021-02-02Bump rustfmt versionMark Rousskov-164/+224
Also switches on formatting of the mir build module
2021-02-02Auto merge of #81660 - jonas-schievink:rollup-fz2lh78, r=jonas-schievinkbors-1633/+2480
Rollup of 11 pull requests Successful merges: - #80629 (Add lint for 2229 migrations) - #81022 (Add Frames Iterator for Backtrace) - #81481 (move some tests) - #81485 (Add some tests for associated-type-bounds issues) - #81492 (rustdoc: Note why `rustdoc::html::markdown` is public) - #81577 (const_evaluatable: consider sub-expressions to be evaluatable) - #81599 (Implement `TrustedLen` for `Fuse<I: TrustedLen>`) - #81608 (Improve handling of spans around macro result parse errors) - #81609 (Remove the remains of query categories) - #81630 (Fix overflowing text on mobile when sidebar is displayed) - #81631 (Remove unneeded `mut` variable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-02Rollup merge of #81631 - LingMan:rem_var, r=davidtwcoJonas Schievink-8/+1
Remove unneeded `mut` variable `arg_elide` gets initialized, immediately cloned, and only written to after that. The last reading access was removed back in https://github.com/rust-lang/rust/commit/7704762604a8bf4504a06e8c9713bc7c158d362a
2021-02-02Rollup merge of #81630 - GuillaumeGomez:overflow-sidebar-title-text, r=pickfireJonas Schievink-0/+8
Fix overflowing text on mobile when sidebar is displayed Fixes #81597. Before: ![Screenshot from 2021-02-01 17-21-15](https://user-images.githubusercontent.com/3050060/106486857-610b0300-64b2-11eb-96d3-12b939f5b661.png) After: ![Screenshot from 2021-02-01 17-20-59](https://user-images.githubusercontent.com/3050060/106486840-5cdee580-64b2-11eb-9492-4df27bb39e59.png) cc `@pickfire` r? `@Nemo157`
2021-02-02Rollup merge of #81609 - Julian-Wollersberger:no-query-categories, r=davidtwcoJonas Schievink-1506/+1392
Remove the remains of query categories Back in October 2020 in #77830 ``@cjgillot`` removed the query categories information from the profiler, but the actual definitions which query was in which category remained, although unused. Here I clean that up, to simplify the query definitions even further. It's unfortunate that this loses all the context for `git blame`, ~~but I'm working on moving those query definitions into `rustc_query_system`, which will lose that context anyway.~~ EDIT: Might not work out. The functional changes are in the first commit. The second one only changes the indentation.
2021-02-02Rollup merge of #81608 - Aaron1011:macro-res-parse-err, r=davidtwcoJonas Schievink-4/+36
Improve handling of spans around macro result parse errors Fixes #81543 After we expand a macro, we try to parse the resulting tokens as a AST node. This commit makes several improvements to how we handle spans when an error occurs: * Only ovewrite the original `Span` if it's a dummy span. This preserves a more-specific span if one is available. * Use `self.prev_token` instead of `self.token` when emitting an error message after encountering EOF, since an EOF token always has a dummy span * Make `SourceMap::next_point` leave dummy spans unused. A dummy span does not have a logical 'next point', since it's a zero-length span. Re-using the span span preserves its 'dummy-ness' for other checks
2021-02-02Rollup merge of #81599 - sdroege:fuse-trusted-len, r=m-ou-seJonas Schievink-1/+14
Implement `TrustedLen` for `Fuse<I: TrustedLen>` This looks like it was simply forgotten.
2021-02-02Rollup merge of #81577 - BoxyUwU:subexpr_const_evaluatable, r=oli-obkJonas Schievink-13/+42
const_evaluatable: consider sub-expressions to be evaluatable see [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const_evaluatable.3A.20subexpressions) for more info cc `@lcnr` r? `@oli-obk`
2021-02-02Rollup merge of #81492 - camelid:rustdoc-internal-mod-vis, r=GuillaumeGomezJonas Schievink-1/+3
rustdoc: Note why `rustdoc::html::markdown` is public Almost all of the modules are crate-private, except for `rustdoc::json::types`, which I believe is intended to be for public use; and `rustdoc::html::markdown`, which is used externally by the error-index generator and so has to be public. r? ``@GuillaumeGomez``
2021-02-02Rollup merge of #81485 - jackh726:atb-issues, r=Mark-SimulacrumJonas Schievink-0/+73
Add some tests for associated-type-bounds issues Closes #38917 Closes #40093 Closes #43475 Closes #63591 #47897 is likely closable too, but it needs an MCVE ~~#38917, #40093, #43475, #47897 all are mislabeled and shouldn't have the `F-associated-type-bounds` label~~ ~~#71685 is also mislabeled as commented on in that thread~~
2021-02-02Rollup merge of #81481 - lcnr:cast-tests, r=jackh726Jonas Schievink-9/+7
move some tests
2021-02-02Rollup merge of #81022 - seanchen1991:feat/frames-iter, r=KodrAusJonas Schievink-38/+92
Add Frames Iterator for Backtrace Second attempt at adding the ability to iterate over the frames of a Backtrace by exposing the frames method.
2021-02-02Rollup merge of #80629 - sexxi-goose:migrations_1, r=nikomatsakisJonas Schievink-53/+812
Add lint for 2229 migrations Implements the first for RFC 2229 where we make the decision to migrate a root variable based on if the type of the variable needs Drop and if the root variable would be moved into the closure when the feature isn't enabled. r? `@nikomatsakis`
2021-02-02Auto merge of #79015 - WaffleLapkin:vec_append_from_within, r=KodrAusbors-4/+181
add `Vec::extend_from_within` method under `vec_extend_from_within` feature gate Implement <https://github.com/rust-lang/rfcs/pull/2714> ### tl;dr This PR adds a `extend_from_within` method to `Vec` which allows copying elements from a range to the end: ```rust #![feature(vec_extend_from_within)] let mut vec = vec![0, 1, 2, 3, 4]; vec.extend_from_within(2..); assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]); vec.extend_from_within(..2); assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]); vec.extend_from_within(4..8); assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]); ``` ### Implementation notes Originally I've copied `@Shnatsel's` [implementation](https://github.com/WanzenBug/rle-decode-helper/blob/690742a0de158d391b7bde1a0c71cccfdad33ab3/src/lib.rs#L74) with some minor changes to support other ranges: ```rust pub fn append_from_within<R>(&mut self, src: R) where T: Copy, R: RangeBounds<usize>, { let len = self.len(); let Range { start, end } = src.assert_len(len);; let count = end - start; self.reserve(count); unsafe { // This is safe because `reserve()` above succeeded, // so `self.len() + count` did not overflow usize ptr::copy_nonoverlapping( self.get_unchecked(src.start), self.as_mut_ptr().add(len), count, ); self.set_len(len + count); } } ``` But then I've realized that this duplicates most of the code from (private) `Vec::append_elements`, so I've used it instead. Then I've applied `@KodrAus` suggestions from https://github.com/rust-lang/rust/pull/79015#issuecomment-727200852.
2021-02-02update tracking issue for vec_extend_from_withinAshley Mannix-1/+1
2021-02-02Auto merge of #81539 - nikic:update-armhf-gnu, r=sanxiynbors-23/+29
Update armhf-gnu to Ubuntu 20.04 This requires updating the used Linux kernel to avoid an assembler error, the used busybox version to avoid a linker error, the used rootfs to match the host version and the qemu flags to work with the newer version. r? `@Mark-Simulacrum`
2021-02-01New migrationAman Arora-29/+29
2021-02-02Auto merge of #81651 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 5 commits in c3abcfe8a75901c7c701557a728941e8fb19399e..e099df243bb2495b9b197f79c19f124032b1e778 2021-01-25 16:16:43 +0000 to 2021-02-01 16:24:34 +0000 - Impl warn for locked install without Cargo.lock (rust-lang/cargo#9108) - Document -Z extra-link-arg. (rust-lang/cargo#9121) - Flip 'foo' and 'bar' to be consistent (rust-lang/cargo#9120) - Don't try to parse MSRV if feature is not enabled (rust-lang/cargo#9115) - simplify char range check (rust-lang/cargo#9110)
2021-02-01PR fixupAman Arora-41/+48
2021-02-01Mark the lint doc as compile_failAman Arora-1/+1
2021-02-01Tests for 2229 lintAman Arora-0/+559
2021-02-01Update cargoEric Huss-0/+0
2021-02-02Auto merge of #81557 - GuillaumeGomez:primitive-search, r=ollie27bors-14/+61
Fix primitive search in parameters and returned values Part of #60485. Fixes #74780. Replacing #74879. cc `@camelid` `@jyn514` `@CraftSpider` r? `@ollie27`
2021-02-01Migrations first passAman Arora-4/+134
2021-02-01Process mentioned upvars for analysis first pass after ExprUseVisitorAman Arora-51/+68
- This allows us add fake information after handling migrations if needed. - Capture analysis also priortizes what we see earlier, which means fake information should go in last.
2021-02-01more things are const evaluatable *sparkles*Ellen-13/+42
2021-02-01Auto merge of #80641 - Danue1:patch-1, r=oli-obkbors-56/+344
Add visitors for checking #[inline] For #80564
2021-02-01Auto merge of #81625 - jonas-schievink:rollup-mshpp2n, r=jonas-schievinkbors-919/+1679
Rollup of 12 pull requests Successful merges: - #78641 (Let io::copy reuse BufWriter buffers) - #79291 (Add error message for private fn) - #81364 (Improve `rustc_mir_build::matches` docs) - #81387 (Move some tests to more reasonable directories - 3) - #81463 (Rename NLL* to Nll* accordingly to C-CASE) - #81504 (Suggest accessing field when appropriate) - #81529 (Fix invalid camel case suggestion involving unicode idents) - #81536 (Indicate both start and end of pass RSS in time-passes output) - #81592 (Rustdoc UI fixes) - #81594 (Avoid building LLVM just for llvm-dwp) - #81598 (Fix calling convention for CRT startup) - #81618 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-01Fix overflowing text on mobile when sidebar is displayedGuillaume Gomez-0/+8
2021-02-02Bless testsDanuel-3/+3
2021-02-01Improve diff display in case the whole key in missingGuillaume Gomez-0/+4
2021-02-01Add test for primitive searchGuillaume Gomez-0/+30
2021-02-01Put back primitives in searchGuillaume Gomez-14/+27
2021-02-01Remove unneeded `mut` variableLingMan-8/+1
`arg_elide` gets initialized, immediately cloned, and only written to after that. The last reading access was removed back in https://github.com/rust-lang/rust/commit/7704762604a8bf4504a06e8c9713bc7c158d362a
2021-02-01Fixed #[inline] to be warned in fields, arms, macro defsDanuel-53/+341
Add visitors for checking #[inline] Add visitors for checking #[inline] with struct field Fix test for #[inline] Add visitors for checking #[inline] with #[macro_export] macro Add visitors for checking #[inline] without #[macro_export] macro Add use alias with Visitor Fix lint error Reduce unnecessary variable Co-authored-by: LingMan <LingMan@users.noreply.github.com> Change error to warning Add warning for checking field, arm with #[allow_internal_unstable] Add name resolver Formatting Formatting Fix error fixture Add checking field, arm, macro def
2021-02-01Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3Jonas Schievink-718/+993
Sync rustc_codegen_cranelift The highlight of this sync are abi compatibility with cg_llvm allowing mixing of cg_clif and cg_llvm compiled crates and switching to the x64 cranelift backend based on the new backend framework. r? ``@ghost`` ``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2021-02-01Rollup merge of #81598 - sivadeilra:windows_dll_imports_fix_x86, r=m-ou-seJonas Schievink-12/+10
Fix calling convention for CRT startup My PR #81478 used the wrong calling convention for a set of functions that are called by the CRT. These functions need to use `extern "C"`. This would only affect x86, which is the only target (that I know of) that has multiple calling conventions. ```@bors``` r? ```@m-ou-se```
2021-02-01Rollup merge of #81594 - bjorn3:avoid_building_llvm_for_dwp, r=sanxiynJonas Schievink-2/+4
Avoid building LLVM just for llvm-dwp When the LLVM backend is disabled, the llvm-project submodule is not checked out by default. This breaks the bootstrap test for cg_clif. As cg_clif doesn't support split debuginfo anyway llvm-dwp is not necessary. Other backends would likely not want to build LLVM just for llvm-dwp either. Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1119
2021-02-01Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157Jonas Schievink-11/+2
Rustdoc UI fixes The first commit fixes this bug (I couldn't figure out why we were setting the width manually and it works as expected without so...): ![Screenshot from 2021-01-31 12-58-46](https://user-images.githubusercontent.com/3050060/106384371-d56a7700-63ca-11eb-9e04-c06b40c2ab5e.png) The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input: ![Screenshot from 2021-01-31 13-22-37](https://user-images.githubusercontent.com/3050060/106384413-021e8e80-63cb-11eb-8321-391a1f8a4c7e.png) The third and last commit fixes two bugs that you can see in this screenshot: ![Screenshot from 2021-01-31 13-41-05](https://user-images.githubusercontent.com/3050060/106384424-0cd92380-63cb-11eb-82de-76218286c3fb.png) The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width: ![Screenshot from 2021-01-31 13-49-50](https://user-images.githubusercontent.com/3050060/106384466-4447d000-63cb-11eb-9330-a7cd29403905.png) cc ```@pickfire``` r? ```@Nemo157```
2021-02-01Rollup merge of #81536 - tgnottingham:time-passes-rss, r=oli-obkJonas Schievink-28/+68
Indicate both start and end of pass RSS in time-passes output Previously, only the end of pass RSS was indicated. This could easily lead one to believe that the change in RSS from one pass to the next was attributable to the second pass, when in fact it occurred between the end of the first pass and the start of the second. Also, improve alignment of columns. Sample of output: ``` time: 0.739; rss: 607MB -> 637MB item_types_checking time: 8.429; rss: 637MB -> 775MB item_bodies_checking time: 11.063; rss: 470MB -> 775MB type_check_crate time: 0.232; rss: 775MB -> 777MB match_checking time: 0.139; rss: 777MB -> 779MB liveness_and_intrinsic_checking time: 0.372; rss: 775MB -> 779MB misc_checking_2 time: 8.188; rss: 779MB -> 1019MB MIR_borrow_checking time: 0.062; rss: 1019MB -> 1021MB MIR_effect_checking ```
2021-02-01Rollup merge of #81529 - estebank:case_lints, r=davidtwcoJonas Schievink-5/+22
Fix invalid camel case suggestion involving unicode idents Follow up to #77805.
2021-02-01Rollup merge of #81504 - matsujika:suggestion-field-access, r=estebankJonas Schievink-0/+185
Suggest accessing field when appropriate Fix #81222 r? ``@estebank``
2021-02-01Rollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkorJonas Schievink-71/+71
Rename NLL* to Nll* accordingly to C-CASE Given [C-CASE](https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case), `NLLRegionVariableOrigin` and `NLL` are encouraged to be `NllRegionVariableOrigin` and `Nll` respectively.
2021-02-01Rollup merge of #81387 - c410-f3r:tests-tests-tests, r=petrochenkovJonas Schievink-1/+1
Move some tests to more reasonable directories - 3 cc #73494 r? ````@petrochenkov```` https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56202.rs <sup>https://github.com/rust-lang/rust/issues/56202</sup>: traits 1.008 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-69841.rs <sup>https://github.com/rust-lang/rust/issues/69841</sup>: for-loop-while 1.014 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10763.rs <sup>https://github.com/rust-lang/rust/issues/10763</sup>: extern 1.016 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-50599.rs <sup>https://github.com/rust-lang/rust/issues/50599</sup>: resolve 1.018 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-6128.rs <sup>https://github.com/rust-lang/rust/issues/6128</sup>: traits 1.043 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-20616-8.rs <sup>https://github.com/rust-lang/rust/issues/20616</sup>: parser 1.045 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-46553.rs <sup>https://github.com/rust-lang/rust/issues/46553</sup>: consts 1.081 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140-hack-boundaries.rs <sup>https://github.com/rust-lang/rust/issues/33140</sup>: traits 1.101 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-25826.rs <sup>https://github.com/rust-lang/rust/issues/25826</sup>: consts 1.108 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56488.rs <sup>https://github.com/rust-lang/rust/issues/56488</sup>: traits 1.110 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-58856-1.rs <sup>https://github.com/rust-lang/rust/issues/58856</sup>: parser 1.133 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57819.rs <sup>https://github.com/rust-lang/rust/issues/57819</sup>: parser 1.138 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-54348.rs <sup>https://github.com/rust-lang/rust/issues/54348</sup>: consts 1.155 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-14309.rs <sup>https://github.com/rust-lang/rust/issues/14309</sup>: lint 1.160 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-4446.rs <sup>https://github.com/rust-lang/rust/issues/4446</sup>: threads-sendsync 1.203 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-53675-a-test-called-panic.rs <sup>https://github.com/rust-lang/rust/issues/53675</sup>: test-attrs 1.211 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-40231-2.rs <sup>https://github.com/rust-lang/rust/issues/40231</sup>: consts 1.213 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-22037.rs <sup>https://github.com/rust-lang/rust/issues/22037</sup>: associated-types 1.214 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-59029-2.rs <sup>https://github.com/rust-lang/rust/issues/59029</sup>: traits 1.219 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18425.rs <sup>https://github.com/rust-lang/rust/issues/18425</sup>: consts 1.237 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-6157.rs <sup>https://github.com/rust-lang/rust/issues/6157</sup>: regions 1.238 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33819.rs <sup>https://github.com/rust-lang/rust/issues/33819</sup>: borrowck 1.280 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3683.rs <sup>https://github.com/rust-lang/rust/issues/3683</sup>: traits 1.283 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-8709.rs <sup>https://github.com/rust-lang/rust/issues/8709</sup>: macros 1.291 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-20616-9.rs <sup>https://github.com/rust-lang/rust/issues/20616</sup>: parser 1.293 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-64732.rs <sup>https://github.com/rust-lang/rust/issues/64732</sup>: parser 1.296 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18655.rs <sup>https://github.com/rust-lang/rust/issues/18655</sup>: associated-types 1.305 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-32947.rs <sup>https://github.com/rust-lang/rust/issues/32947</sup>: simd 1.322 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57198.rs <sup>https://github.com/rust-lang/rust/issues/57198</sup>: parser 1.342 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10764-rpass.rs <sup>https://github.com/rust-lang/rust/issues/10764</sup>: extern 1.392 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-73541-2.rs <sup>https://github.com/rust-lang/rust/issues/73541</sup>: async-await 1.422 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7970b.rs <sup>https://github.com/rust-lang/rust/issues/7970</sup>: parser 1.439 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57684.rs <sup>https://github.com/rust-lang/rust/issues/57684</sup>: parser 1.512 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33264.rs <sup>https://github.com/rust-lang/rust/issues/33264</sup>: llvm-asm 1.523 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-65284-suggest-generic-trait-bound.rs <sup>https://github.com/rust-lang/rust/issues/65284</sup>: suggestions 1.647 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17458.rs <sup>https://github.com/rust-lang/rust/issues/17458</sup>: consts 1.711 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56762.rs <sup>https://github.com/rust-lang/rust/issues/56762</sup>: consts 1.787 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2216.rs <sup>https://github.com/rust-lang/rust/issues/2216</sup>: for-loop-while 1.856 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs <sup>https://github.com/rust-lang/rust/issues/45696</sup>: nll 2.009 https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-46036.rs <sup>https://github.com/rust-lang/rust/issues/46036</sup>: nll 2.059 ````@petrochenkov```` Can you put a place holder (like `N/A`) for tests without GitHub issues? It is a lot easier to parse fixed sized rows.
2021-02-01Rollup merge of #81364 - camelid:improve-build-matches-docs, r=varkorJonas Schievink-55/+74
Improve `rustc_mir_build::matches` docs - Fix typos - Add more information - General cleanup
2021-02-01Rollup merge of #79291 - JulianKnodt:ce_priv, r=petrochenkovJonas Schievink-8/+111
Add error message for private fn Attempts to add a more detailed error when a `const_evaluatable` fn from another scope is used inside of a scope which cannot access it. r? ````@lcnr````
2021-02-01Rollup merge of #78641 - the8472:buffered-copy, r=sfacklerJonas Schievink-8/+138
Let io::copy reuse BufWriter buffers This optimization will allow users to implicitly set the buffer size for io::copy by wrapping the writer into a `BufWriter` if the default block size is insufficient, which should fix #49921 Due to min_specialization limitations this approach only works with `BufWriter` but not for `BufReader<R>` since `R` is unconstrained and thus the necessary specialization on `R: Read` is not always applicable. Once specialization becomes more powerful this optimization could be extended to look at the reader and writer side and use whichever buffer is larger.