Commit Graph

93594 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
44cb86bdc8
Rollup merge of #61003 - nnethercote:rm-InternedString-PartialEq-impls, r=petrochenkov
Remove impls for `InternedString`/string equality.

`Symbol` received the same treatment in #60630.

Also, we can derive `PartialEq` for `InternedString`.

r? @petrochenkov
2019-05-22 03:47:41 +02:00
Mazdak Farrokhzad
98172092cf
Rollup merge of #60998 - RalfJung:static_assert, r=Centril
static_assert: make use of anonymous constants
2019-05-22 03:47:40 +02:00
Mazdak Farrokhzad
3c9ac30dd9
Rollup merge of #60995 - topecongiro:parser-from-stream-and-base-dir, r=michaelwoerister
Add stream_to_parser_with_base_dir

This PR adds `stream_to_parser_with_base_dir`, which creates a parser from a token stream and a base directory.

Context: I would like to parse `cfg_if!` macro and get a list of modules defined inside it from rustfmt so that rustfmt can format those modules (cc https://github.com/rust-lang/rustfmt/issues/3253). To do so, I need to create a parser from `TokenStream` and set the directory of `Parser` to the same directory as the parent directory of a file which contains `cfg_if!` invocation. AFAIK there is no way to achieve this, and hence this PR.

Alternatively, I could change the visibility of `Parser.directory` from `crate` to `pub` so that the value can be modified after initializing a parser. I don't have a preference over either approach (or others, as long as it works).
2019-05-22 03:47:38 +02:00
Mazdak Farrokhzad
705b040ea5
Rollup merge of #60991 - spastorino:local-decls-push, r=oli-obk
LocalDecl push returns Local len

r? @oli-obk
2019-05-22 03:47:37 +02:00
Mazdak Farrokhzad
30760cde69
Rollup merge of #60982 - estebank:fix-60976, r=petrochenkov
Do not fail on child without DefId

Addresses https://github.com/rust-lang/rust/issues/60976, leaving open to come up with a repro case.
2019-05-22 03:47:35 +02:00
Mazdak Farrokhzad
1c4582c1ff
Rollup merge of #60973 - nnethercote:fix-file_metadata-more, r=michaelwoerister
Avoid symbol interning in `file_metadata`.

This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR #60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco
2019-05-22 03:47:34 +02:00
Mazdak Farrokhzad
40a18a1df5
Rollup merge of #60963 - blkerby:boxed_docs, r=alexcrichton
Update boxed::Box docs on memory layout

The existing docs for the `Box` type state that "the way `Box` allocates and releases memory is unspecified", and that therefore the only valid pointer to pass to `Box::from_raw` is one obtained from `Box::into_raw`. This is inconsistent with the module-level docs which specify,

> It is valid to convert both ways between a Box and a raw pointer allocated with the Global allocator, given that the Layout used with the allocator is correct for the type. More precisely, a value: *mut T that has been allocated with the Global allocator with Layout::for_value(&*value) may be converted into a box using Box::<T>::from_raw(value). Conversely, the memory backing a value: *mut T obtained from Box::<T>::into_raw may be deallocated using the Global allocator with Layout::for_value(&*value).

This pull request updates the docs for `Box` to make them consistent with the module-level docs and adds some examples of how to use the global allocator in conjunction with `Box::from_raw` and `Box::into_raw`.
2019-05-22 03:47:32 +02:00
Mazdak Farrokhzad
d69ef04af5
Rollup merge of #60581 - hellow554:fix_60580, r=alexcrichton
convert custom try macro to `?`

resolves #60580

r? @frewsxcv
2019-05-22 03:47:31 +02:00
Mazdak Farrokhzad
a8d1b81ba4
Rollup merge of #59742 - Zoxc:edition-cleanup, r=petrochenkov
Move `edition` outside the hygiene lock and avoid accessing it

r? @petrochenkov
2019-05-22 03:47:29 +02:00
bors
119bbc2056 Auto merge of #61007 - michaelwoerister:limited-debuginfo, r=alexcrichton
debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1

https://github.com/rust-lang/rust/commit/cff075009 made LLVM emit less debuginfo when compiling with "line-tables-only". The change was essentially correct but the reduced amount of debuginfo broke
a number of tools.

This commit reverts the change so we get back the old behavior, until we figure out how to do this properly and give external tools to adapt to the new format.

See https://github.com/rust-lang/rust/issues/60020 for more info.

r? @cuviper
cc @jrmuizel & @froydnj
2019-05-21 21:37:41 +00:00
Jeremy Fitzhardinge
6c38625942 Make -Zemit-artifact-notifications also emit the artifact type
This is easier for tooling to handle than trying to reverse-engineer it from the filename extension.
2019-05-21 13:51:36 -07:00
Matthew Jasper
0835048ea0 Fix match ergonomics suggestion 2019-05-21 19:37:39 +01:00
Mazdak Farrokhzad
015a45156f Comment style fixes
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-05-21 19:37:39 +01:00
Matthew Jasper
2420d82a7c Add a test for match scopes 2019-05-21 19:37:38 +01:00
Matthew Jasper
abab9efbdb Schedule storage-dead of temporaries sooner
This ensures that we will correctly generate a storage-dead if the
initializing expression diverges.
2019-05-21 19:37:38 +01:00
Matthew Jasper
b5643f1a49 Emit fake borrows for all tests
I was incorrectly under the impression that this would only lead to
duplicates. See `mir-opt/match-arm-scope.rs` (upcomming commit) for a
case where we didn't emit a fake borrow of `items.1`.
2019-05-21 19:37:38 +01:00
Matthew Jasper
0f507246e7 Remove MIR borrowck hack for old match scopes 2019-05-21 19:37:38 +01:00
Matthew Jasper
f506aea1fa Give match arms a drop/region scope
Also give arms the correct lint scope in MIR.
2019-05-21 19:37:38 +01:00
Matthew Jasper
af6a9a2c62 Handle the visibility/lint scope distinction better
* Don't generate an extra lint scope for each `let` statement.
* Place match guards inside the visiblility scope of the bindings for
  their arm.
2019-05-21 19:37:38 +01:00
Matthew Jasper
e784595c28 Respect lint attributes on match arms 2019-05-21 19:37:38 +01:00
Matthew Jasper
4bfb0453f5 Give match arms an HirId and a Span 2019-05-21 19:37:38 +01:00
Matthew Jasper
615c23f6ec Remove unused parameter from in(_opt)?_scope 2019-05-21 19:37:38 +01:00
Jethro Beekman
33fb1c501c Add FAQ for NLL migration 2019-05-21 09:52:05 -07:00
John Kåre Alsaker
0b37900b40 Specify the edition for the rustdoc thread-pool 2019-05-21 18:17:06 +02:00
John Kåre Alsaker
a1f2dceaeb Move edition outside the hygiene lock and avoid accessing it 2019-05-21 18:17:05 +02:00
Ralf Jung
a2168b0259 update doc comment 2019-05-21 17:14:09 +02:00
topecongiro
1f1a9176e7 Fix tidy: remove a trailing whitespace 2019-05-21 23:17:59 +09:00
topecongiro
b07dbe1d44 Add doc comment 2019-05-21 22:57:34 +09:00
Michael Woerister
46e3d04b2b debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1.
https://github.com/rust-lang/rust/commit/cff075009 made LLVM emit
less debuginfo when compiling with "line-tables-only". The change
was essentially correct but the reduced amount of debuginfo broke
a number of tools.

This commit reverts the change so we get back the old behavior,
until we figure out how to do this properly and give external
tools to adapt to the new format.

See https://github.com/rust-lang/rust/issues/60020 for more info.
2019-05-21 13:48:29 +02:00
Ralf Jung
61735abc06 adjust deprecation date of mem::uninitialized 2019-05-21 13:10:28 +02:00
Nicholas Nethercote
b557567c35 Remove impls for InternedString/string equality.
`Symbol` received the same treatment in #60630.

Also, we can derive `PartialEq` for `InternedString`.
2019-05-21 20:08:33 +10:00
Ralf Jung
5ea5fe3072 static_assert: make use of anonymous constants 2019-05-21 09:10:24 +02:00
bors
50a0defd5a Auto merge of #60903 - nnethercote:mv-gensyms-from-Symbol-to-Ident, r=petrochenkov
Move gensym operations from `Symbol` to `Ident`

Gensyms are always at the `Ident` level, and long-term we probably want to record gensym-ness in hygiene data.

r? @petrochenkov
2019-05-21 06:37:03 +00:00
topecongiro
e186d3f3e0 Add stream_to_parser_with_base_dir 2019-05-21 13:18:20 +09:00
bors
46ad3e1882 Auto merge of #60950 - taiki-e:arbitrary_self_types-tests, r=Centril
Move arbitrary self types's tests into ui/self

https://github.com/rust-lang/rust/pull/60944#discussion_r285362006

r? @Centril
2019-05-21 03:44:09 +00:00
Brent Kerby
4e37785c7d Create and reference Memory Layout section of boxed docs 2019-05-20 21:03:40 -06:00
bors
b7f6b8a56b Auto merge of #60985 - cr1901:msp430-fix, r=alexcrichton
Bump LLVM submodule to fix MSP430 AsmPrinter and assembler syntax mismatch.

Moving on to steps 9 and 10 of the llvm bugfix [guide](https://rust-lang.github.io/rustc-guide/codegen/updating-llvm.html#bugfix-updates), now that Rust's copy of LLVM was [updated](https://github.com/rust-lang/llvm-project/pull/13).

This PR closes issue #59077. Nightlies following this PR should have working msp430 codegen again :D.

Thanks for the prompt response even though it took me a while to get this "simple" PR done!
2019-05-21 00:50:12 +00:00
Santiago Pastorino
419ca9d640
LocalDecl push returns Local len 2019-05-20 20:13:58 -03:00
bors
09189591c4 Auto merge of #60986 - Centril:rollup-nhpgrfb, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #60383 (Fix position source code files toggle)
 - #60453 (Fall back to `/dev/urandom` on `EPERM` for `getrandom`)
 - #60487 (Fix search sidebar width when no crate select is present)
 - #60511 (Fix intra-doc link resolution failure on re-exporting libstd)
 - #60823 (Fix incremental compilation of cdylib emitting spurious unused_attributes lint)
 - #60915 (stable hashing: Remove unused field and add documentation.)
 - #60942 (Misc changes to rustc_metadata)
 - #60952 (Document BinaryHeap time complexity)
 - #60959 (rustc: Improve type size assertions)
 - #60972 (remove confusing remarks about mixed volatile and non-volatile accesses)
 - #60983 (Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind)

Failed merges:

r? @ghost
2019-05-20 21:38:19 +00:00
Mazdak Farrokhzad
0c97800f93
Rollup merge of #60983 - petrhosek:libunwind-no-exceptions, r=alexcrichton
Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind

These are required otherwise libunwind will end up with undefined
references to __gxx_personality_v0 which is provided by C++ ABI
library and that's undesirable.
2019-05-20 23:03:10 +02:00
Mazdak Farrokhzad
44b5d4deb6
Rollup merge of #60972 - RalfJung:volatile, r=alexcrichton
remove confusing remarks about mixed volatile and non-volatile accesses

These comments were originally added by @ecstatic-morse in 911d35f0bf and then later edited by me. The intention, I think, was to make sure people do both their reads and writes with these methods if the affected memory really is used for communication with external devices.

However, [people read this as saying that mixed volatile/non-volatile accesses are UB](https://github.com/rust-lang/rust/issues/58599#issuecomment-493791130), which -- to my knowledge -- they are not. So better remove this.

Cc @rkruppe @rust-lang/wg-unsafe-code-guidelines
2019-05-20 23:03:08 +02:00
Mazdak Farrokhzad
581cf70367
Rollup merge of #60959 - petrochenkov:sassert, r=estebank
rustc: Improve type size assertions

Now they
- Tell what the new size is, when it changes
- Do not require passing an identifier

```
   ::: src\libsyntax\parse\token.rs:223:1
    |
223 |    static_assert_size!(Token, 123);
    |    -------------------------------- in this macro invocation
    |
    = note: expected type `[(); 123]`
               found type `[(); 16]`
```
2019-05-20 23:03:07 +02:00
Mazdak Farrokhzad
864e7a9251
Rollup merge of #60952 - dtolnay:heap, r=Amanieu
Document BinaryHeap time complexity

I went into some detail on the time complexity of `push` because it is relevant for using BinaryHeap efficiently -- specifically that you should avoid pushing many elements in ascending order when possible.

r? @Amanieu
Closes #47976. Closes #59698.
2019-05-20 23:03:06 +02:00
Mazdak Farrokhzad
65cec43ce1
Rollup merge of #60942 - bjorn3:metadata_loader_refactor, r=michaelwoerister
Misc changes to rustc_metadata
2019-05-20 23:03:03 +02:00
Mazdak Farrokhzad
3f86faddaf
Rollup merge of #60915 - michaelwoerister:hashstablestuff, r=estebank
stable hashing: Remove unused field and add documentation.

This PR removes the `bytes_hashed` field from `StableHasher` which in the past has been used for collecting some statistics but has gone unused for quite a while (months at least) now.

The PR also tries to document some requirements for `HashStable` implementations that haven't been written down explicitly anywhere.
2019-05-20 23:03:02 +02:00
Mazdak Farrokhzad
36b5724e0d
Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoerister
Fix incremental compilation of cdylib emitting spurious unused_attributes lint

fixes #60050
2019-05-20 23:03:00 +02:00
Mazdak Farrokhzad
a34dae3587
Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPC
Fix intra-doc link resolution failure on re-exporting libstd

Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366).
```rust
pub use std::*;
```

Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates.

Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.)

r? @QuietMisdreavus
2019-05-20 23:02:59 +02:00
Mazdak Farrokhzad
bf54251f90
Rollup merge of #60487 - GuillaumeGomez:fix-search-sidebar-width-colors, r=Dylan-DPC
Fix search sidebar width when no crate select is present

Fixes #60480.

I also fixed the box-shadow that seemed to have been kind of removed?

r? @QuietMisdreavus
2019-05-20 23:02:57 +02:00
Mazdak Farrokhzad
5a08ca38de
Rollup merge of #60453 - tbu-:pr_getrandom_enoperm, r=sfackler
Fall back to `/dev/urandom` on `EPERM` for `getrandom`

This can happen because of seccomp or some VMs.

Fixes #52609.
2019-05-20 23:02:55 +02:00
Mazdak Farrokhzad
daf8aca0e3
Rollup merge of #60383 - GuillaumeGomez:fix-position-source-code-files-toggle, r=Manishearth
Fix position source code files toggle

Fixes #60381.

The second commit is a big cleanup of the media queries.

r? @rust-lang/rustdoc

cc @Manishearth

screenshot of the fix:

<img width="501" alt="Screenshot 2019-04-29 at 23 42 56" src="https://user-images.githubusercontent.com/3050060/56929111-112b2b00-6ad9-11e9-9a23-e0a8e3641395.png">
2019-05-20 23:02:52 +02:00