about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-02-13Introduce query_storage.Camille GILLOT-6/+9
2021-02-13Introduce query_stored module.Camille GILLOT-8/+12
2021-02-13Merge {get,ensure}_query.Camille GILLOT-26/+24
2021-02-13Auto merge of #81666 - hyd-dev:miri-windows-test-fail, r=Mark-Simulacrumbors-14/+18
Don't release Miri if its tests only failed on Windows Extends #66053 to Windows, so the released Miri won't be broken if its tests only fail on Windows. Relevant Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Miri.20is.20still.20available.20in.20rustup.20today.3F
2021-02-13Auto merge of #81854 - the8472:specialize-clone-slice, r=Mark-Simulacrumbors-9/+31
specialize slice::clone_from_slice() for T: Copy
2021-02-13Auto merge of #82053 - JohnTitor:rollup-ymi9q0g, r=JohnTitorbors-309/+491
Rollup of 8 pull requests Successful merges: - #81811 (Fix doc test for Vec::retain(), now passes clippy::eval_order_dependence) - #81900 (Organize trait test files) - #81995 (Fix suggestion to introduce explicit lifetime) - #82031 (Drop an unnecessary intermediate variable) - #82033 (Refactor `get_word_attr` to return only `Option`) - #82040 (Add test to prevent src link regression) - #82041 (Add docs for shared_from_slice From impls) - #82050 (Added tests to drain an empty vec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-13Rollup merge of #82050 - hbina:fix/added-test-to-drain-empty-vec, r=dtolnayYuki Okushi-0/+11
Added tests to drain an empty vec Discovered this kind of issue in an unrelated library. The author copied the tests from here and AFAIK, there are no tests for this particular case. https://github.com/LeonineKing1199/minivec/pull/19 Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-02-13Rollup merge of #82041 - notriddle:shared-from-slice-docs, r=m-ou-seYuki Okushi-0/+98
Add docs for shared_from_slice From impls The advantage of making these docs is mostly in pointing out that these functions all make new allocations and copy/clone/move the source into them. These docs are on the function, and not the `impl` block, to avoid showing the "[+] show undocumented items" button. CC #51430
2021-02-13Rollup merge of #82040 - GuillaumeGomez:ensure-src-link, r=CraftSpiderYuki Okushi-0/+6
Add test to prevent src link regression Fixes #80502. This PR is simply about adding a test to prevent a regression. cc `@bugadani` `@CraftSpider` r? `@camelid`
2021-02-13Rollup merge of #82033 - magurotuna:issue82016, r=jyn514Yuki Okushi-17/+16
Refactor `get_word_attr` to return only `Option` This commit removes `bool` from the return type of `NestedAttributesExt::get_word_attr` so it will return only `Option<ast::NestedMetaItem>` for less redundancy. Closes #82016 r? `@jyn514`
2021-02-13Rollup merge of #82031 - LingMan:unneeded_var, r=varkorYuki Okushi-3/+1
Drop an unnecessary intermediate variable Neither does it shorten the code nor does it provide a helpful name. `@rustbot` modify labels +C-cleanup +T-compiler r? `@varkor`
2021-02-13Rollup merge of #81995 - 0yoyoyo:fix-issue-81650-explicit-lifetime-error, ↵Yuki Okushi-1/+70
r=estebank Fix suggestion to introduce explicit lifetime Addresses #81650 Error message after fix: ``` error[E0311]: the parameter type `T` may not live long enough --> src/main.rs:25:11 | 24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) { | -- help: consider adding an explicit lifetime bound...: `T: 'a +` 25 | scope.spawn(move |_| { | ^^^^^ | note: the parameter type `T` must be valid for the anonymous lifetime #2 defined on the function body at 24:1... --> src/main.rs:24:1 | 24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...so that the type `[closure@src/main.rs:25:17: 27:6]` will meet its required lifetime bounds --> src/main.rs:25:11 | 25 | scope.spawn(move |_| { | ^^^^^ ```
2021-02-13Rollup merge of #81900 - vandenheuvel:organize_trait_tests, r=Mark-SimulacrumYuki Okushi-285/+285
Organize trait test files Organizes trait tests in folders where reasonable and removes name redundancies.
2021-02-13Rollup merge of #81811 - schteve:fix_vec_retain_doc_test, r=m-ou-seYuki Okushi-3/+4
Fix doc test for Vec::retain(), now passes clippy::eval_order_dependence Doc test for Vec::retain() works correctly but is flagged by clippy::eval_order_dependence. Fix avoids the issue by using an iterator instead of an index.
2021-02-13Added tests to drain an empty vecHanif Bin Ariffin-0/+11
Discovered this kind of issue in an unrelated library. The author copied the tests from here and AFAIK, there are no tests for this particular case. Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-02-13Auto merge of #82045 - Dylan-DPC:rollup-244l0sb, r=Dylan-DPCbors-76/+494
Rollup of 10 pull requests Successful merges: - #79775 (Fix injected errors when running doctests on a crate named after a keyword) - #81012 (Stabilize the partition_point feature) - #81479 (Allow casting mut array ref to mut ptr) - #81506 (HWAddressSanitizer support) - #81741 (Increment `self.index` before calling `Iterator::self.a.__iterator_ge…) - #81850 (use RWlock when accessing os::env) - #81911 (GAT/const_generics: Allow with_opt_const_param to return GAT param def_id) - #82022 (Push a `char` instead of a `str` with len one into a String) - #82023 (Remove unnecessary lint allow attrs on example) - #82030 (Use `Iterator::all` instead of open-coding it) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-12Rollup merge of #82030 - LingMan:init_directly, r=varkorDylan DPC-8/+2
Use `Iterator::all` instead of open-coding it Shorter code and by initializing to the final value directly, the variable doesn't need to be mut.
2021-02-12Rollup merge of #82023 - MikailBag:boxed-docs-unallow, r=jyn514Dylan DPC-2/+0
Remove unnecessary lint allow attrs on example It seems they are not needed anymore.
2021-02-12Rollup merge of #82022 - LingMan:single_char, r=jonas-schievinkDylan DPC-1/+1
Push a `char` instead of a `str` with len one into a String ``@rustbot`` modify labels +C-cleanup +T-compiler
2021-02-12Rollup merge of #81911 - BoxyUwU:constgenericgaticefix, r=nikomatsakisDylan DPC-0/+139
GAT/const_generics: Allow with_opt_const_param to return GAT param def_id Fixes #75415 Fixes #79666 cc ```@lcnr``` I've absolutely no idea who to r? for this...
2021-02-12Rollup merge of #81850 - the8472:env-rwlock, r=m-ou-seDylan DPC-12/+72
use RWlock when accessing os::env Multiple threads modifying the current process environment is fairly uncommon. Optimize for the more common read case. r? ````@m-ou-se````
2021-02-12Rollup merge of #81741 - ↵Dylan DPC-3/+4
sdroege:zip-trusted-random-access-specialization-panic-safety, r=KodrAus Increment `self.index` before calling `Iterator::self.a.__iterator_ge… …`t_unchecked` in `Zip` `TrustedRandomAccess` specialization Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the index would not have been incremented yet and another call to `Iterator::next` would read from the same index again, which is not allowed according to the API contract of `TrustedRandomAccess` for `!Clone`. Fixes https://github.com/rust-lang/rust/issues/81740
2021-02-12Rollup merge of #81506 - vo4:hwasan, r=nagisaDylan DPC-14/+187
HWAddressSanitizer support # Motivation Compared to regular ASan, HWASan has a [smaller overhead](https://source.android.com/devices/tech/debug/hwasan). The difference in practice is that HWASan'ed code is more usable, e.g. Android device compiled with HWASan can be used as a daily driver. # Example ``` fn main() { let xs = vec![0, 1, 2, 3]; let _y = unsafe { *xs.as_ptr().offset(4) }; } ``` ``` ==223==ERROR: HWAddressSanitizer: tag-mismatch on address 0xefdeffff0050 at pc 0xaaaad00b3468 READ of size 4 at 0xefdeffff0050 tags: e5/00 (ptr/mem) in thread T0 #0 0xaaaad00b3464 (/root/main+0x53464) #1 0xaaaad00b39b4 (/root/main+0x539b4) #2 0xaaaad00b3dd0 (/root/main+0x53dd0) #3 0xaaaad00b61dc (/root/main+0x561dc) #4 0xaaaad00c0574 (/root/main+0x60574) #5 0xaaaad00b6290 (/root/main+0x56290) #6 0xaaaad00b6170 (/root/main+0x56170) #7 0xaaaad00b3578 (/root/main+0x53578) #8 0xffff81345e70 (/lib64/libc.so.6+0x20e70) #9 0xaaaad0096310 (/root/main+0x36310) [0xefdeffff0040,0xefdeffff0060) is a small allocated heap chunk; size: 32 offset: 16 0xefdeffff0050 is located 0 bytes to the right of 16-byte region [0xefdeffff0040,0xefdeffff0050) allocated here: #0 0xaaaad009bcdc (/root/main+0x3bcdc) #1 0xaaaad00b1eb0 (/root/main+0x51eb0) #2 0xaaaad00b20d4 (/root/main+0x520d4) #3 0xaaaad00b2800 (/root/main+0x52800) #4 0xaaaad00b1cf4 (/root/main+0x51cf4) #5 0xaaaad00b33d4 (/root/main+0x533d4) #6 0xaaaad00b39b4 (/root/main+0x539b4) #7 0xaaaad00b61dc (/root/main+0x561dc) #8 0xaaaad00b3578 (/root/main+0x53578) #9 0xaaaad0096310 (/root/main+0x36310) Thread: T0 0xeffe00002000 stack: [0xffffc0590000,0xffffc0d90000) sz: 8388608 tls: [0xffff81521020,0xffff815217d0) Memory tags around the buggy address (one tag corresponds to 16 bytes): 0xfefcefffef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffef90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffefe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefcefffeff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0xfefceffff000: a2 a2 05 00 e5 [00] 00 00 00 00 00 00 00 00 00 00 0xfefceffff010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0xfefceffff080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Tags for short granules around the buggy address (one tag corresponds to 16 bytes): 0xfefcefffeff0: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. =>0xfefceffff000: .. .. c5 .. .. [..] .. .. .. .. .. .. .. .. .. .. 0xfefceffff010: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. See https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html#short-granules for a description of short granule tags Registers where the failure occurred (pc 0xaaaad00b3468): x0 e500efdeffff0050 x1 0000000000000004 x2 0000ffffc0d8f5a0 x3 0200efff00000000 x4 0000ffffc0d8f4c0 x5 000000000000004f x6 00000ffffc0d8f36 x7 0000efff00000000 x8 e500efdeffff0050 x9 0200efff00000000 x10 0000000000000000 x11 0200efff00000000 x12 0200effe000006b0 x13 0200effe000006b0 x14 0000000000000008 x15 00000000c00000cf x16 0000aaaad00a0afc x17 0000000000000003 x18 0000000000000001 x19 0000ffffc0d8f718 x20 ba00ffffc0d8f7a0 x21 0000aaaad00962e0 x22 0000000000000000 x23 0000000000000000 x24 0000000000000000 x25 0000000000000000 x26 0000000000000000 x27 0000000000000000 x28 0000000000000000 x29 0000ffffc0d8f650 x30 0000aaaad00b3468 ``` # Comments/Caveats * HWASan is only supported on arm64. * I'm not sure if I should add a feature gate or piggyback on the existing one for sanitizers. * HWASan requires `-C target-feature=+tagged-globals`. That flag should probably be set transparently to the user. Not sure how to go about that. # TODO * Need more tests. * Update documentation. * Fix symbolization. * Integrate with CI
2021-02-12Rollup merge of #81479 - osa1:issue24151, r=lcnrDylan DPC-25/+55
Allow casting mut array ref to mut ptr Allow casting mut array ref to mut ptr We now allow two new casts: - mut array reference to mut ptr. Example: let mut x: [usize; 2] = [0, 0]; let p = &mut x as *mut usize; We allow casting const array references to const pointers so not allowing mut references to mut pointers was inconsistent. - mut array reference to const ptr. Example: let mut x: [usize; 2] = [0, 0]; let p = &mut x as *const usize; This was similarly inconsistent as we allow casting mut references to const pointers. Existing test 'vector-cast-weirdness' updated to test both cases. Fixes #24151
2021-02-12Rollup merge of #81012 - VillSnow:stabilize_partition_point, r=matkladDylan DPC-4/+24
Stabilize the partition_point feature Stabilize the partition_point feature. Tracking Issue: #73831 First PR: #73577
2021-02-12Rollup merge of #79775 - jyn514:doctest, r=GuillaumeGomezDylan DPC-7/+10
Fix injected errors when running doctests on a crate named after a keyword Closes https://github.com/rust-lang/rust/issues/79771
2021-02-12Add docs for shared_from_slice From implsMichael Howell-0/+98
The advantage of making these docs is mostly in pointing out that these functions all make new allocations and copy/clone/move the source into them. These docs are on the function, and not the `impl` block, to avoid showing the "[+] show undocumented items" button. CC #51430
2021-02-12Add test to prevent src link regressionGuillaume Gomez-0/+6
2021-02-12Auto merge of #81744 - rylev:overlapping-early-exit2, r=lcnrbors-1/+38
Try fast_reject::simplify_type in coherence before doing full check This is a reattempt at landing #69010 (by `@jonas-schievink).` The change adds a fast path for coherence checking to see if there's no way for types to unify since full coherence checking can be somewhat expensive. This has big effects on code generated by the [`windows`](https://github.com/microsoft/windows-rs) which in some cases spends as much as 20% of compilation time in the `specialization_graph_of` query. In local benchmarks this took a compilation that previously took ~500 seconds down to ~380 seconds. This is surely not going to make a difference on much smaller crates, so the question is whether it will have a negative impact. #69010 was closed because some of the perf suite crates did show small regressions. Additional discussion of this issue is happening [here](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/windows-rs.20perf).
2021-02-13Rename to `inline_attr` and use if-let to extract `NestedMetaItem`Yusuke Tanaka-12/+13
2021-02-12Don't check self type twiceRyan Levick-4/+1
2021-02-12Switch boolean checksRyan Levick-1/+1
2021-02-13Refactor `get_word_attr` to return only `Option`Yusuke Tanaka-7/+5
2021-02-12Auto merge of #82025 - JohnTitor:rollup-cohp0gy, r=JohnTitorbors-135/+288
Rollup of 16 pull requests Successful merges: - #79983 (fix indefinite article in cell.rs) - #81831 (Don't display `mut` in arguments for functions documentation) - #81947 (Relax ItemCtxt::to_ty lifetime) - #81954 (RELEASES.md 1.50: Group platform support notes together) - #81955 (bootstrap: Locate llvm-dwp based on llvm-config bindir) - #81959 (Fix assosiated typo) - #81964 (Fix documentation not showing on localStorage error) - #81968 (bootstrap: fix wrong docs installation path) - #81990 (Make suggestion of changing mutability of arguments broader) - #81994 (Improve long explanation for E0542 and E0546) - #81997 (dist: include src/build_helper as part of the crate graph for rustc-dev) - #82003 (Stack probes: fix error message) - #82004 (clean up clean::Static struct) - #82011 (Fix private intra-doc warnings on associated items) - #82013 (Tell user how to fix CI file being not up to date) - #82017 (Fix typo in mod.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-12Drop an unnecessary intermediate variableLingMan-3/+1
Neither does it shorten the code nor does it provide a helpful name.
2021-02-12Short circuit full corherence check when dealing with types with different ↵Ryan Levick-5/+15
reference mutability
2021-02-12Use `Iterator::all` instead of open-coding itLingMan-8/+2
Shorter code and by initializing to the final value directly, the variable doesn't need to be mut.
2021-02-12stabilize partition_pointVillSnow-4/+1
2021-02-12update documentsVillSnow-0/+23
2021-02-12Add nll test0yoyoyo-0/+17
2021-02-12Rollup merge of #82017 - eltociear:patch-8, r=jyn514Yuki Okushi-1/+1
Fix typo in mod.rs insted -> instead
2021-02-12Rollup merge of #82013 - Mark-Simulacrum:better-ci-error, r=jyn514Yuki Okushi-1/+5
Tell user how to fix CI file being not up to date This hopefully should avoid future questions like in https://github.com/rust-lang/rust/pull/79979#issuecomment-776241356.
2021-02-12Rollup merge of #82011 - jyn514:warn-private-assoc-item, r=max-hellerYuki Okushi-9/+31
Fix private intra-doc warnings on associated items The issue was that the `kind, id` override was previously only being considered for the disambiguator check, not the privacy check. This uses the same ID for both. Fixes https://github.com/rust-lang/rust/issues/81981. r? ``@max-heller``
2021-02-12Rollup merge of #82004 - GuillaumeGomez:clean-static-struct, r=jyn514Yuki Okushi-71/+63
clean up clean::Static struct Having a `String` for the expression didn't make much sense, and even less when it's actually not used (except in json so I kept it). r? ``@jyn514``
2021-02-12Rollup merge of #82003 - ojeda:stack-probe-msg, r=estebankYuki Okushi-1/+1
Stack probes: fix error message
2021-02-12Rollup merge of #81997 - bnjbvr:dist-include-build-helper, r=Mark-SimulacrumYuki Okushi-0/+8
dist: include src/build_helper as part of the crate graph for rustc-dev The build_helper dependency is used to build the compiler/rustc_llvm build script. Since it was missing, it wasn't possible to really use rustc-dev to build, see for instance: https://github.com/rust-analyzer/rust-analyzer/issues/7589.
2021-02-12Rollup merge of #81994 - jesusprubio:improve-long-explanation-e0542-e0546, ↵Yuki Okushi-2/+2
r=GuillaumeGomez Improve long explanation for E0542 and E0546 Helps with #61137 To keep the consistency with: https://github.com/rust-lang/rust/pull/81925
2021-02-12Rollup merge of #81990 - matsujika:suggest-mut-reference, r=estebankYuki Okushi-16/+71
Make suggestion of changing mutability of arguments broader Fix #81421 Previously rustc tries to emit the suggestion of changing mutablity unless `!trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)` and this led to some false negatives to occur.
2021-02-12Rollup merge of #81968 - pietroalbini:fix-doc-install-path, r=Mark-SimulacrumYuki Okushi-1/+1
bootstrap: fix wrong docs installation path This PR fixes https://github.com/rust-lang/rust/issues/81967, a regression introduced by https://github.com/rust-lang/rust/pull/80797. The commit has already been backported to stable 1.50.0. r? ``````@Mark-Simulacrum``````
2021-02-12Rollup merge of #81964 - lovasoa:patch-1, r=GuillaumeGomezYuki Okushi-23/+8
Fix documentation not showing on localStorage error Fixes https://github.com/rust-lang/rust/issues/81928 The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies: > developers should make sure to always catch possible exceptions from setItem()