about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-06-11Rollup merge of #73155 - marmeladema:save-analysis-various-fixes, r=XanewokDylan DPC-77/+142
save_analysis: better handle paths and functions signature This should improve slightly some possible regressions due to hir rework. r? @Xanewok
2020-06-11Rollup merge of #73080 - ertos-rs:sean.wilson/devel/external_doc-ref-fix, ↵Dylan DPC-1/+1
r=ollie27 doc/rustdoc: Fix incorrect external_doc feature flag
2020-06-11Rollup merge of #72976 - GuillaumeGomez:cleanup-e0642, r=Dylan-DPCDylan DPC-1/+1
Clean up E0642 explanation r? @Dylan-DPC
2020-06-11Rollup merge of #72941 - nagisa:ensure-stack-for-match, r=oli-obkDylan DPC-23/+5233
Ensure stack when building MIR for matches In particular matching on complex types such as strings will cause deep recursion to happen. Fixes #72933 r? @matthewjasper @oli-obk
2020-06-11Rollup merge of #72380 - lcnr:const_context, r=estebankDylan DPC-245/+228
Fix `is_const_context`, update `check_for_cast` A better version of #71477 Adds `fn enclosing_body_owner` and uses it in `is_const_context`. `is_const_context` now uses the same mechanism as `mir_const_qualif` as it was previously incorrect. Renames `is_const_context` to `is_inside_const_context`. I also updated `check_for_cast` in the second commit, so r? @estebank (I removed one lvl of indentation, so it might be easier to review by hiding whitespace changes)
2020-06-11Auto merge of #71896 - spastorino:existential-assoc-types-variance, ↵bors-5/+52
r=nikomatsakis Relate existential associated types with variance Invariant Fixes #71550 #72315 r? @nikomatsakis The test case reported in that issue now errors with the following message ... ``` error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in function call due to conflicting requirements --> /tmp/test.rs:25:5 | 25 | bad(&Bar(PhantomData), x) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 24:11... --> /tmp/test.rs:24:11 | 24 | fn extend<'a, T>(x: &'a T) -> &'static T { | ^^ note: ...so that reference does not outlive borrowed content --> /tmp/test.rs:25:28 | 25 | bad(&Bar(PhantomData), x) | ^ = note: but, the lifetime must be valid for the static lifetime... note: ...so that the types are compatible --> /tmp/test.rs:25:9 | 25 | bad(&Bar(PhantomData), x) | ^^^^^^^^^^^^^^^^^ = note: expected `&'static T` found `&T` error: aborting due to previous error For more information about this error, try `rustc --explain E0495`. ``` I could also add that test case if we want to have a weaponized one too.
2020-06-11Auto merge of #73198 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 15 commits in 40ebd52206e25c7a576ee42c137cc06a745a167a..1ec223effbbbf9fddd3453cdcae3a96a967608eb 2020-06-01 22:35:00 +0000 to 2020-06-09 20:03:14 +0000 - Default values for `readme` if not specified (rust-lang/cargo#8277) - Fix tree completions. (rust-lang/cargo#8342) - Support `{prefix}` and `{lowerprefix}` markers in `config.json` `dl` key (rust-lang/cargo#8267) - Add environment variables to identify the binary and crate name (rust-lang/cargo#8270) - Bump to 0.47.0, update changelog (rust-lang/cargo#8336) - Nits: Remove unneeded mut and loop (rust-lang/cargo#8334) - 1.45 beta backports (rust-lang/cargo#8331) - Better error message when passing in relative path to Workspace::new (rust-lang/cargo#8321) - Don't hash executable filenames on apple platforms. (rust-lang/cargo#8329) - fix clippy warnings (rust-lang/cargo#8324) - Require latest libgit2 to pull in bugfixes (rust-lang/cargo#8320) - Fix an accidental raw access of field (rust-lang/cargo#8319) - Use mem::take to replace with Default values (rust-lang/cargo#8314) - Allow Windows dylibs without dll suffix. (rust-lang/cargo#8310) - Show alias in help message (rust-lang/cargo#8307)
2020-06-10Auto merge of #73206 - Dylan-DPC:rollup-rha9g8q, r=Dylan-DPCbors-313/+328
Rollup of 9 pull requests Successful merges: - #72706 (Add windows group to triagebot) - #72789 (resolve: Do not suggest imports from the same module in which we are resolving) - #72890 (improper ctypes: normalize return types and transparent structs) - #72897 (normalize adt fields during structural match checking) - #73005 (Don't create impl candidates when obligation contains errors) - #73023 (Remove noisy suggestion of hash_map ) - #73070 (Add regression test for const generic ICE in #72819) - #73157 (Don't lose empty `where` clause when pretty-printing) - #73184 (Reoder order in which MinGW libs are linked to fix recent breakage) Failed merges: r? @ghost
2020-06-10Fix emcc failure for wasm32.Eric Huss-0/+3
2020-06-10Rollup merge of #73184 - mati865:fix-mingw-libs-order, r=petrochenkovDylan DPC-1/+1
Reoder order in which MinGW libs are linked to fix recent breakage Recent upstream mingw-w64 changes made libmsvcrt depend on libmingwex breaking compilation in some cases when using **external** MinGW. Applying this change to the master fixes nightly and stage{1,2} build. For stage0 one has to export `RUSTFLAGS_BOOTSTRAP='-C link-arg=-lmsvcrt'` until this PR lands in bootstrap compiler. Therefore I'm humbly asking to also backport it to the beta and update bootstrap compiler.
2020-06-10Rollup merge of #73157 - Aaron1011:where-oh-where-has-my-little-span-gone, ↵Dylan DPC-7/+68
r=ecstatic-morse Don't lose empty `where` clause when pretty-printing Previously, we would parse `struct Foo where;` and `struct Foo;` identically, leading to an 'empty' `where` clause being omitted during pretty printing. This will cause us to lose spans when proc-macros involved, since we will have a collected `where` token that does not appear in the pretty-printed item. We now explicitly track the presence of a `where` token during parsing, so that we can distinguish between `struct Foo where;` and `struct Foo;` during pretty-printing
2020-06-10Rollup merge of #73070 - ayazhafiz:i/72819, r=nikomatsakisDylan DPC-0/+30
Add regression test for const generic ICE in #72819 Closes #72819
2020-06-10Rollup merge of #73023 - ayushmishra2005:remove_noisy_suggestion, r=davidtwcoDylan DPC-70/+28
Remove noisy suggestion of hash_map Remove noisy suggestion of hash_map #72642 fixes #72642
2020-06-10Rollup merge of #73005 - Aaron1011:fix/error-overflow, r=estebankDylan DPC-181/+55
Don't create impl candidates when obligation contains errors Fixes #72839 In PR #72621, trait selection was modified to no longer bail out early when an error type was encountered. This allowed us treat `ty::Error` as `Sized`, causing us to avoid emitting a spurious "not sized" error after a type error had already occured. However, this means that we may now try to match an impl candidate against the error type. Since the error type will unify with almost anything, this can cause us to infinitely recurse (eventually triggering an overflow) when trying to verify certain `where` clauses. This commit causes us to skip generating any impl candidates when an error type is involved.
2020-06-10Rollup merge of #72897 - lcnr:structurally-match-normalize, r=pnkfelixDylan DPC-1/+27
normalize adt fields during structural match checking fixes #72896 currently only fixes the issue itself and compiles stage 1 libs. I believe we have to use something else to normalize the adt fields here, as I expect some partially resolved adts to cause problems :thinking: stage 1 libs and the test itself pass, not sure about the rest... Will spend some more time looking into it tomorrow. r? @pnkfelix cc @eddyb
2020-06-10Rollup merge of #72890 - ↵Dylan DPC-40/+105
davidtwco:issue-66202-normalize-and-transparent-improper-ctypes, r=varkor improper ctypes: normalize return types and transparent structs Fixes #66202. See each commit individually (except the first which adds a test) for more detailed explanations on the changes made. In summary, this PR ensures that return types are normalized before being checked for FFI-safety, and that transparent newtype wrappers are FFI-safe if the type being wrapped is FFI-safe (often true previously, but not if, after substitution, all types in a transparent newtype were zero sized).
2020-06-10Rollup merge of #72789 - petrochenkov:impcand, r=davidtwcoDylan DPC-13/+14
resolve: Do not suggest imports from the same module in which we are resolving Based on the idea from https://github.com/rust-lang/rust/pull/72623.
2020-06-09Update cargoEric Huss-0/+0
2020-06-10Auto merge of #73190 - Dylan-DPC:rollup-9wbyh4y, r=Dylan-DPCbors-168/+171
Rollup of 8 pull requests Successful merges: - #72417 (Remove `RawVec::reserve_in_place`.) - #73098 (Add Item::is_fake for rustdoc) - #73122 (Resolve E0584 conflict) - #73123 (Clean up E0647 explanation) - #73133 (Enforce unwind invariants) - #73148 (Fix a typo (size of the size)) - #73149 (typo: awailable -> available) - #73161 (Add mailmap entry) Failed merges: r? @ghost
2020-06-10Rollup merge of #73149 - cuviper:awailable, r=steveklabnikDylan DPC-2/+2
typo: awailable -> available
2020-06-10Rollup merge of #73148 - DarkEld3r:patch-1, r=jonas-schievinkDylan DPC-2/+2
Fix a typo (size of the size)
2020-06-10Rollup merge of #73133 - doctorn:unwind-mir-validation, r=jonas-schievinkDylan DPC-19/+48
Enforce unwind invariants I had a quick look at #72959. The failure message probably needs to be more detailed but I just wanted to check I got the right idea. I have no idea how to right a test for this either... r? @jonas-schievink Resolves #72959 (hypothetically)
2020-06-10Rollup merge of #73123 - GuillaumeGomez:cleanup-e0647, r=Dylan-DPCDylan DPC-1/+2
Clean up E0647 explanation r? @Dylan-DPC
2020-06-10Rollup merge of #73122 - doctorn:issue-73116, r=varkorDylan DPC-4/+30
Resolve E0584 conflict Adds a new error code (`E0761`) to indicate ambiguity in module file names and an accompanying expanded description to resolve a conflict over `E0584`. Resolves #73116
2020-06-10Rollup merge of #73098 - jyn514:rustdoc-is-fake, r=GuillaumeGomezDylan DPC-3/+8
Add Item::is_fake for rustdoc I wasn't aware items _could_ be fake, so I think having a function mentioning it could be helpful. Also, I'd need to make this change for cross-crate intra-doc links anyway, so I figured it's better to make the refactor separate.
2020-06-10Rollup merge of #72417 - nnethercote:rm-RawVec-reserve_in_place, r=AmanieuDylan DPC-137/+79
Remove `RawVec::reserve_in_place`. And some related clean-ups. r? @oli-obk
2020-06-09save_analysis: fix enum reference to point to variant rather than constructormarmeladema-11/+7
Fixes #61302
2020-06-09save_analysis: improve pretty printing of enummarmeladema-5/+14
2020-06-09Reoder order in which MinGW libs are linkedMateusz Mikuła-1/+1
2020-06-09Relate existential associated types with variance InvariantSantiago Pastorino-5/+52
2020-06-09Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippyLzu Tao-914/+3943
2020-06-09lint: transitive FFI-safety for transparent typesDavid Wood-51/+69
This commit ensures that if a `repr(transparent)` newtype's only non-zero-sized field is FFI-safe then the newtype is also FFI-safe. Previously, ZSTs were ignored for the purposes of linting FFI-safety in transparent structs - thus, only the single non-ZST would be checked for FFI-safety. However, if the non-zero-sized field is a generic parameter, and is substituted for a ZST, then the type would be considered FFI-unsafe (as when every field is thought to be zero-sized, the type is considered to be "composed only of `PhantomData`" which is FFI-unsafe). In this commit, for transparent structs, the non-zero-sized field is identified (before any substitutions are applied, necessarily) and then that field's type (now with substitutions) is checked for FFI-safety (where previously it would have been skipped for being zero-sized in this case). To handle the case where the non-zero-sized field is a generic parameter, which is substituted for `()` (a ZST), and is being used as a return type - the `FfiUnsafe` result (previously `FfiPhantom`) is caught and silenced. Signed-off-by: David Wood <david@davidtw.co>
2020-06-09lint: check for unit ret type after normalizationDavid Wood-25/+26
This commit moves the check that skips unit return types to after where the return type has been normalized - therefore ensuring that FFI-safety lints are not emitted for types which normalize to unit. Signed-off-by: David Wood <david@davidtw.co>
2020-06-09Address commentsNathan Corbyn-19/+26
2020-06-09Update commentsNathan Corbyn-2/+2
2020-06-09Auto merge of #72114 - anyska:vtable-rename, r=nikomatsakisbors-268/+279
Rename traits::Vtable to ImplSource. Originally suggested by @eddyb. r? @nikomatsakis
2020-06-09improper_ctypes: add test for #66202David Wood-0/+46
This commit adds a test of the improper ctypes lint, checking that return type are normalized bethat return types are normalized before being checked for FFI-safety, and that transparent newtype wrappers are FFI-safe if the type being wrapped is FFI-safe. Signed-off-by: David Wood <david@davidtw.co>
2020-06-09Auto merge of #73153 - ecstatic-morse:revert-71956, r=tmandrybors-137/+414
Revert #71956 ...since it caused unsoundness in #73137. Also adds a reduced version of #73137 to the test suite. The addition of the `MaybeInitializedLocals` dataflow analysis has not been reverted, but it is no longer used. Presumably there is a more targeted fix, but I'm worried that other bugs may be lurking. I'm not yet sure what the root cause of #73137 is. This will need to get backported to beta. r? @tmandry
2020-06-09Remove noisy suggestion of hash_map #72642Ayush Kumar Mishra-70/+28
Fixed failing test-cases Remove noisy suggestion of hash_map #72642 Fixed failing test-cases
2020-06-08Don't lose empty `where` clause when pretty-printingAaron Hill-7/+68
Previously, we would parse `struct Foo where;` and `struct Foo;` identically, leading to an 'empty' `where` clause being omitted during pretty printing. This will cause us to lose spans when proc-macros involved, since we will have a collected `where` token that does not appear in the pretty-printed item. We now explicitly track the presence of a `where` token during parsing, so that we can distinguish between `struct Foo where;` and `struct Foo;` during pretty-printing
2020-06-08fixup! Add regression test for const generic ICE in #72819Ayaz Hafiz-1/+1
2020-06-08fixup! Add regression test for const generic ICE in #72819Ayaz Hafiz-0/+3
2020-06-08Auto merge of #73147 - Dylan-DPC:rollup-9saqhj5, r=Dylan-DPCbors-44/+87
Rollup of 8 pull requests Successful merges: - #71842 (doc: make impl block collapsible if it has an associated constant) - #72912 (Add new E0758 error code) - #73008 (Update RELEASES.md) - #73090 (Use `LocalDefId` directly in `Resolver::export_map`) - #73118 (Improve the wording in documentation of std::mem::drop) - #73124 (Removed lifetime parameters from Explanation of E0207 ) - #73138 (Use shorthand linker strip arguments in order to support MacOS) - #73143 (Update books) Failed merges: r? @ghost
2020-06-08Add regression test for #73137Dylan MacKenzie-0/+42
Co-authored-by: Aaron1011 <aa1ronham@gmail.com>
2020-06-09save_analysis: better handle functions signaturemarmeladema-35/+48
2020-06-09save_analysis: better handle pathsmarmeladema-27/+74
2020-06-08Revert #71956Dylan MacKenzie-137/+372
2020-06-09Rename some identifiers in `RawVec` and `libarena`.Nicholas Nethercote-79/+62
- Use `len` more consistently for the number of elements in a vector, because that's the usual name. - Use `additional` more consistently for the number of elements we want to add, because that's what `Vec::reserve()` uses. - Use `cap` consistently rather than `capacity`. - Plus a few other tweaks. This increases consistency and conciseness.
2020-06-09Remove `RawVec::reserve_in_place`.Nicholas Nethercote-39/+6
Also remove a now-unnecessary `placement` argument.
2020-06-09Remove the `reserve_in_place` calls in `{Typed,Dropless}Arena::grow`.Nicholas Nethercote-30/+22
They are pointless. No reasonable allocator will be able to satisfy a `reserve_in_place` request that *doubles* the size of an allocation when dealing with allocations that are 4 KiB and larger. Just to be sure, I confirmed on Linux that the `reserve_in_place` calls never succeed. (Note however that the `reserve_in_place` call for `DroplessArena::grow` did occasionally succeed prior to the off-by-one fix in the previous commit, because we would sometimes do a `reserve_in_place` request for the chunk's current size, which would trivially succeed!)