about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2020-09-16Rollup merge of #76721 - camelid:intra-doc-links-for-core-mem, r=jyn514Tyler Mandry-40/+17
Use intra-doc links in `core::mem` Part of #75080. Last one for now! --- @rustbot modify labels: A-intra-doc-links T-doc
2020-09-16Rollup merge of #76719 - hameerabbasi:min-const-generics-ty, r=lcnrTyler Mandry-14/+80
Change error message for ty param in const This PR introduces the following changes: * Change error message for type param in a const expression when using `min_const_generics` * Change `ParamInNonTrivialAnonConst` to contain an extra `bool` used for distinguishing whether the passed-in symbol is a type or a value. Fixes #76701
2020-09-16Rollup merge of #76642 - GuillaumeGomez:ignored-private-doc-test, r=jyn514Tyler Mandry-12/+20
Do not lint ignored private doc tests Fixes #76457. r? @ehuss
2020-09-16Rollup merge of #75026 - JulianKnodt:array_windows, r=AmanieuTyler Mandry-6/+196
Add array_windows fn This mimicks the functionality added by array_chunks, and implements a const-generic form of `windows`. It makes egregious use of `unsafe`, but by necessity because the array must be re-interpreted as a slice of arrays, and unlike array_chunks this cannot be done by casting the original array once, since each time the index is advanced it needs to move one element, not `N`. I'm planning on adding more tests, but this should be good enough as a premise for the functionality. Notably: should there be more functions overwritten for the iterator implementation/in general? ~~I've marked the issue as #74985 as there is no corresponding exact issue for `array_windows`, but it's based of off `array_chunks`.~~ Edit: See Issue #75027 created by @lcnr for tracking issue ~~Do not merge until I add more tests, please.~~ r? @lcnr
2020-09-16Add array window fnkadmin-6/+196
Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained
2020-09-16Auto merge of #76786 - Dylan-DPC:rollup-x6p60m6, r=Dylan-DPCbors-170/+322
Rollup of 10 pull requests Successful merges: - #76669 (Prefer asm! over llvm_asm! in core) - #76675 (Small improvements to asm documentation) - #76681 (remove orphaned files) - #76694 (Introduce a PartitioningCx struct) - #76695 (fix syntax error in suggesting generic constraint in trait parameter) - #76699 (improve const infer error) - #76707 (Simplify iter flatten struct doc) - #76710 (:arrow_up: rust-analyzer) - #76714 (Small docs improvements) - #76717 (Fix generating rustc docs with non-default lib directory.) Failed merges: r? `@ghost`
2020-09-16Rollup merge of #76717 - ehuss:fix-rustc-book-libdir, r=Mark-SimulacrumDylan DPC-7/+18
Fix generating rustc docs with non-default lib directory. If `libdir` is set in `config.toml`, then the tool to generate the rustc docs was unable to run `rustc` because it could not find the shared libraries. The solution is to set the dylib search path to include the libdir. I changed the API of `add_rustc_lib_path` to take `Command` instead of `Cargo` to try to share the code in several places. This is how it worked before https://github.com/rust-lang/rust/pull/64316, and I think this still retains the spirit of that change. Fixes #76702
2020-09-16Rollup merge of #76714 - camelid:patch-3, r=jonas-schievinkDylan DPC-11/+11
Small docs improvements @rustbot modify labels: T-doc T-compiler
2020-09-16Rollup merge of #76710 - rust-lang:rust-analyzer-2020-09-14, r=jonas-schievinkDylan DPC-16/+33
:arrow_up: rust-analyzer r? @ghost
2020-09-16Rollup merge of #76707 - pickfire:patch-4, r=jonas-schievinkDylan DPC-5/+2
Simplify iter flatten struct doc
2020-09-16Rollup merge of #76699 - lcnr:const-infer-err, r=varkorDylan DPC-15/+73
improve const infer error cc #72328 reduces it from ``` error[E0282]: type annotations needed --> src/main.rs:17:5 | 17 | Foo.bar().bar().bar().bar().baz(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: unable to infer the value of a const parameter ``` to ``` error[E0282]: type annotations needed --> $DIR/method-chain.rs:21:33 | LL | Foo.bar().bar().bar().bar().baz(); | ^^^ | = note: cannot infer the value of the const parameter `N` ``` r? @varkor
2020-09-16Rollup merge of #76695 - iximeow:trait-generic-bound-suggestion, r=estebankDylan DPC-22/+105
fix syntax error in suggesting generic constraint in trait parameter suggest `where T: Foo` for the first bound on a trait, then suggest `, T: Foo` when the suggested bound would add to an existing set of `where` clauses. `where T: Foo` may be the first bound if `T` has a default, because we'd rather suggest ``` trait A<T=()> where T: Copy ``` than ``` trait A<T: Copy=()> ``` for legibility reasons. the test case i added here is derived from [this reproduction](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0bf3ace9f2a183d0bdbd748c6b8e3971): ``` struct B<T: Copy> { t: T } trait A<T = ()> { fn returns_constrained_type(&self, t: T) -> B<T> { B { t } } } ``` where the suggested fix, ``` trait A<T = ()>, T: Copy { ... } ``` is in fact invalid syntax! i also found an error in the existing suggestion for `trait Base<T = String>: Super<T>` where rustc would suggest `trait Base<T = String>: Super<T>, T: Copy`, but `T: Copy` is the first of the trait's `where` clauses and should be `where T: Copy` as well. the test for that suggestion expects invalid syntax, and has been revised to a compiler-pleasing `trait Base<T = String>: Super<T> where T: Copy`. judging by https://github.com/rust-lang/rust/pull/70009 i'll.. cc @estebank ?
2020-09-16Rollup merge of #76694 - wesleywiser:partitioning_cx_trait, r=davidtwcoDylan DPC-34/+38
Introduce a PartitioningCx struct This contains all the data used by the partitioning algorithm and allows that data to be used at each stage of the partitioning. This is useful for other approaches to partitioning which may want different pieces of the data available at each step. cc @rust-lang/wg-incr-comp
2020-09-16Rollup merge of #76681 - tshepang:unused, r=Mark-SimulacrumDylan DPC-52/+0
remove orphaned files Should been part of https://github.com/rust-lang/rust/pull/74163
2020-09-16Rollup merge of #76675 - lzutao:asm_doc, r=AmanieuDylan DPC-3/+22
Small improvements to asm documentation Save people from searching and reading tons of comments in tracking issues.
2020-09-16Rollup merge of #76669 - lzutao:core_asm, r=AmanieuDylan DPC-5/+20
Prefer asm! over llvm_asm! in core Replace llvm_asm! with asm! in core. x86 asm compare (in somecases I replaced generic type with String). * https://rust.godbolt.org/z/59eEMv * https://rust.godbolt.org/z/v78s6q * https://rust.godbolt.org/z/7qYY41
2020-09-16Fix black_box bug detected by AmanieuLzu Tao-1/+1
Co-authored-by: Amanieu <amanieu@gmail.com>
2020-09-16Auto merge of #76781 - RalfJung:rollup-ve66o2j, r=RalfJungbors-274/+292
Rollup of 10 pull requests Successful merges: - #76056 (Add more info for Vec Drain doc) - #76062 (Vec slice example fix style and show type elision) - #76262 (Use inline(never) instead of cold) - #76335 (Make all methods of `Duration` unstably const) - #76366 (Add Arith Tests in Library) - #76369 (Move Various str tests in library) - #76534 (Add doc comments for From impls) - #76622 (Update bootstrap readme) - #76641 (Some cleanup changes and commenting) - #76662 (Fix liballoc test suite for Miri) Failed merges: r? `@ghost`
2020-09-16Rollup merge of #76662 - RalfJung:lib-test-miri, r=Mark-SimulacrumRalf Jung-86/+85
Fix liballoc test suite for Miri Mostly, fix the regression introduced by https://github.com/rust-lang/rust/pull/75207 that caused slices (i.e., references) to be created to invalid memory or memory that has aliasing pointers that we want to keep valid. @dylni this changes the type of `check_range` to only require the length, not the full reference to the slice, which indeed is all the information this function requires. Also reduce the size of a test introduced in https://github.com/rust-lang/rust/pull/70793 to make it not take 3 minutes in Miri. This makes https://github.com/RalfJung/miri-test-libstd work again.
2020-09-16Rollup merge of #76641 - nox:pointee-random-stuff, r=eddybRalf Jung-22/+13
Some cleanup changes and commenting r? @nikomatsakis Cc @eddyb
2020-09-16Rollup merge of #76622 - jyn514:bootstrap-readme, r=Mark-SimulacrumRalf Jung-28/+10
Update bootstrap readme - Reflect changes in x.py defaults - Remove recommendation to use nightly for incremental; it works fine on beta - Remove note that incremental chooses stage 1 by default; stage 1 is already the default - Update Discord -> Zulip r? @Mark-Simulacrum
2020-09-16Rollup merge of #76534 - notriddle:doc-comments, r=jyn514Ralf Jung-0/+12
Add doc comments for From impls https://github.com/rust-lang/rust/issues/51430
2020-09-16Rollup merge of #76369 - ayushmishra2005:move_various_str_tests_library, ↵Ralf Jung-20/+21
r=jyn514 Move Various str tests in library Moved various string ui tests in library as a part of #76268 r? @matklad
2020-09-16Rollup merge of #76366 - ayushmishra2005:arith_tests_in_library, r=jyn514Ralf Jung-41/+29
Add Arith Tests in Library Added Arith Tests library as a part of #76268 r? @matklad
2020-09-16Rollup merge of #76335 - CDirkx:const-duration, r=ecstatic-morseRalf Jung-73/+116
Make all methods of `Duration` unstably const Make the following methods of `Duration` unstable const under `duration_const_2`: - `from_secs_f64` - `from_secs_f32` - `mul_f64` - `mul_f32` - `div_f64` - `div_f32` This results in all methods of `Duration` being (unstable) const. Moved the tests to `library` as part of #76268. Possible because of #72449, which made the relevant `f32` and `f64` methods const. Tracking issue: #72440 r? @ecstatic-morse
2020-09-16Rollup merge of #76262 - howard0su:patch-1, r=cramertjRalf Jung-3/+2
Use inline(never) instead of cold inline(never) is better way to avoid optimizer to inline the function instead of cold.
2020-09-16Rollup merge of #76062 - pickfire:patch-13, r=jyn514Ralf Jung-1/+3
Vec slice example fix style and show type elision
2020-09-16Rollup merge of #76056 - pickfire:patch-10, r=jyn514Ralf Jung-0/+1
Add more info for Vec Drain doc See its documentation for more
2020-09-16Prefer asm! over llvm_asm! in coreLzu Tao-5/+20
2020-09-16Auto merge of #76625 - jyn514:default-stages, r=Mark-Simulacrumbors-42/+79
Make the default stage for x.py configurable This also allows configuring each sub-command individually. Possibly #76617 should land before this? I don't feel strongly either way, I don't mind waiting. Closes https://github.com/rust-lang/rust/issues/76165. r? `@Mark-Simulacrum`
2020-09-16document how to use memory addresses as operandsLzu Tao-0/+19
Co-authored-by: Amanieu <amanieu@gmail.com>
2020-09-16Auto merge of #76771 - Dylan-DPC:rollup-qj4j3ma, r=Dylan-DPCbors-972/+563
Rollup of 10 pull requests Successful merges: - #73955 (deny(unsafe_op_in_unsafe_fn) in libstd/process.rs) - #75146 (Detect overflow in proc_macro_server subspan) - #75304 (Note when a a move/borrow error is caused by a deref coercion) - #75749 (Consolidate some duplicate code in the sys modules.) - #75882 (Use translated variable for test string) - #75886 (Test that bounds checks are elided for [..index] after .position()) - #76048 (Initial support for riscv32gc_unknown_linux_gnu) - #76198 (Make some Ordering methods const) - #76689 (Upgrade to pulldown-cmark 0.8.0) - #76763 (Update cargo) Failed merges: r? `@ghost`
2020-09-16Rollup merge of #76763 - ehuss:update-cargo, r=ehussDylan DPC-0/+0
Update cargo 6 commits in 875e0123259b0b6299903fe4aea0a12ecde9324f..8777a6b1e8834899f51b7e09cc9b8d85b2417110 2020-09-08 20:17:21 +0000 to 2020-09-15 19:11:03 +0000 - updated yank error message (rust-lang/cargo#8697) - Fix non-determinism with new feature resolver. (rust-lang/cargo#8701) - Display formatted output for JSON diffing in tests. (rust-lang/cargo#8692) - Add --name suggestion for cargo new (rust-lang/cargo#8675) - Sweep unrelated message from unnecessary workspace infromation (rust-lang/cargo#8681) - Docs: Make it more clear we have two types of workspaces (rust-lang/cargo#8666)
2020-09-16Rollup merge of #76689 - jyn514:update-pulldown, r=GuillaumeGomezDylan DPC-20/+52
Upgrade to pulldown-cmark 0.8.0 Thanks to marcusklaas' hard work in https://github.com/raphlinus/pulldown-cmark/pull/469, this fixes a lot of rustdoc bugs! - Get rid of unnecessary `RefCell` - Fix duplicate warnings for broken implicit reference link - Remove unnecessary copy of links Closes https://github.com/rust-lang/rust/issues/73264, closes https://github.com/rust-lang/rust/issues/76687. r? @euclio I'm not sure if the switch away from `locate` fixes any open bugs - euclio mentioned some in https://github.com/raphlinus/pulldown-cmark/issues/165, but I didn't see any related issues open for rustdoc. Let me know if I missed one.
2020-09-16Rollup merge of #76198 - CDirkx:const-ordering, r=dtolnayDylan DPC-3/+21
Make some Ordering methods const Resubmission of [PR#75463](https://github.com/rust-lang/rust/pull/75463) as per [PR#76172](https://github.com/rust-lang/rust/pull/76172). Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Insta-stabilizes these methods as const under the `const_ordering` feature, as their implementation is a trivial match and the recent stabilization of #49146 (Allow `if` and `match` in constants). Note: the `const_ordering` feature has never actually been used as these methods have not been `#[rustc_const_unstable]`. Tracking issue: #76113
2020-09-16Rollup merge of #76048 - alistair23:alistair/rv32-linux, r=AmanieuDylan DPC-0/+27
Initial support for riscv32gc_unknown_linux_gnu Now that RISC-V 32-bit (RV32) support is in upstream glibc let's add support for userspace Rust.
2020-09-16Rollup merge of #75886 - erikdesjardins:index, r=nikicDylan DPC-0/+78
Test that bounds checks are elided for [..index] after .position() Closes #73396. This was fixed by the LLVM 11 update in #73526.
2020-09-16Rollup merge of #75882 - pickfire:patch-6, r=jyn514Dylan DPC-2/+2
Use translated variable for test string Test should be educative, added english translation and pronounciation.
2020-09-16Rollup merge of #75749 - ehuss:consolidate-sys, r=alexcrichtonDylan DPC-889/+56
Consolidate some duplicate code in the sys modules. This consolidates some modules which were duplicated throughout the sys module. The intent is to make it easier to update and maintain this code. This mainly affects the wasi, sgx, and "unsupported" targets. I explicitly skipped hermit, cloudabi, and vxworks. These tier-3 targets have copied large sections of the sys tree. I don't think they should have, but I don't want to put effort into changing them. It also doesn't help that there aren't any scripts or instructions for building them. There are still sections of duplicate code here and there, but this PR covers the easy parts where entire modules are the same.
2020-09-16Rollup merge of #75304 - Aaron1011:feature/diag-deref-move-out, r=estebankDylan DPC-54/+250
Note when a a move/borrow error is caused by a deref coercion Fixes #73268 When a deref coercion occurs, we may end up with a move error if the base value has been partially moved out of. However, we do not indicate anywhere that a deref coercion is occuring, resulting in an error message with a confusing span. This PR adds an explicit note to move errors when a deref coercion is involved. We mention the name of the type that the deref-coercion resolved to, as well as the `Deref::Target` associated type being used.
2020-09-16Rollup merge of #75146 - tmiasko:range-overflow, r=Mark-SimulacrumDylan DPC-2/+72
Detect overflow in proc_macro_server subspan * Detect overflow in proc_macro_server subspan * Add tests for overflow in Vec::drain * Add tests for overflow in String / VecDeque operations using ranges
2020-09-16Rollup merge of #73955 - hellow554:unsafe_process, r=Mark-SimulacrumDylan DPC-2/+5
deny(unsafe_op_in_unsafe_fn) in libstd/process.rs The libstd/process.rs part of #73904 . Wraps the two calls to an unsafe fn Initializer::nop() in an unsafe block. Will have to wait for #73909 to be merged, because of the feature in the libstd/lib.rs
2020-09-15Auto merge of #76755 - pietroalbini:gha-macos, r=Mark-Simulacrumbors-87/+135
Gate macOS on both Azure and GHA As discussed in the previous infrastructure team meeting, this PR gates macOS builds on both GHA and Azure. Once this is merged we'll wait a week or two to see if there is a troublesome rate of spurious failures, and if not we'll remove the builds on the Azure side. r? `@Mark-Simulacrum` cc #71988
2020-09-15Update cargoEric Huss-0/+0
2020-09-15hopefully fix rustdoc linksRalf Jung-1/+1
2020-09-15fix slice::check_range aliasing problemsRalf Jung-86/+85
2020-09-15reduce size of test_from_iter_specialization_with_iterator_adapters test in MiriRalf Jung-1/+1
2020-09-15Auto merge of #73595 - SNCPlay42:lifetime-after-mut, r=Mark-Simulacrumbors-1/+101
improve diagnostics for lifetime after `&mut` If, when parsing a borrow pointee type, we see a lifetime after `mut`, suggest placing the lifetime before `mut` and eat the lifetime to avoid a large number of unhelpful diagnostics. There are some subtleties to avoid false positives in cases like `&mut 'a + Trait`, where `&mut ('a + Trait)` is a better suggestion. fixes #73568
2020-09-15ci: gate macOS on GHA tooPietro Albini-87/+135
2020-09-15Auto merge of #73166 - jethrogb:stdarch, r=Amanieubors-0/+0
Update stdarch This PR **changes the public signature** of the following functions in `core::arch::{x86, x86_64}`: ```patch -pub unsafe fn _mm256_extract_epi8(a: __m256i, imm8: i32) -> i8 +pub unsafe fn _mm256_extract_epi8(a: __m256i, imm8: i32) -> i32 -pub unsafe fn _mm256_extract_epi16(a: __m256i, imm8: i32) -> i16 +pub unsafe fn _mm256_extract_epi16(a: __m256i, imm8: i32) -> i32 ``` This change is desired so that these signatures * are similar to those of the 128-bit versions `_mm_extract_epi8` and `_mm_extract_epi16` * match the Intel definitions for the intrinsics * [RFC 2325](https://github.com/rust-lang/rfcs/blob/master/text/2325-stable-simd.md) specifies that the exact vendor function signatures should be used A [crater run](https://github.com/rust-lang/rust/pull/73166#issuecomment-667230319) revealed only a single breakage. The [vektor crate](https://github.com/AdamNiederer/vektor/blob/master/src/x86/avx2.rs#L2436-L2472) copied the incorrect signatures in `core` exactly to their own crate. The functions don't seem to be used by anyone anywhere. Actual breakage is not expected, since due to the nature of the functions, users would generally write `_mm256_extract_epi8(...) as u8` or `_mm256_extract_epi16(...) as u16`. See https://github.com/rust-lang/stdarch/pull/868/. Note that the changes from that stdarch PR have already partially landed in core after https://github.com/rust-lang/stdarch/pull/878/. This PR is now only about the remaining changes.