about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-05-22Auto merge of #60840 - tmandry:preserve-scope-in-generator-mir, r=cramertjbors-44/+93
Preserve local scopes in generator MIR Part of #52924, depended upon by the generator layout optimization #60187. This PR adds `StorageDead` statements in more places in generators, so we can see when non-`Drop` locals have gone out of scope and recover their storage. The reason this is only done for generators is compiler performance. See https://github.com/rust-lang/rust/pull/60187#issuecomment-485637811 for what happens when we do this for all functions. For `Drop` locals, we modify the `MaybeStorageLive` analysis to use `drop` to indicate that storage is no longer live for the local. Once `drop` returns or unwinds to our function, we implicitly assume that the local is `StorageDead`. Instead of using `drop`, it is possible to emit more `StorageDead` statements in the MIR for `Drop` locals so we can handle all locals the same. I am fine with doing it that way, but this was the simplest approach for my purposes. It is also likely to be more performant. r? @Zoxc (feel free to reassign) cc @cramertj @eddyb @RalfJung @rust-lang/wg-async-await
2019-05-22Rollup merge of #61006 - RalfJung:maybe-uninit, r=CentrilMazdak Farrokhzad-1/+1
adjust deprecation date of mem::uninitialized In https://github.com/rust-lang/rust/pull/60445 we [decided](https://github.com/rust-lang/rust/pull/60445#issuecomment-488626308) that we'd deprecate for 1.38 instead of 1.40, but I forgot to adjust for that.
2019-05-22Rollup merge of #61003 - nnethercote:rm-InternedString-PartialEq-impls, ↵Mazdak Farrokhzad-66/+34
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-22Rollup merge of #60998 - RalfJung:static_assert, r=CentrilMazdak Farrokhzad-7/+6
static_assert: make use of anonymous constants
2019-05-22Rollup merge of #60995 - topecongiro:parser-from-stream-and-base-dir, ↵Mazdak Farrokhzad-0/+17
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-22Rollup merge of #60991 - spastorino:local-decls-push, r=oli-obkMazdak Farrokhzad-2/+2
LocalDecl push returns Local len r? @oli-obk
2019-05-22Rollup merge of #60982 - estebank:fix-60976, r=petrochenkovMazdak Farrokhzad-11/+11
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-22Rollup merge of #60973 - nnethercote:fix-file_metadata-more, r=michaelwoeristerMazdak Farrokhzad-34/+34
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-22Rollup merge of #60963 - blkerby:boxed_docs, r=alexcrichtonMazdak Farrokhzad-25/+64
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-22Rollup merge of #60581 - hellow554:fix_60580, r=alexcrichtonMazdak Farrokhzad-57/+46
convert custom try macro to `?` resolves #60580 r? @frewsxcv
2019-05-22Rollup merge of #59742 - Zoxc:edition-cleanup, r=petrochenkovMazdak Farrokhzad-143/+162
Move `edition` outside the hygiene lock and avoid accessing it r? @petrochenkov
2019-05-21Auto merge of #61007 - michaelwoerister:limited-debuginfo, r=alexcrichtonbors-2/+21
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-21Specify the edition for the rustdoc thread-poolJohn Kåre Alsaker-5/+8
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-139/+155
2019-05-21update doc commentRalf Jung-2/+1
2019-05-21Fix tidy: remove a trailing whitespacetopecongiro-1/+1
2019-05-21Add doc commenttopecongiro-0/+10
2019-05-21debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1.Michael Woerister-2/+21
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-21adjust deprecation date of mem::uninitializedRalf Jung-1/+1
2019-05-21Remove impls for `InternedString`/string equality.Nicholas Nethercote-66/+34
`Symbol` received the same treatment in #60630. Also, we can derive `PartialEq` for `InternedString`.
2019-05-21static_assert: make use of anonymous constantsRalf Jung-5/+5
2019-05-21Auto merge of #60903 - nnethercote:mv-gensyms-from-Symbol-to-Ident, ↵bors-71/+67
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-21Add stream_to_parser_with_base_dirtopecongiro-0/+7
2019-05-21Auto merge of #60950 - taiki-e:arbitrary_self_types-tests, r=Centrilbors-3/+5
Move arbitrary self types's tests into ui/self https://github.com/rust-lang/rust/pull/60944#discussion_r285362006 r? @Centril
2019-05-20Create and reference Memory Layout section of boxed docsBrent Kerby-31/+39
2019-05-21Auto merge of #60985 - cr1901:msp430-fix, r=alexcrichtonbors-0/+0
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-20LocalDecl push returns Local lenSantiago Pastorino-2/+2
2019-05-20Rollup merge of #60983 - petrhosek:libunwind-no-exceptions, r=alexcrichtonMazdak Farrokhzad-5/+2
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-20Rollup merge of #60972 - RalfJung:volatile, r=alexcrichtonMazdak Farrokhzad-6/+0
remove confusing remarks about mixed volatile and non-volatile accesses These comments were originally added by @ecstatic-morse in https://github.com/rust-lang/rust/commit/911d35f0bfd207112806eaec2763201dad06d1c7 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-20Rollup merge of #60959 - petrochenkov:sassert, r=estebankMazdak Farrokhzad-23/+31
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-20Rollup merge of #60952 - dtolnay:heap, r=AmanieuMazdak Farrokhzad-0/+43
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-20Rollup merge of #60942 - bjorn3:metadata_loader_refactor, r=michaelwoeristerMazdak Farrokhzad-6/+5
Misc changes to rustc_metadata
2019-05-20Rollup merge of #60915 - michaelwoerister:hashstablestuff, r=estebankMazdak Farrokhzad-20/+24
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-20Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoeristerMazdak Farrokhzad-8/+12
Fix incremental compilation of cdylib emitting spurious unused_attributes lint fixes #60050
2019-05-20Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPCMazdak Farrokhzad-2/+94
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-20Rollup merge of #60487 - GuillaumeGomez:fix-search-sidebar-width-colors, ↵Mazdak Farrokhzad-9/+10
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-20Rollup merge of #60453 - tbu-:pr_getrandom_enoperm, r=sfacklerMazdak Farrokhzad-1/+6
Fall back to `/dev/urandom` on `EPERM` for `getrandom` This can happen because of seccomp or some VMs. Fixes #52609.
2019-05-20Rollup merge of #60383 - ↵Mazdak Farrokhzad-207/+214
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-20Fix MSP430 AsmPrinter and assembler syntax mismatch.William D. Jones-0/+0
2019-05-20Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwindPetr Hosek-5/+2
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-20Do not fail on child without DefIdEsteban Küber-11/+11
2019-05-20Auto merge of #60445 - RalfJung:maybe-uninit, r=Centrilbors-250/+202
stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the future (1.40.0). This is part of implementing https://github.com/rust-lang/rfcs/pull/1892. Also expand the documentation a bit. This type is currently primarily useful when dealing with partially initialized arrays. In libstd, it is used e.g. in `BTreeMap` (with some unstable APIs that however can all be replaced, less ergonomically, by stable ones). What we stabilize should also be enough for `SmallVec` (Cc @bluss). Making this useful for structs requires https://github.com/rust-lang/rfcs/pull/2582 or a commitment that references to uninitialized data are not insta-UB.
2019-05-20Remove trailing whitespaces to satisfy tidyBrent Kerby-5/+5
2019-05-20Update boxed::Box docs on memory layoutBrent Kerby-14/+45
2019-05-20Avoid symbol interning in `file_metadata`.Nicholas Nethercote-34/+34
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.
2019-05-20update miriRalf Jung-19/+5
2019-05-20Document layout guarantee of MaybeUninitPeter Todd-0/+22
2019-05-20elliminate mem::uninitialize from docs in libcoreRalf Jung-60/+4
2019-05-20add out-pointer exampleRalf Jung-1/+25
2019-05-20apply feedbackRalf Jung-28/+36