]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agotidy
mark [Fri, 24 Apr 2020 19:48:10 +0000 (14:48 -0500)]
tidy

4 years agofix a couple more uses of def_kind
mark [Fri, 24 Apr 2020 19:26:11 +0000 (14:26 -0500)]
fix a couple more uses of def_kind

4 years agoRemove redundant `descr`/`descriptive_variant` methods from HIR.
Eduard-Mihai Burtescu [Fri, 17 Apr 2020 20:00:12 +0000 (23:00 +0300)]
Remove redundant `descr`/`descriptive_variant` methods from HIR.

4 years agoTweak `descr` for `AnonConst` and fix `article` for `Use` and `ExternCrate`.
Eduard-Mihai Burtescu [Fri, 17 Apr 2020 20:00:00 +0000 (23:00 +0300)]
Tweak `descr` for `AnonConst` and fix `article` for `Use` and `ExternCrate`.

4 years agoRemove `Option` from the return type of `def_kind`.
Eduard-Mihai Burtescu [Fri, 17 Apr 2020 18:55:17 +0000 (21:55 +0300)]
Remove `Option` from the return type of `def_kind`.

4 years agoSplit out the `Generator` case from `DefKind::Closure`.
Eduard-Mihai Burtescu [Fri, 17 Apr 2020 13:55:08 +0000 (16:55 +0300)]
Split out the `Generator` case from `DefKind::Closure`.

4 years agoadd a few more DefKinds
mark [Mon, 16 Mar 2020 15:01:03 +0000 (10:01 -0500)]
add a few more DefKinds

make Map::def_kind take LocalDefId

Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
crates are DefKind::Mod

4 years agoAuto merge of #71509 - Dylan-DPC:rollup-n8s37rm, r=Dylan-DPC
bors [Fri, 24 Apr 2020 12:28:44 +0000 (12:28 +0000)]
Auto merge of #71509 - Dylan-DPC:rollup-n8s37rm, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71235 (Tweak `'static` suggestion code)
 - #71318 (miri-unleash tests: ensure they fire even with 'allow(const_err)')
 - #71428 (Let compiletest recognize gdb 10.x)
 - #71475 (Miri Frame: use mir::Location to represent position in function)
 - #71476 (more compact way to adjust test sizes for Miri)

Failed merges:

r? @ghost

4 years agoRollup merge of #71476 - RalfJung:miri-test-sizes, r=kennytm
Dylan DPC [Fri, 24 Apr 2020 11:14:26 +0000 (13:14 +0200)]
Rollup merge of #71476 - RalfJung:miri-test-sizes, r=kennytm

more compact way to adjust test sizes for Miri

Inspired by @dtolnay

4 years agoRollup merge of #71475 - RalfJung:miri-frame-loc, r=ecstatic-morse
Dylan DPC [Fri, 24 Apr 2020 11:14:24 +0000 (13:14 +0200)]
Rollup merge of #71475 - RalfJung:miri-frame-loc, r=ecstatic-morse

Miri Frame: use mir::Location to represent position in function

I only recently learned that `Location` exists, and it seems to perfectly fit what Miri needs to represent which statement we are currently executing. :)

r? @ecstatic-morse

4 years agoRollup merge of #71428 - tromey:gdb-10-parsing, r=tromey
Dylan DPC [Fri, 24 Apr 2020 11:14:22 +0000 (13:14 +0200)]
Rollup merge of #71428 - tromey:gdb-10-parsing, r=tromey

Let compiletest recognize gdb 10.x

git gdb has moved to version 10.  My build prints this as its
--version:

    GNU gdb (GDB) 10.0.50.20200420-git

Unfortunately this conflicts with this comment in compiletest:

    // We limit major to 1 digit, otherwise, on openSUSE, we parse the openSUSE version

This patch changes the version parsing to follow the GNU coding
standard, which accounts for both the openSUSE case as well as
handling gdb 10.

My debuginfo test run now says:

NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 10000050

... where previously it failed to find that gdb 10 had rust support.

4 years agoRollup merge of #71318 - RalfJung:miri-unleash-cleanup, r=oli-obk
Dylan DPC [Fri, 24 Apr 2020 11:14:20 +0000 (13:14 +0200)]
Rollup merge of #71318 - RalfJung:miri-unleash-cleanup, r=oli-obk

miri-unleash tests: ensure they fire even with 'allow(const_err)'

This is easier with `static` than `const` so I switched some of them over.

4 years agoRollup merge of #71235 - estebank:lt-sugg-2, r=ecstatic-morse
Dylan DPC [Fri, 24 Apr 2020 11:14:19 +0000 (13:14 +0200)]
Rollup merge of #71235 - estebank:lt-sugg-2, r=ecstatic-morse

Tweak `'static` suggestion code

Fix #71196.

4 years agoAuto merge of #70820 - spastorino:replace-fragile-erroneous-const-sys, r=oli-obk
bors [Fri, 24 Apr 2020 09:14:47 +0000 (09:14 +0000)]
Auto merge of #70820 - spastorino:replace-fragile-erroneous-const-sys, r=oli-obk

Replace fragile erroneous const sys

Closes #67191

r? @oli-obk

4 years agoAuto merge of #71215 - marmeladema:issue70853/librustc_middle-local-def-id-2, r=eddyb
bors [Fri, 24 Apr 2020 04:14:20 +0000 (04:14 +0000)]
Auto merge of #71215 - marmeladema:issue70853/librustc_middle-local-def-id-2, r=eddyb

Simplify `local_def_id` and `as_local_hir_id`

See #70853

4 years agoAuto merge of #71496 - Dylan-DPC:rollup-gwxejmk, r=Dylan-DPC
bors [Fri, 24 Apr 2020 00:49:05 +0000 (00:49 +0000)]
Auto merge of #71496 - Dylan-DPC:rollup-gwxejmk, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #70845 (Make the `structural_match` error diagnostic for const generics clearer)
 - #71063 (Document unsafety in core::{option, hash})
 - #71068 (Stabilize UNICODE_VERSION (feature unicode_version))
 - #71426 (fix error code in E0751.md)
 - #71459 (Add leading 0x to offset in Debug fmt of Pointer)
 - #71492 (Document unsafety in core::{panicking, alloc::layout, hint, iter::adapters::zip})

Failed merges:

r? @ghost

4 years agoRollup merge of #71492 - LeSeulArtichaut:document-unsafe-2, r=Mark-Simulacrum
Dylan DPC [Fri, 24 Apr 2020 00:47:38 +0000 (02:47 +0200)]
Rollup merge of #71492 - LeSeulArtichaut:document-unsafe-2, r=Mark-Simulacrum

Document unsafety in core::{panicking, alloc::layout, hint, iter::adapters::zip}

Helps with #66219.
r? @Mark-Simulacrum do you want to continue reading safety comments? :D

4 years agoRollup merge of #71459 - divergentdave:pointer-offset-0x, r=RalfJung
Dylan DPC [Fri, 24 Apr 2020 00:47:37 +0000 (02:47 +0200)]
Rollup merge of #71459 - divergentdave:pointer-offset-0x, r=RalfJung

Add leading 0x to offset in Debug fmt of Pointer

Currently the `Debug` format for `Pointer` prints its offset in hexadecimal, for example, `alloc38657819+e2` or `alloc35122748+64`. This PR adds a leading `0x` to the offset, in order to make it apparent that it is indeed a hexadecimal number. This came up during discussion of rust-lang/miri#1354. r? @RalfJung

4 years agoRollup merge of #71426 - contrun:fix-e0751-explanation, r=estebank
Dylan DPC [Fri, 24 Apr 2020 00:47:35 +0000 (02:47 +0200)]
Rollup merge of #71426 - contrun:fix-e0751-explanation, r=estebank

fix error code in E0751.md

reference: https://github.com/rust-lang/rust/issues/71304

4 years agoRollup merge of #71068 - pyfisch:unicode-version-stable, r=SimonSapin
Dylan DPC [Fri, 24 Apr 2020 00:47:32 +0000 (02:47 +0200)]
Rollup merge of #71068 - pyfisch:unicode-version-stable, r=SimonSapin

Stabilize UNICODE_VERSION (feature unicode_version)

Tracking issue: #49726

r? @sfackler

#71020 changed the definition of `UNICODE_VERSION` just yesterday from a struct to a tuple. Maybe you want to wait some more before stabilizing this constant, on the other hand this is a very small and simple addition.

CC @behnam @SimonSapin @Serentty

4 years agoRollup merge of #71063 - LeSeulArtichaut:document-unsafe, r=Mark-Simulacrum
Dylan DPC [Fri, 24 Apr 2020 00:47:30 +0000 (02:47 +0200)]
Rollup merge of #71063 - LeSeulArtichaut:document-unsafe, r=Mark-Simulacrum

Document unsafety in core::{option, hash}

Helps with #66219.
I think that the part that will need reviewing the most is the `hash/sip.rs` file.
r? @LukasKalbertodt (or someone else from the libs team)

4 years agoRollup merge of #70845 - varkor:const-generics-derive-eq-diagnostic, r=estebank
Dylan DPC [Fri, 24 Apr 2020 00:47:26 +0000 (02:47 +0200)]
Rollup merge of #70845 - varkor:const-generics-derive-eq-diagnostic, r=estebank

Make the `structural_match` error diagnostic for const generics clearer

The previous diagnostic caused confusion (https://github.com/rust-lang/rust/issues/70790), so this changes the message to be closer to the message for using non-`structural_match` constants in patterns, explicitly mentioning `#[derive(PartialEq, Eq)]`.

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

r? @estebank

4 years agoDocument unsafety in `core::{panicking, alloc::layout, hint, iter::adapters::zip}`
LeSeulArtichaut [Thu, 23 Apr 2020 21:21:53 +0000 (23:21 +0200)]
Document unsafety in `core::{panicking, alloc::layout, hint, iter::adapters::zip}`

4 years agoFix librustdoc error due to `as_local_hir_id` changes
marmeladema [Thu, 23 Apr 2020 22:41:47 +0000 (23:41 +0100)]
Fix librustdoc error due to `as_local_hir_id` changes

4 years agoAddress comments from review
marmeladema [Thu, 23 Apr 2020 19:48:40 +0000 (20:48 +0100)]
Address comments from review

4 years agoModify `as_local_hir_id` to return a bare `HirId`
marmeladema [Thu, 16 Apr 2020 19:36:32 +0000 (20:36 +0100)]
Modify `as_local_hir_id` to return a bare `HirId`

4 years agoModify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`
marmeladema [Sun, 12 Apr 2020 12:45:41 +0000 (13:45 +0100)]
Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`

4 years agolibrustc_middle: return LocalDefId instead of DefId in local_def_id
marmeladema [Thu, 9 Apr 2020 08:43:00 +0000 (09:43 +0100)]
librustc_middle: return LocalDefId instead of DefId in local_def_id

4 years agoImport RequiredConstsVisitor
Santiago Pastorino [Wed, 22 Apr 2020 15:30:11 +0000 (12:30 -0300)]
Import RequiredConstsVisitor

4 years agoRename uneval_consts to required_consts
Santiago Pastorino [Wed, 22 Apr 2020 14:16:06 +0000 (11:16 -0300)]
Rename uneval_consts to required_consts

4 years agoAdjust name of never typed const test
Santiago Pastorino [Wed, 22 Apr 2020 12:23:06 +0000 (09:23 -0300)]
Adjust name of never typed const test

4 years agoBless mir-opt tests
Santiago Pastorino [Fri, 17 Apr 2020 21:31:42 +0000 (18:31 -0300)]
Bless mir-opt tests

4 years agoAdd a note about fat pointers
LeSeulArtichaut [Thu, 23 Apr 2020 21:05:37 +0000 (23:05 +0200)]
Add a note about fat pointers

Co-Authored-By: Mark-Simulacrum <mark.simulacrum@gmail.com>
4 years agoClean up fragile checks of optimized away constants
Santiago Pastorino [Fri, 17 Apr 2020 21:31:21 +0000 (18:31 -0300)]
Clean up fragile checks of optimized away constants

4 years agoMake ConstPropagator only visit basic blocks when visiting body
Santiago Pastorino [Tue, 21 Apr 2020 18:53:00 +0000 (15:53 -0300)]
Make ConstPropagator only visit basic blocks when visiting body

Avoid exercising unevaluated constants and go straight to visit the
blocks.

4 years agoVisit unevaluated constants in super_body
Santiago Pastorino [Mon, 6 Apr 2020 20:49:49 +0000 (17:49 -0300)]
Visit unevaluated constants in super_body

4 years agoMake inlining carry over unevaluated consts
Santiago Pastorino [Sun, 5 Apr 2020 17:09:45 +0000 (14:09 -0300)]
Make inlining carry over unevaluated consts

4 years agoEvaluate unevaluated MIR constants in codegen_mir
Santiago Pastorino [Sun, 5 Apr 2020 13:30:32 +0000 (10:30 -0300)]
Evaluate unevaluated MIR constants in codegen_mir

4 years agoAdd MirPass to collect Unevaluated consts in MIR body
Santiago Pastorino [Fri, 3 Apr 2020 21:26:24 +0000 (18:26 -0300)]
Add MirPass to collect Unevaluated consts in MIR body

4 years agoMake mir::Constant Copy
Santiago Pastorino [Sun, 5 Apr 2020 14:08:39 +0000 (11:08 -0300)]
Make mir::Constant Copy

4 years agoexplain what we are testing in mutable_const
Ralf Jung [Wed, 22 Apr 2020 10:13:52 +0000 (12:13 +0200)]
explain what we are testing in mutable_const

4 years agoAuto merge of #71483 - Dylan-DPC:rollup-c2h9s8b, r=Dylan-DPC
bors [Thu, 23 Apr 2020 18:36:59 +0000 (18:36 +0000)]
Auto merge of #71483 - Dylan-DPC:rollup-c2h9s8b, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #70633 (Confusing suggestion on incorrect closing `}`)
 - #71404 (Don't fuse Chain in its second iterator)
 - #71408 (Check code blocks tags)
 - #71442 (Add a "by reference" adaptor for `AllocRef`)
 - #71446 (Only use read_unaligned in transmute_copy if necessary)
 - #71470 (Fix doc links)
 - #71479 (add back Scalar::null_ptr)

Failed merges:

r? @ghost

4 years agoRollup merge of #71479 - RalfJung:scalar-null-ptr, r=jonas-schievink
Dylan DPC [Thu, 23 Apr 2020 18:35:07 +0000 (20:35 +0200)]
Rollup merge of #71479 - RalfJung:scalar-null-ptr, r=jonas-schievink

add back Scalar::null_ptr

We were a bit overeager with removing this in https://github.com/rust-lang/rust/pull/71005, Miri uses this function quite a bit.

The important part is that the `Place::null` methods are gone. :)
r? @jonas-schievink @oli-obk

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

4 years agoRollup merge of #71470 - TyPR124:fix-doc-links, r=jonas-schievink
Dylan DPC [Thu, 23 Apr 2020 18:35:06 +0000 (20:35 +0200)]
Rollup merge of #71470 - TyPR124:fix-doc-links, r=jonas-schievink

Fix doc links

This fixes a few doc links which were causing `cargo doc` to fail when using `--document-private-items --document-hidden-items` on libstd. Most of the fixes are just escaping '[' and ']' characters in doc comments, and one change actually fixes a doc link.

4 years agoRollup merge of #71446 - Amanieu:transmute_copy, r=sfackler
Dylan DPC [Thu, 23 Apr 2020 18:35:04 +0000 (20:35 +0200)]
Rollup merge of #71446 - Amanieu:transmute_copy, r=sfackler

Only use read_unaligned in transmute_copy if necessary

I've noticed that this causes LLVM to generate poor code on targets that don't support unaligned memory accesses.

4 years agoRollup merge of #71442 - TimDiekmann:allocref-mut-ref, r=Amanieu
Dylan DPC [Thu, 23 Apr 2020 18:35:02 +0000 (20:35 +0200)]
Rollup merge of #71442 - TimDiekmann:allocref-mut-ref, r=Amanieu

Add a "by reference" adaptor for `AllocRef`

Fixes rust-lang/wg-allocators#53

r? @Amanieu

4 years agoRollup merge of #71408 - GuillaumeGomez:check-code-blocks-tags, r=kinnison
Dylan DPC [Thu, 23 Apr 2020 18:35:01 +0000 (20:35 +0200)]
Rollup merge of #71408 - GuillaumeGomez:check-code-blocks-tags, r=kinnison

Check code blocks tags

Fixes #71347.

Explanations here: I realized recently that it was a common issue to confuse/misspell tags on code blocks. This is actually quite a big issue since it generally ends up in a code blocks being ignored since it's not being considered as a rust one. With this new warning, users will at least be notified about it.

PS: some improvements can be done on the error rendering but considering how big the PR already is, I think it's better to do it afterwards.

r? @ollie27

cc @rust-lang/rustdoc

4 years agoRollup merge of #71404 - cuviper:chain-unfused, r=scottmcm
Dylan DPC [Thu, 23 Apr 2020 18:34:59 +0000 (20:34 +0200)]
Rollup merge of #71404 - cuviper:chain-unfused, r=scottmcm

Don't fuse Chain in its second iterator

Only the "first" iterator is actually set `None` when exhausted,
depending on whether you iterate forward or backward. This restores
behavior similar to the former `ChainState`, where it would transition
from `Both` to `Front`/`Back` and only continue from that side.

However, if you mix directions, then this may still set both sides to
`None`, totally fusing the iterator.

Fixes #71375
r? @scottmcm

4 years agoRollup merge of #70633 - kper:master, r=estebank
Dylan DPC [Thu, 23 Apr 2020 18:34:57 +0000 (20:34 +0200)]
Rollup merge of #70633 - kper:master, r=estebank

Confusing suggestion on incorrect closing `}`

Compiler returns
```
error: unexpected closing delimiter: `}`
  --> main.rs:20:1
   |
9  |             ErrorHandled::Reported => {}
   |                                       -- this block is empty, you might have not meant to close it temp
...
20 | }
   | ^ unexpected closing delimiter

error: aborting due to previous error
```

4 years agoadd back Scalar::null_ptr
Ralf Jung [Thu, 23 Apr 2020 18:13:53 +0000 (20:13 +0200)]
add back Scalar::null_ptr

4 years agomiri-unleash tests: ensure they fire even with 'allow(const_err)'
Ralf Jung [Sun, 19 Apr 2020 10:32:21 +0000 (12:32 +0200)]
miri-unleash tests: ensure they fire even with 'allow(const_err)'

4 years agoliballoc: more compact way to adjust test sizes for Miri
Ralf Jung [Thu, 23 Apr 2020 18:05:01 +0000 (20:05 +0200)]
liballoc: more compact way to adjust test sizes for Miri

4 years agolibcore: more compact way to adjust test sizes for Miri
Ralf Jung [Thu, 23 Apr 2020 17:48:35 +0000 (19:48 +0200)]
libcore: more compact way to adjust test sizes for Miri

4 years agoMiri Frame: use mir::Location to represent position in function
Ralf Jung [Thu, 23 Apr 2020 17:40:41 +0000 (19:40 +0200)]
Miri Frame: use mir::Location to represent position in function

4 years agoAdd note about padding
LeSeulArtichaut [Thu, 23 Apr 2020 16:32:41 +0000 (18:32 +0200)]
Add note about padding

Co-authored-by: Mark-Simulacrum <mark.simulacrum@gmail.com>
4 years agoMake VaList::arg link actually work
Tyler Ruckinger [Thu, 23 Apr 2020 15:06:46 +0000 (11:06 -0400)]
Make VaList::arg link actually work

4 years agoUpdate LangString::parse usage in markdown tests
Guillaume Gomez [Thu, 23 Apr 2020 15:02:37 +0000 (17:02 +0200)]
Update LangString::parse usage in markdown tests

4 years agoMerge branch 'master' into fix-doc-links
Tyler Ruckinger [Thu, 23 Apr 2020 14:47:30 +0000 (10:47 -0400)]
Merge branch 'master' into fix-doc-links

4 years agoFix doc link errors
Tyler Ruckinger [Thu, 23 Apr 2020 14:40:28 +0000 (10:40 -0400)]
Fix doc link errors

4 years agoAuto merge of #71467 - Dylan-DPC:rollup-d1os8ug, r=Dylan-DPC
bors [Thu, 23 Apr 2020 14:40:20 +0000 (14:40 +0000)]
Auto merge of #71467 - Dylan-DPC:rollup-d1os8ug, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #71005 (Reading from the return place is fine)
 - #71198 (Const check/promotion cleanup and sanity assertion)
 - #71396 (Improve E0308 error message wording again)
 - #71452 (Remove outdated reference to interpreter snapshotting)
 - #71454 (Inline some function docs in `core::ptr`)
 - #71461 (Improve E0567 explanation)

Failed merges:

r? @ghost

4 years agoAdd UI tests for new rustdoc lint
Guillaume Gomez [Tue, 21 Apr 2020 22:58:52 +0000 (00:58 +0200)]
Add UI tests for new rustdoc lint

4 years agoRollup merge of #71461 - GuillaumeGomez:improve-e0567, r=Dylan-DPC
Dylan DPC [Thu, 23 Apr 2020 13:57:19 +0000 (15:57 +0200)]
Rollup merge of #71461 - GuillaumeGomez:improve-e0567, r=Dylan-DPC

Improve E0567 explanation

r? @Dylan-DPC

4 years agoRollup merge of #71454 - ecstatic-morse:inline-core-ptr-docs, r=RalfJung
Dylan DPC [Thu, 23 Apr 2020 13:57:18 +0000 (15:57 +0200)]
Rollup merge of #71454 - ecstatic-morse:inline-core-ptr-docs, r=RalfJung

Inline some function docs in `core::ptr`

Resolves #64539.

4 years agoRollup merge of #71452 - ecstatic-morse:no-more-snapshot, r=RalfJung
Dylan DPC [Thu, 23 Apr 2020 13:57:16 +0000 (15:57 +0200)]
Rollup merge of #71452 - ecstatic-morse:no-more-snapshot, r=RalfJung

Remove outdated reference to interpreter snapshotting

This should have been a part of #70087.

r? @RalfJung

4 years agoRollup merge of #71396 - DeeDeeG:improve-e0308-again, r=estebank
Dylan DPC [Thu, 23 Apr 2020 13:57:14 +0000 (15:57 +0200)]
Rollup merge of #71396 - DeeDeeG:improve-e0308-again, r=estebank

Improve E0308 error message wording again

Hello again,

I recently did this PR: #70242

I felt the error message could be further improved, so I made [a post on the Rust community forum](https://users.rust-lang.org/t/looking-for-feedback-on-an-improved-error-message-for-e0308/40004) to ask for feedback.

(Also, there were some comments on my original PR that I took into consideration as well.)

This PR is my attempt to take all the feedback into account and propose a better and simplified error message that should still be accurate. Its main benefit is having simpler grammar, and hopefully being easier to read and understand.

Thanks to everyone who commented and gave feedback, and thank you for taking a look at this PR.

4 years agoRollup merge of #71198 - oli-obk:const_check_cleanup, r=RalfJung
Dylan DPC [Thu, 23 Apr 2020 13:57:13 +0000 (15:57 +0200)]
Rollup merge of #71198 - oli-obk:const_check_cleanup, r=RalfJung

Const check/promotion cleanup and sanity assertion

r? @RalfJung

This is just the part of https://github.com/rust-lang/rust/pull/70042#issuecomment-614592765 that does not change behaviour

4 years agoRollup merge of #71005 - jonas-schievink:no-place-like-return, r=oli-obk
Dylan DPC [Thu, 23 Apr 2020 13:57:11 +0000 (15:57 +0200)]
Rollup merge of #71005 - jonas-schievink:no-place-like-return, r=oli-obk

Reading from the return place is fine

Const eval thinks that reading from local `_0` is UB, but it isn't. `_0` is just a normal local like any other, and codegen handles it that way too. The only special thing is that the `Return` terminator will read from it.

I've hit these errors while working on an NRVO pass that can merge other locals with `_0` in https://github.com/rust-lang/rust/pull/71003.

r? @oli-obk

4 years agoStabilize UNICODE_VERSION (feature unicode_version)
Pyfisch [Sun, 12 Apr 2020 17:18:03 +0000 (19:18 +0200)]
Stabilize UNICODE_VERSION (feature unicode_version)

The feature will become stable in Rust 1.45.
Noted that the value of UNICODE_VERSION is expected to change.

4 years agoCreate new rustdoc lint to check for code blocks tags
Guillaume Gomez [Tue, 21 Apr 2020 21:49:06 +0000 (23:49 +0200)]
Create new rustdoc lint to check for code blocks tags

4 years agoDocument our sanity assertion around explicit promotion
Oliver Scherer [Thu, 16 Apr 2020 13:06:17 +0000 (15:06 +0200)]
Document our sanity assertion around explicit promotion

4 years agoCatch and fix explicit promotions that fail to actually promote
Oliver Scherer [Mon, 6 Apr 2020 16:37:26 +0000 (18:37 +0200)]
Catch and fix explicit promotions that fail to actually promote

4 years agoUse `ConstCx` for `validate_candidates`
Oliver Scherer [Thu, 2 Apr 2020 14:38:50 +0000 (16:38 +0200)]
Use `ConstCx` for `validate_candidates`

4 years agoImprove E0567 explanation
Guillaume Gomez [Thu, 23 Apr 2020 11:17:00 +0000 (13:17 +0200)]
Improve E0567 explanation

4 years agoUse ConstCx in the promoted collector
Oliver Scherer [Thu, 2 Apr 2020 14:32:01 +0000 (16:32 +0200)]
Use ConstCx in the promoted collector

4 years agoUse ConstCx in more places
Oliver Scherer [Thu, 2 Apr 2020 14:14:11 +0000 (16:14 +0200)]
Use ConstCx in more places

4 years agoRename `Item` to `ConstCx`.
Oliver Scherer [Mon, 23 Mar 2020 13:02:58 +0000 (14:02 +0100)]
Rename `Item` to `ConstCx`.

This renaming was already done in some modules via import renaming. It's strictly used as a context, and it contains a `TyCtxt`.

4 years agoFix ui test blessing when a test has an empty stderr file after having had content...
Oliver Scherer [Mon, 16 Mar 2020 13:53:22 +0000 (14:53 +0100)]
Fix ui test blessing when a test has an empty stderr file after having had content there before the current changes

4 years agofix error code for E0751
YI [Wed, 22 Apr 2020 12:18:22 +0000 (20:18 +0800)]
fix error code for E0751

4 years agoAuto merge of #71343 - RalfJung:miri, r=RalfJung
bors [Thu, 23 Apr 2020 06:53:19 +0000 (06:53 +0000)]
Auto merge of #71343 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/71241
r? @ghost Cc @rust-lang/miri

4 years agoAdd leading 0x to offset in Debug fmt of Pointer
David Cook [Thu, 23 Apr 2020 04:36:02 +0000 (23:36 -0500)]
Add leading 0x to offset in Debug fmt of Pointer

4 years agoAuto merge of #71312 - wesleywiser:const_prop_bitset, r=Mark-Simulacrum
bors [Thu, 23 Apr 2020 03:44:28 +0000 (03:44 +0000)]
Auto merge of #71312 - wesleywiser:const_prop_bitset, r=Mark-Simulacrum

[ConstProp] Use a `BitSet<Local>` instead of `IndexVec<Local, bool>`

4 years agoInline some function docs re-exported in `std::ptr`
Dylan MacKenzie [Thu, 23 Apr 2020 00:59:30 +0000 (17:59 -0700)]
Inline some function docs re-exported in `std::ptr`

4 years agoAuto merge of #71445 - Dylan-DPC:rollup-31givp1, r=Dylan-DPC
bors [Thu, 23 Apr 2020 00:28:05 +0000 (00:28 +0000)]
Auto merge of #71445 - Dylan-DPC:rollup-31givp1, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71256 (Lint must_use on mem::replace)
 - #71350 (Error code explanation extra check)
 - #71369 (allow wasm32 compilation of librustc_data_structures/profiling.rs)
 - #71400 (proc_macro::is_available())
 - #71440 (Implement `Copy` for `AllocErr`)

Failed merges:

r? @ghost

4 years agoSort `MultiSpan`s on creation
Esteban Küber [Thu, 23 Apr 2020 00:15:34 +0000 (17:15 -0700)]
Sort `MultiSpan`s on creation

4 years agoRemove outdated reference to interpreter snapshotting
Dylan MacKenzie [Wed, 22 Apr 2020 23:31:14 +0000 (16:31 -0700)]
Remove outdated reference to interpreter snapshotting

4 years agoupdate Miri
Ralf Jung [Wed, 22 Apr 2020 22:12:04 +0000 (00:12 +0200)]
update Miri

4 years agoOnly use read_unaligned in transmute_copy if necessary
Amanieu d'Antras [Wed, 22 Apr 2020 21:22:48 +0000 (22:22 +0100)]
Only use read_unaligned in transmute_copy if necessary

4 years agoRollup merge of #71440 - TimDiekmann:copy-allocerr, r=Amanieu
Dylan DPC [Wed, 22 Apr 2020 21:19:25 +0000 (23:19 +0200)]
Rollup merge of #71440 - TimDiekmann:copy-allocerr, r=Amanieu

Implement `Copy` for `AllocErr`

r? @Amanieu

4 years agoRollup merge of #71400 - dtolnay:isavailable, r=petrochenkov
Dylan DPC [Wed, 22 Apr 2020 21:19:24 +0000 (23:19 +0200)]
Rollup merge of #71400 - dtolnay:isavailable, r=petrochenkov

proc_macro::is_available()

This PR adds `proc_macro::is_available() -> bool` to determine whether proc_macro has been made accessible to the currently running program.

The proc_macro crate is only intended for use inside the implementation of procedural macros. All the functions in the crate panic if invoked from outside of a procedural macro, such as from a build script or unit test or ordinary Rust binary.

Unfortunately those panics made it impossible for libraries that are designed to support both macro and non-macro use cases (e.g. Syn) to be used from binaries that are compiled with panic=abort. In panic=unwind mode we're able to attempt a proc macro call inside catch_unwind and use libproc_macro's result if it succeeds, otherwise fall back to a non-macro alternative implementation. But in panic=abort there was no way to determine which implementation needs to be used.

r? @eddyb
attn: @petrochenkov @adetaylor
ref: https://github.com/dtolnay/cxx/issues/130

4 years agoRollup merge of #71369 - ctaggart:wasm32_profiling, r=ecstatic-morse
Dylan DPC [Wed, 22 Apr 2020 21:19:22 +0000 (23:19 +0200)]
Rollup merge of #71369 - ctaggart:wasm32_profiling, r=ecstatic-morse

allow wasm32 compilation of librustc_data_structures/profiling.rs

I'm trying to use rustfmt from a wasm app. I ran into this compilation problem https://github.com/rust-lang/rustfmt/issues/4132 and after investigating, it looked like just adjusting a few cfg's. I based it on how measureme added support in https://github.com/rust-lang/measureme/pull/43.

My testing on my macbook was just that librustc_data_structures builds now with both:
- cargo build
- cargo build --target wasm32-unknown-unknown

4 years agoRollup merge of #71350 - GuillaumeGomez:error-code-explanation-extra-check, r=oli-obk
Dylan DPC [Wed, 22 Apr 2020 21:19:20 +0000 (23:19 +0200)]
Rollup merge of #71350 - GuillaumeGomez:error-code-explanation-extra-check, r=oli-obk

Error code explanation extra check

r? @Mark-Simulacrum

4 years agoRollup merge of #71256 - cuviper:must_use_replace, r=estebank
Dylan DPC [Wed, 22 Apr 2020 21:19:19 +0000 (23:19 +0200)]
Rollup merge of #71256 - cuviper:must_use_replace, r=estebank

Lint must_use on mem::replace

This adds a hint on `mem::replace`, "if you don't need the old value,
you can just assign the new value directly". This is in similar spirit
to the `must_use` on `ManuallyDrop::take`.

4 years agoAuto merge of #71044 - ecstatic-morse:body-predecessor-cache, r=oli-obk
bors [Wed, 22 Apr 2020 21:08:28 +0000 (21:08 +0000)]
Auto merge of #71044 - ecstatic-morse:body-predecessor-cache, r=oli-obk

Remove `BodyAndCache`

...returning to the original approach using interior mutability within `Body`. This simplifies the API at the cost of some uncontended mutex locks when the parallel compiler is enabled.

The current API requires you to either have a mutable reference to `Body` (`&mut BodyAndCache`), or to compute the predecessor graph ahead of time by creating a `ReadOnlyBodyAndCache`. This is not a good fit for, e.g., the dataflow framework, which
1. does not mutate the MIR
2. only sometimes needs the predecessor graph (for backward dataflow problems)

4 years agoAdd a "by reference" adaptor for `AllocRef`
Tim Diekmann [Wed, 22 Apr 2020 20:51:11 +0000 (22:51 +0200)]
Add a "by reference" adaptor for `AllocRef`

4 years agoMake `AllocErr` copyable
Tim Diekmann [Wed, 22 Apr 2020 20:40:21 +0000 (22:40 +0200)]
Make `AllocErr` copyable

4 years agofix test
Esteban Küber [Wed, 22 Apr 2020 19:42:02 +0000 (12:42 -0700)]
fix test

4 years agoreview comment
Esteban Küber [Sat, 18 Apr 2020 23:07:29 +0000 (16:07 -0700)]
review comment

4 years agoRevert old span change
Esteban Küber [Fri, 17 Apr 2020 19:26:32 +0000 (12:26 -0700)]
Revert old span change

4 years agoTweak wording
Esteban Küber [Fri, 17 Apr 2020 17:46:22 +0000 (10:46 -0700)]
Tweak wording

4 years agoTweak `'static` suggestion code
Esteban Küber [Fri, 17 Apr 2020 04:33:42 +0000 (21:33 -0700)]
Tweak `'static` suggestion code

Fix #71196.