about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-04-29Rollup merge of #71680 - nicholasbishop:bishop-fix-eq-link, r=Mark-SimulacrumDylan DPC-0/+1
Fix doc link to Eq trait from PartialEq trait The `Eq` link was incorrectly going to the `eq` method of `PartialEq` instead of to the `Eq` trait.
2020-04-29Rollup merge of #71678 - ehuss:rustc-doc-index, r=Mark-SimulacrumDylan DPC-1/+5
Add an index page for nightly rustc docs. This adds an `index.html` page at the root of the nightly-rustc docs so that the URL https://doc.rust-lang.org/nightly/nightly-rustc/ should have a landing page that lists all the crates.
2020-04-29Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPCDylan DPC-2/+2
Fix wrong argument in autoderef process The `overloaded_deref_ty` is a function for derefencing a type which overloads the `Deref` trait. But actually this function never uses the parameter pushed in until this PR. -_-
2020-04-29Rollup merge of #71617 - samrat:suggest-int-into, r=ecstatic-morseDylan DPC-64/+53
Suggest `into` instead of `try_into` if possible with int types If it is possible to convert an integer type into another using `into`, don't suggest `try_into`. This commit changes the suggested method to convert from one integer type to another for the following cases: - u{n} -> i{m} where n < m - u8 -> isize - i{n} -> isize where n <= 16 - u{n} -> usize where n <= 16 Fixes #71580
2020-04-29Rollup merge of #71572 - lcnr:type_length, r=Dylan-DPCDylan DPC-0/+31
test iterator chain type length blowup Adds a regression test. closes #58952 r? @Dylan-DPC
2020-04-29Rollup merge of #71507 - CohenArthur:document-unsafe-libcore-ptr, ↵Dylan DPC-7/+45
r=Mark-Simulacrum Document unsafety in core::ptr Contributes to #66219 I have yet to document all the `unsafe` blocks in the lib and would like to know if I'm headed in the right direction r? @steveklabnik
2020-04-29Allow `Downcast` projections unconditionallyDylan MacKenzie-18/+2
2020-04-29update MiriRalf Jung-10/+7
2020-04-29Auto merge of #71674 - flip1995:clippyup, r=Dylan-DPCbors-7/+7
Update Clippy Fixes #71608
2020-04-29Fix doc link to Eq trait from PartialEq traitNicholas Bishop-0/+1
The `Eq` link was incorrectly going to the `eq` method of `PartialEq` instead of to the `Eq` trait.
2020-04-29Add an index page for nightly rustc docs.Eric Huss-1/+5
2020-04-29ci: use bash when executing the "bors build finished" jobsPietro Albini-0/+2
We don't clone the repository in those builders, so the default shell (src/ci/exec-with-shell.py) is not present there.
2020-04-29Suggest deref when coercing `ty::Ref` to `ty::RawPtr`Donough Liu-4/+162
2020-04-29Update Clippyflip1995-7/+7
2020-04-29Auto merge of #67343 - ecstatic-morse:qualif-structural-match, r=pnkfelixbors-87/+819
Const qualification for `StructuralEq` Furthers #62411. Resolves #62614. The goal of this PR is to implement the logic in #67088 on the MIR instead of the HIR. It uses the `Qualif` trait to track `StructuralPartialEq`/`StructuralEq` in the final value of a `const`. Then, if we encounter a constant during HAIR lowering whose value may not be structurally matchable, we emit the `indirect_structural_match` lint. This PR contains all the tests present in #67088 and emits the proper warnings for the corner cases. This PR does not handle #65466, which would require that we be [more aggressive](https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_mir_build/hair/pattern/const_to_pat.rs#L126-L130) when checking matched types for `PartialEq`. I think that should be done separately. Because this works on MIR and uses dataflow, this PR should accept more cases than #67088. Notably, the qualifs in the final value of a const are encoded cross-crate, so matching on a constant whose value is defined in another crate to be `Option::<TyWithCustomEqImpl>::None` should work. Additionally, if a `const` has branching/looping, we will only emit the warning if any possible control flow path could result in a type with a custom `PartialEq` impl ending up as the final value of a `const`. I'm not sure how #67088 handled this. AFAIK, it's not settled that these are the semantics we actually want: it's just how the `Qualif` framework happens to work. If the cross-crate part is undesirable, it would be quite easy to change the result of `mir_const_qualif().custom_eq` to `true` before encoding it in the crate metadata. This way, other crates would have to assume that all publicly exported constants may not be safe for matching. r? @pnkfelix cc @eddyb
2020-04-29document stable counterparts of intrinsicsBastian Kauschke-12/+86
2020-04-29expand comment in memory.rs with extra soundness concernsRalf Jung-1/+3
2020-04-29some more test casesRalf Jung-14/+109
2020-04-29Rollup merge of #71657 - Daniel-Worrall:24949, r=estebankDylan DPC-0/+179
Add #24949 assoc constant static recursion test Closes #24949 Forced tidy fixes
2020-04-29Rollup merge of #71654 - zachreizner:patch-1, r=jonas-schievinkDylan DPC-1/+1
Update link to unstable book for llvm_asm macro
2020-04-29Rollup merge of #71296 - ChiefMilesEdgeworth:fix_doc_wording, r=Dylan-DPCDylan DPC-2/+3
Change wording on read_vectored docs Closes #70154 I'm happy to work with others to make the wording on this more clear. I think what I have is an improvement but may not be the final wording.
2020-04-29Rollup merge of #71286 - Alexendoo:test-issue-69654, r=Dylan-DPCDylan DPC-0/+32
Add regression test for #69654 closes #69654 r? @eddyb
2020-04-29Rollup merge of #71217 - estebank:tail-borrow-sugg, r=pnkfelixDylan DPC-36/+117
Suggest `;` or assignment to drop borrows in tail exprs Address the diagnostics part of #70844. ``` error[E0597]: `counter` does not live long enough --> $DIR/issue-54556-niconii.rs:22:20 | LL | if let Ok(_) = counter.lock() { } | ^^^^^^^------- | | | borrowed value does not live long enough | a temporary with access to the borrow is created here ... ... LL | } | - | | | `counter` dropped here while still borrowed | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::result::Result<MutexGuard<'_>, ()>` | help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped | LL | if let Ok(_) = counter.lock() { }; | ^ ```
2020-04-29safety-ptr: Add SAFETY on some unsafe blocks from libcore/ptrcohenarthur-3/+43
Add documentation example to slice_from_raw_parts_mut() Add SAFETY explanations to some unsafe blocks in libcore/ptr * libcore/ptr/mod.rs * libcore/ptr/unique.rs * libcore/ptr/non_null.rs safety-mod.rs: Add SAFETY to slice_from_raw_parts(), slice_from_raw_parts_mut() slice_from_raw_parts_mut: Add documentation example safety-ptr-unique.rs: Add SAFETY to new() and cast() safety-ptr-non_null.rs: Add SAFETY to new() safety-ptr-non_null.rs: Add SAFETY to cast() safety-ptr-non_null.rs: Add SAFETY to from() impls safety-ptr-unique.rs: Add SAFETY to from() impls safety-ptr-non_null.rs: Add SAFETY to new() safety-ptr-unique.rs: Add SAFETY to new() safety-ptr-mod.rs: Fix safety explanation https://github.com/rust-lang/rust/pull/71507#discussion_r414488884 safety-prt-non_null.rs: Fix SAFETY comment syntax safety-ptr-unique.rs: Fix syntax for empty() safety-ptr-non_null.rs: Fix misuse of non-null for align_of() safety-ptr-non_null.rs: Remove incorrect SAFETY comment safety-ptr-unique.rs: Remove unsound SAFETY comment safety-ptr-mod.rs: Add std comment on slice_from_raw_parts guarantee safety-ptr-unique.rs: Remove incorrect safety comment Creating a Unique from a NonNull has strict guarantees that the current implementation does not guarantee https://github.com/rust-lang/rust/pull/71507#discussion_r415035952 safety-ptr: Re-adding ignore-tidy directive
2020-04-29also test reference into static fieldRalf Jung-15/+40
2020-04-29Rename function to `suggest_deref_ref_or_into` because it's suggestingDonough Liu-3/+3
derefence instructions
2020-04-29Move branch point upwards to avoid unnecessary mk_ptr()Donough Liu-1/+1
2020-04-29Auto merge of #71518 - felix91gr:const_prop_bugfix_just_block_prop, ↵bors-41/+818
r=wesleywiser Const-prop bugfix: only add propagation inside own block for user variables A testing spinoff of #71298. This one only adds the const-prop for locals that are user variables.
2020-04-28Suggest `;` or assignment to drop borrows in tail exprsEsteban Küber-36/+117
Address the diagnostics part of #70844. ``` error[E0597]: `counter` does not live long enough --> $DIR/issue-54556-niconii.rs:22:20 | LL | if let Ok(_) = counter.lock() { } | ^^^^^^^------- | | | borrowed value does not live long enough | a temporary with access to the borrow is created here ... ... LL | } | - | | | `counter` dropped here while still borrowed | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::result::Result<MutexGuard<'_>, ()>` | help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped | LL | if let Ok(_) = counter.lock() { }; | ^ ```
2020-04-29Add #24949 assoc constant static recursion testDaniel Worrall-0/+179
2020-04-29Fix testAmanieu d'Antras-41/+42
2020-04-29Remove Session::no_landing_pads()Amanieu d'Antras-15/+14
2020-04-29Remove -Z no-landing-pads testsAmanieu d'Antras-54/+0
2020-04-29Remove -Z no-landing-pads flagAmanieu d'Antras-7/+4
2020-04-28Bless test that no longer warnsDylan MacKenzie-1/+1
2020-04-28Auto merge of #71486 - alexcrichton:arm64-lld, r=Mark-Simulacrumbors-6/+32
Enable "full tools" option on ARM dist builders This commit switches the `--enable-extended` option on the arm-related dist builders to `--enable-full-tools`. This alias in `config.py` corresponds to enabling a few more options: * `rust.lld = true` - this is the main purpose of this PR, to enable LLD on ARM-related platforms. This means it will effectively unlock compilation of wasm programs from an arm host. * `rust.llvm-tools = true` - it turns out that this option is largely ignored in rustbuild today. This is only read in one location to set some flags for the `llvm-tools` package, but the `llvm-tools` package is already produced on all of these builders. It's predicted that this will have no effect on build times. * `rust.codegen-backends = ['llvm']` - historically this also enabled the emscripten backend, but that has long since been removed. This brings the ARM dist builders in line with the x86_64 dist builders using this flag. The hope is that the extra time spent on CI building LLD will acceptable because it's cached by `sccache`, LLD is a relatively small C++ project, and the dist builders are all clocking well under 3 hours (the slowest of all builders) around 2 hours. There's likely some possible cleanup that can happen with these configure options since it doesn't look like they've aged too too well, but I'm hopeful that possible refactorings, if necessary, could be deferred to future PRs.
2020-04-28TYPE -> TYPE_ASCRIPTIONGDylan MacKenzie-8/+8
2020-04-28Use path to refer to constants in cross-crate pattern testsDylan MacKenzie-10/+9
2020-04-28Add cross-crate const in pattern testsDylan MacKenzie-0/+55
2020-04-28Add branchy `const` in pattern testsDylan MacKenzie-0/+129
2020-04-28FIXME: ignore test that ICEsDylan MacKenzie-0/+4
2020-04-28Add tests from #67088 and the issues mentioned in its descriptionDylan MacKenzie-16/+468
2020-04-28Incorporate MIR const-checker into `Pat` loweringDylan MacKenzie-63/+89
2020-04-28Add `CustomEq` qualifDylan MacKenzie-1/+64
2020-04-28clarify commentRalf Jung-1/+3
2020-04-28add test for const-ref-to-cross-crate-mutable-staticRalf Jung-14/+101
2020-04-28better document const-pattern dynamic soundness checks, and fix a soundness holeRalf Jung-9/+24
2020-04-28Vec IntoIter: Drop using raw sliceUlrik Sverdrup-2/+8
Update Vec drop with a comment to explain why we want to use a raw slice, and extend this pattern to also include the Vec's IntoIter.
2020-04-28Pass `Substs` to `in_adt_inherently`Dylan MacKenzie-6/+10
2020-04-28Auto merge of #71642 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 11 commits in 8751eb3010d4cdb5329b5a6bd2b6d765c95b0dca..90931d9b31e8b854522fed00916504a3ac6d8619 2020-04-21 18:04:35 +0000 to 2020-04-28 01:56:59 +0000 - Use associated constants directly on primitive types instead of modules (rust-lang/cargo#8077) - Clear `RUSTDOCFLAGS` before running tests (rust-lang/cargo#8168) - Fix warning for `resolve` mismatch in workspace. (rust-lang/cargo#8169) - Fix flaky linking_interrupted test. (rust-lang/cargo#8162) - Fixed some unnecessary borrows and clones. (rust-lang/cargo#8146) - Added warning when using restricted names in Windows. (rust-lang/cargo#8136) - Add changelog about dylib uplift. (rust-lang/cargo#8161) - Mention that cargo_metadata can parse json messages (rust-lang/cargo#8158) - Re-enable rustc-info-cache test again (rust-lang/cargo#8155) - Updates to path source walking. (rust-lang/cargo#8095) - Bump to 0.46.0, update changelog (rust-lang/cargo#8153)