Commit graph

151370 commits

Author SHA1 Message Date
Ralf Jung a5299fb688 add some comments regarding the two major quirks of our memory model 2021-07-16 13:16:09 +02:00
Ralf Jung 7c720ce612 get rid of incorrect erase_for_fmt 2021-07-16 10:09:56 +02:00
Ralf Jung 4e28065618 tweak pointer out-of-bounds error message 2021-07-15 22:47:11 +02:00
Ralf Jung bd874a9d5d make check_ptr_access_align work on function pointer allocations 2021-07-15 19:48:52 +02:00
Ralf Jung adbe7554d7 enable Miri to fix the bytes in an allocation (since ptr offsets have different meanings there) 2021-07-15 18:03:22 +02:00
Ralf Jung f4b61ba509 adjustions and cleanup to make Miri build again 2021-07-15 17:14:11 +02:00
Ralf Jung 8932aebfdf remove unused error variant 2021-07-14 18:17:50 +02:00
Ralf Jung 1f21ab114e bless mir-opt, codegen, and remaining ui tests 2021-07-14 18:17:49 +02:00
Ralf Jung ae950a2dc7 more precise message for the ptr access check on deref 2021-07-14 18:17:49 +02:00
Ralf Jung 4ff353cd6e test dynamic check for ptr-int-casts (unleashed) 2021-07-14 18:17:49 +02:00
Ralf Jung 4759090d15 adjust tests 2021-07-14 18:17:49 +02:00
Ralf Jung 172abb29b1 fix cranelift 2021-07-14 18:17:49 +02:00
Ralf Jung 71c166a0dc use NonZeroU64 for AllocId to restore old type sizes 2021-07-14 18:17:49 +02:00
Ralf Jung 626605cea0 consistently treat None-tagged pointers as ints; get rid of some deprecated Scalar methods 2021-07-14 18:17:49 +02:00
Ralf Jung d4f7dd6702 CTFE/Miri engine Pointer type overhaul: make Scalar-to-Pointer conversion infallible
This resolves all the problems we had around "normalizing" the representation of a Scalar in case it carries a Pointer value: we can just use Pointer if we want to have a value taht we are sure is already normalized.
2021-07-14 18:17:46 +02:00
bors 5aff6dd07a Auto merge of #87019 - nikic:clang-12.0.1, r=Mark-Simulacrum
Use clang 12.0.1 on dist-x86_64/i686-linux

The LLD + ThinLTO __morestack bug has been fixed in 12.0.1, so
we can now update our clang version. This also means that we no
longer need to build Python 2.
2021-07-13 09:40:28 +00:00
bors 394804bb23 Auto merge of #86857 - fee1-dead:add-attr, r=oli-obk
Add #[default_method_body_is_const]

`@rustbot` label F-const_trait_impl
2021-07-13 06:59:34 +00:00
bors 1f0db5e0a3 Auto merge of #86665 - FabianWolff:layout-field-thir-unsafeck, r=oli-obk
Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck

Since nobody has so far claimed Mutation- and BorrowOfLayoutConstrainedField in rust-lang/project-thir-unsafeck#7, I have taken the liberty of implementing them in thir-unsafeck.

r? `@LeSeulArtichaut`
2021-07-13 04:38:39 +00:00
bors 14c0c3e55d Auto merge of #87095 - JohnTitor:rollup-mn7ggy2, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #86344 (Split MaybeUninit::write into new feature gate and stabilize it)
 - #86811 (Remove unstable `io::Cursor::remaining`)
 - #86846 (stdio_locked: add tracking issue)
 - #86887 (rustdoc: remove dead code in `clean`)
 - #87007 (Fix rust-analyzer install when not available.)
 - #87035 (Fix implementors display)
 - #87065 (Fix ICE with unsized type in const pattern)
 - #87070 (Simplify future incompatible reporting.)
 - #87077 (⬆️ rust-analyzer)
 - #87078 (Rustdoc: suggest removing disambiguator if linking to field)
 - #87089 (CTFE engine: small cleanups)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-13 01:52:49 +00:00
Yuki Okushi e46b790b9d
Rollup merge of #87089 - RalfJung:ctfe-memory-cleanup, r=oli-obk
CTFE engine: small cleanups

I noticed these while preparing a large PR, and figured I'd better send them ahead to not muddy the diff unnecessarily.

- remove remaining use of Pointer in Allocation API (I missed those in https://github.com/rust-lang/rust/pull/85472)
- remove unnecessary deallocate_local hack (this logic does not seem necessary any more)

r? `@oli-obk`
2021-07-13 08:54:39 +09:00
Yuki Okushi 15af98d070
Rollup merge of #87078 - fee1-dead:rustdoc, r=jyn514
Rustdoc: suggest removing disambiguator if linking to field

This fixes #85615.

`@rustbot` label T-rustdoc
2021-07-13 08:54:38 +09:00
Yuki Okushi 4eba19a813
Rollup merge of #87077 - lnicola:rust-analyzer-2021-07-12, r=lnicola
⬆️ rust-analyzer

`@bors` r+
2021-07-13 08:54:37 +09:00
Yuki Okushi 8d4293c1d4
Rollup merge of #87070 - ehuss:simplify-future-report, r=oli-obk
Simplify future incompatible reporting.

This simplifies the implementation of the future incompatible reporting system. Instead of having a separate field in the future_incompatible definition, this reuses the `FutureIncompatibilityReason` enum. It also drops the "date" field. Cargo does not use the date field, and there isn't much of a need for this to be structured, and I am skeptical that the date can be predicted reliably. The date or release version can be listed in the lint text if desired.
2021-07-13 08:54:36 +09:00
Yuki Okushi 47a418420e
Rollup merge of #87065 - FabianWolff:issue-87046, r=oli-obk
Fix ICE with unsized type in const pattern

Fixes #87046. The `deref_const()` query currently contains the following check:
e9a387d6cf/compiler/rustc_mir/src/const_eval/mod.rs (L191-L204)

i.e. this will cause an ICE for every unsized type except slices. An error is reported with my changes if such a type is used as a const pattern (this should not be a breaking change, since so far, this has caused an ICE).
2021-07-13 08:54:34 +09:00
Yuki Okushi fab45bf485
Rollup merge of #87035 - GuillaumeGomez:fix-implementors-display, r=notriddle
Fix implementors display

Part of https://github.com/rust-lang/rust/issues/86632.

This PR does a few things:
 * It fixes of the JS rendered implementors.
 * It generates anchors for JS rendered implementors to make it coherent with the others.
 * It adds a test to ensure that we won't have the same issue again.
 * It changes the way we render the rustdoc-gui crates to simplify it a bit and also to allow to have dependencies without going through compiletest.

Before:

![Screenshot from 2021-07-10 13-30-13](https://user-images.githubusercontent.com/3050060/125174172-b4048700-e1c3-11eb-8f0e-c46081371d4f.png)

After:

![Screenshot from 2021-07-10 21-11-15](https://user-images.githubusercontent.com/3050060/125174173-b49d1d80-e1c3-11eb-8740-1dbbff70c2eb.png)

I plan to add the `[src]` links in another PR because this one is already big enough.

cc `@Mark-Simulacrum` (for the bootstrap changes)

r? `@Nemo157`
2021-07-13 08:54:33 +09:00
Yuki Okushi 2d9a0387c1
Rollup merge of #87007 - ehuss:fix-rust-analyzer-install, r=Mark-Simulacrum
Fix rust-analyzer install when not available.

This changes it so that `x.py install` won't fail if rust-analyzer isn't available. This was changed in #86568 to handle the case where installing on stable/beta, and `extended=true`, to skip rust-analyzer. But I neglected to update the install part to also ignore it.

Fixes #86999
2021-07-13 08:54:32 +09:00
Yuki Okushi a49927350f
Rollup merge of #86887 - jyn514:cleanup-clean, r=CraftSpider
rustdoc: remove dead code in `clean`

Builds on https://github.com/rust-lang/rust/pull/86886 and should not be merged before.
2021-07-13 08:54:31 +09:00
Yuki Okushi bcacfe7c64
Rollup merge of #86846 - tlyu:stdio-locked-tracking, r=joshtriplett
stdio_locked: add tracking issue

Add the tracking issue number #86845 to the stability attributes for the implementation in #86799.

r? `@joshtriplett`
`@rustbot` label +A-io +C-cleanup +T-libs-api
2021-07-13 08:54:30 +09:00
Yuki Okushi 749a589746
Rollup merge of #86811 - soerenmeier:remove_remaining, r=yaahc
Remove unstable `io::Cursor::remaining`

Adding `io::Cursor::remaining` in #86037 caused a conflict with the implementation of `bytes::Buf` for `io::Cursor`, leading to an error in nightly, see https://github.com/rust-lang/rust/issues/86369#issuecomment-867723485.

This fixes the error by temporarily removing the `remaining` function.

r? `@yaahc`
2021-07-13 08:54:28 +09:00
Yuki Okushi b507cd1745
Rollup merge of #86344 - est31:maybe-uninit-extra, r=RalfJung
Split MaybeUninit::write into new feature gate and stabilize it

This splits off the `MaybeUninit::write` function from the `maybe_uninit_extra` feature gate into a new `maybe_uninit_write` feature gate and stabilizes it.

Earlier work to improve the documentation of the write function: #86220

Tracking issue: #63567
2021-07-13 08:54:27 +09:00
bors aa06edb4d5 Auto merge of #87018 - nikic:llvm-12.0.1, r=Mark-Simulacrum
Update to LLVM 12.0.1

LLVM 12.0.1 has been released, rebase our fork on top of it.
2021-07-12 23:24:25 +00:00
bors 955b9c0d4c Auto merge of #86320 - hi-rustin:rustin-patch-fix-span, r=estebank
shrinking the deprecated span

ref: https://github.com/rust-lang/rust/pull/85617#issuecomment-854947988

part of #85403

r? `@estebank`

The reason is that if we use method_span directly, it will cause the in_derive_expansion judgment to fail.
2021-07-12 20:43:28 +00:00
Eric Huss 166c147c27 Provide a better error when x.py install src/doc doesn't work. 2021-07-12 13:29:47 -07:00
est31 848a621591 Use the write function in some more places 2021-07-12 20:32:23 +02:00
Ralf Jung 6b26640583 remove unnecessary deallocate_local hack 2021-07-12 20:09:42 +02:00
Guillaume Gomez bd819493d7 Add test for implementors 2021-07-12 19:03:59 +02:00
Guillaume Gomez da6d82e465 Simplify build system for rustdoc-gui test crates 2021-07-12 19:03:59 +02:00
bors b5a2ccee81 Auto merge of #87087 - fee1-dead:fix-try-2, r=joshtriplett
Remove `multiple-definitions` test

r? `@joshtriplett`

Temporary solution to #87084.
2021-07-12 16:55:44 +00:00
Ralf Jung c8baac5776 remove remaining use of Pointer in Allocation API 2021-07-12 18:45:26 +02:00
Deadbeef 4adcd600b8
Remove multiple-definitions test 2021-07-13 00:14:28 +08:00
bors 3a24abd22f Auto merge of #86841 - GuillaumeGomez:reexported-macro-2-render, r=Stupremee
Fix rendering of reexported macros 2.0 and fix visibility of reexported items

So, this PR grew a bit out of focus, it does the following things:

* Fixes #86276.
* Fixes visibility display for reexported items: it now takes the visibility of the "use" statement rather than the visibility of the reexported item itself).
* Fixes the display of reexported items if "--document-private-items" option is used. Before, they were simply skipped.
* Fixes inconsistency on typedef items: they didn't display their visibility contrary to other items.

I added tests to check everything listed above.

cc `@camelid` `@ollie27` (in case one of you want to review?)

r? `@jyn514`
2021-07-12 11:52:55 +00:00
Deadbeef 3dab2d210f
suggest removing disambiguator if linking to field 2021-07-12 19:48:07 +08:00
Laurențiu Nicola 5712148e83 ⬆️ rust-analyzer 2021-07-12 09:54:59 +03:00
Nikita Popov abb1e64f51 Update to LLVM 12.0.1 2021-07-12 08:53:53 +02:00
bors e97c29bda2 Auto merge of #86815 - FabianWolff:issue-84210, r=varkor
Improve error reporting for modifications behind `&` references

I had a look at #84210 and noticed that #85823 has effectively already fixed #84210.

However, the string matching in #85823 is _very_ crude and already breaks down when a variable name starts with `mut`. I have made this a bit more robust; further improvements could definitely be made but are complicated by the lack of information provided by an earlier pass:
ce331ee6ee/compiler/rustc_mir_build/src/build/matches/mod.rs (L2103-L2107)

I have also fixed a missing comma in the error message.
2021-07-12 01:00:43 +00:00
bors 54aaca8623 Auto merge of #86249 - FabianWolff:issue-86238, r=varkor
Report an error if resolution of closure call functions failed

This pull request fixes #86238. The current implementation seems to assume that resolution of closure call functions (I'm not sure what the proper term is; I mean `call` of `Fn` etc.) can never fail:
60f1a2fc4b/compiler/rustc_typeck/src/check/callee.rs (L590-L595)

But actually, it can, if the `fn`/`fn_mut`/`fn_once` lang items are not defined, or don't have an associated `call`/`call_mut`/`call_once` function, leading to the ICE described in #86238. I have therefore turned the `span_bug!()` into an error message, which prevents the ICE.
2021-07-11 22:39:16 +00:00
Eric Huss 4d1daf8683 Simplify future incompatible reporting. 2021-07-11 13:08:58 -07:00
bors 7a16cfcffc Auto merge of #87068 - JohnTitor:rollup-2xuisfx, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #73936 (Rustdoc: Change all 'optflag' arguments to 'optflagmulti')
 - #86926 (Update regex crates)
 - #86951 ([docs] Clarify behaviour of f64 and f32::sqrt when argument is negative zero)
 - #87031 (Update reference.md)
 - #87037 (cleanup(rustdoc): remove unused function getObjectNameById)
 - #87045 (Fix tracking issue for `bool_to_option`)
 - #87049 (Account for `submodules = false` in config.toml when updating LLVM submodule)
 - #87061 (Do not suggest adding a semicolon after `?`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-11 19:34:04 +00:00
Yuki Okushi 5fcefb1d61
Rollup merge of #87061 - FabianWolff:issue-87051, r=oli-obk
Do not suggest adding a semicolon after `?`

Fixes #87051. I have only modified `report_return_mismatched_types()`, i.e. my changes only affect suggestions to add `;` for return type mismatches, but this never makes sense after `?`, because the function cannot return `()` if `?` is used (it has to return a `Result` or an `Option`), and a semicolon won't help if the expected and actual `Err` types differ, even if the expected one is `()`.
2021-07-12 04:32:05 +09:00
Yuki Okushi f3d5fde070
Rollup merge of #87049 - jyn514:no-submodules, r=Mark-Simulacrum
Account for `submodules = false` in config.toml when updating LLVM submodule

Fixes https://github.com/rust-lang/rust/issues/86954.

r? ``@Mark-Simulacrum`` cc ``@durin42``
2021-07-12 04:32:04 +09:00