about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-09-17Auto merge of #76028 - aticu:improve_e0118, r=estebank,jyn514,GuillaumeGomezbors-9/+31
Improve E0118 - Changes the "base type" terminology to "nominal type" (according to the [reference](https://doc.rust-lang.org/stable/reference/items/implementations.html#inherent-implementations)). - Suggests removing a reference, if one is present on the type. - Clarify what is meant by a "nominal type". closes #69392 This is my first not-entirely-trivial PR, so please let me know if I missed anything or if something could be improved. Though I probably won't be able to fix anything in the upcoming week.
2020-09-16Auto merge of #76804 - tmandry:rollup-nwntt3q, r=tmandrybors-66/+135
Rollup of 16 pull requests Successful merges: - #75026 (Add array_windows fn) - #76642 (Do not lint ignored private doc tests) - #76719 (Change error message for ty param in const) - #76721 (Use intra-doc links in `core::mem`) - #76728 (Add a comment why `extern crate` is necessary for rustdoc) - #76735 (Remove unnecessary `clone()`s in bootstrap) - #76741 (Avoid printing dry run timings) - #76747 (Add missing code examples in libcore) - #76756 (fix a couple of stylistic clippy warnings) - #76758 ([fuchsia] Propagate the userspace UTC clock) - #76759 (Fix stabilization marker for future_readiness_fns) - #76760 (don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)) - #76764 (Update books) - #76775 (Strip a single leading tab when rendering dataflow diffs) - #76778 (Simplify iter fuse struct doc) - #76794 (Make graphviz font configurable) Failed merges: r? `@ghost`
2020-09-16Rollup merge of #76764 - ehuss:update-books, r=ehussTyler Mandry-0/+0
Update books ## nomicon 1 commits in 25854752549d44d76fbd7650e17cb4f167a0b8fb..6e57e64501f61873ab80cb78a07180a22751a5d6 2020-08-19 16:41:48 -0400 to 2020-09-14 11:40:23 -0400 - Fix API change to alloc::Global::grow. (rust-lang-nursery/nomicon#236) ## reference 3 commits in 25391dba46262f882fa846beefaff54a966a8fa5..56a13c082ee90736c08d6abdcd90462517b703d3 2020-09-02 07:22:55 -0700 to 2020-09-14 23:20:16 -0700 - Update the description of staticlib (rust-lang-nursery/reference#884) - Rust 1.46 now allows more features in const fn (rust-lang-nursery/reference#883) - Document the enum changes in RFC 2195 (rust-lang-nursery/reference#879) ## book 1 commits in e5ed97128302d5fa45dbac0e64426bc7649a558c..cb28dee95e5e50b793e6ba9291c5d1568d3ad72e 2020-08-31 12:53:40 -0500 to 2020-09-09 10:06:00 -0500 - Fixed the error message of invalid array element access in ch03.2 (rust-lang/book#2446)
2020-09-16Rollup merge of #76741 - Mark-Simulacrum:no-dry-run-timing, r=alexcrichtonTyler Mandry-1/+1
Avoid printing dry run timings This avoids a wall of text on CI with 0.000 as the likely time. r? @alexcrichton
2020-09-16Rollup merge of #76735 - jyn514:no-clone, r=Mark-SimulacrumTyler Mandry-40/+39
Remove unnecessary `clone()`s in bootstrap The performance difference is negligible, but it makes me feel better. r? @Mark-Simulacrum
2020-09-16Rollup merge of #76728 - jyn514:rustdoc-extern-crate, r=ehussTyler Mandry-2/+10
Add a comment why `extern crate` is necessary for rustdoc r? @ehuss From https://github.com/rust-lang/rust/pull/74293#discussion_r488335500.
2020-09-16Rollup merge of #76719 - hameerabbasi:min-const-generics-ty, r=lcnrTyler Mandry-5/+59
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/+6
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-16Auto merge of #76420 - Gelbpunkt:aarch64-linux-musl, r=pietroalbinibors-24/+15
Add aarch64-unknown-linux-musl host builds This adds aarch64-unknown-linux-musl to the hosts list and adds the build to the dist-arm-linux builder as `@Mark-Simulacrum` suggested to me in Zulip. `@jyn514` requested to be mentioned :smile: I had to update the config for crosstool-ng as it had a prompt about the glibc version. I ran `src/ci/docker/run.sh dist-arm-linux` to test it. ``` Build completed successfully in 1:31:50 Compile requests 8180 Compile requests executed 8135 Cache hits 287 Cache misses 7848 Cache timeouts 0 Cache read errors 0 Forced recaches 0 Cache write errors 0 Compilation failures 0 Cache errors 0 Non-cacheable compilations 0 Non-cacheable calls 36 Non-compilation calls 9 Unsupported compiler calls 0 Average cache write 0.000 s Average cache read miss 6.389 s Average cache read hit 0.000 s Cache location Local disk: "/sccache" Cache size 202 MiB Max cache size 10 GiB == clock drift check == local time: Sun Sep 6 19:30:17 UTC 2020 network time: Sun, 06 Sep 2020 19:30:17 GMT == end clock drift check == ``` Only errors were in miri due to struct fields being private (already been reported [here](https://github.com/rust-lang/rust/issues/76337)) Edit: Maybe it is helpful if I add that it is a working compiler ```sh /rust-nightly-aarch64-unknown-linux-musl # ash install.sh install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh install: installing component 'rustc' install: installing component 'cargo' install: installing component 'rls-preview' install: installing component 'rust-analyzer-preview' install: installing component 'clippy-preview' install: installing component 'rustfmt-preview' install: installing component 'llvm-tools-preview' install: installing component 'rust-analysis-aarch64-unknown-linux-musl' install: installing component 'rust-std-aarch64-unknown-linux-musl' install: WARNING: failed to run ldconfig. this may happen when not installing as root. run with --verbose to see the error Rust is ready to roll. / # cat test.rs fn main() { println!("hello world"); } / # rustc test.rs / # ./test hello world # file test test: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped ```
2020-09-16Add array window fnkadmin-6/+6
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-16Remove unnecessary `clone()`s in bootstrapJoshua Nelson-40/+39
The performance difference is negligible, but it makes me feel better. Note that this does not remove some clones in `config`, because it would require changing the logic around (and performance doesn't matter for bootstrap).
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 #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 #76699 - lcnr:const-infer-err, r=varkorDylan DPC-8/+52
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-2/+59
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 #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-16Auto merge of #76781 - RalfJung:rollup-ve66o2j, r=RalfJungbors-157/+11
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 #76641 - nox:pointee-random-stuff, r=eddybRalf Jung-1/+1
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 #76369 - ayushmishra2005:move_various_str_tests_library, ↵Ralf Jung-20/+0
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/+0
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-67/+0
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-16Auto merge of #76625 - jyn514:default-stages, r=Mark-Simulacrumbors-42/+62
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-22/+204
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-17/+38
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 #76048 - alistair23:alistair/rv32-linux, r=AmanieuDylan DPC-0/+1
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 #75304 - Aaron1011:feature/diag-deref-move-out, r=estebankDylan DPC-5/+87
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-15Auto merge of #76755 - pietroalbini:gha-macos, r=Mark-Simulacrumbors-51/+73
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 booksEric Huss-0/+0
2020-09-15Update cargoEric Huss-0/+0
2020-09-15Auto merge of #73595 - SNCPlay42:lifetime-after-mut, r=Mark-Simulacrumbors-0/+74
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-51/+73
2020-09-15Make the default stage for x.py configurableJoshua Nelson-42/+62
This allows configuring the default stage for each sub-command individually. - Normalize the stage as early as possible, so there's no confusion about which to use. - Don't add an explicit `stage` option in config.toml This offers no more flexibility than `*_stage` and makes it confusing which takes precedence. - Always give `--stage N` precedence over config.toml - Fix bootstrap tests This changes the tests to go through `Config::parse` so that they test the actual defaults, not the dummy ones provided by `default_opts`. To make this workable (and independent of the environment), it does not read `config.toml` for tests.
2020-09-15doc: platform-support.md: Move to tier 3Alistair Francis-1/+1
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-15Auto merge of #76708 - Mark-Simulacrum:lld-macos, r=alexcrichtonbors-0/+11
Always try to promote shared LLVM to the sysroot Even when LLVM is not generally participating in a shared link with rustc, we will likely still link to the shared dylib from rust-lld, so we still need to promote it. This reverts part of #76349; my expectation that the link-shared rule was sufficient was likely wrong. Hopefully fixes #76698. r? `@alexcrichton`
2020-09-15doc: platform-support.md: Document portAlistair Francis-0/+1
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-15improve diagnostics for lifetime after `&mut`SNCPlay42-0/+74
2020-09-15Enable shared linking to LLVM on non-WindowsMark Rousskov-0/+11
Windows doesn't quite support dynamic linking to LLVM yet, but on other platforms we do. In #76708, it was discovered that we dynamically link to LLVM from the LLVM tools (e.g., rust-lld), so we need the shared LLVM library to link against. That means that if we do not have a shared link to LLVM, and want LLVM tools to work, we'd be shipping two copies of LLVM on all of these platforms: one in librustc_driver and one in libLLVM. Also introduce an error into rustbuild if we do end up configured for shared linking on Windows.
2020-09-15Avoid printing dry run timingsMark Rousskov-1/+1
2020-09-15Add a comment why rustdoc loads crates from the sysrootJoshua Nelson-1/+5
2020-09-15Auto merge of #76311 - lzutao:split_core-slice, r=lcnrbors-1/+1
Split `core::slice` to smaller mods Unfortunately the `#[lang = "slice"]` is too big (3003 lines), I cannot split it further. Note for reviewer: * I split to multiple commits for easier reviewing, but I could git squash them all to one if requested. * Recommend pulling this change locally and using advanced git diff viewer or this command: ``` git show --reverse --color-moved=dimmed-zebra master.. ``` --- I split core/slice/mod.rs to these modules: * `ascii`: For operations on `[u8]`. * `cmp`: For comparison operations on `[T]`, like PartialEq and SliceContains impl. * `index`: For indexing operations like Index/IndexMut and SliceIndex. * `iter`: For Iterator definitions and implementation on `[T]`. - `macros`: For iterator! and forward_iterator! macros. * `raw`: For free function to create `&[T]` or `&mut [T]` from pointer + length or a reference. The heapsort wrapper in mod.rs is removed in favor of reexport from `sort::heapsort`.
2020-09-15Fix clippy hard-code slice::Iter pathLzu Tao-1/+1
2020-09-15Auto merge of #76171 - estebank:turbofish-the-revenge, r=davidtwcobors-3/+101
Detect turbofish with multiple type params missing leading `::` Fix #76072.
2020-09-15This commit introduces the following changes:Hameer Abbasi-5/+59
* 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.
2020-09-15Auto merge of #76684 - jyn514:refactor-intra-links, r=manishearthbors-631/+659
Refactor intra doc link code I got tired of `fold_item` being 500 lines long. This is best reviewed one commit at a time with whitespace changes hidden. There are no logic changes other than the last commit making a parameter checked by the caller instead of the callee. r? `@Manishearth`