Commit Graph

109213 Commits

Author SHA1 Message Date
Ralf Jung
5930da4465 Abi::is_signed: assert that we are a Scalar 2020-03-20 17:05:00 +01:00
Guillaume Gomez
32670ddd28 Clean up E0439 explanation 2020-03-20 17:03:04 +01:00
Mark Rousskov
bce7f6f3a0 Fix debugger pretty printing of BTrees 2020-03-20 12:02:07 -04:00
bors
2835ca6584 Auto merge of #70174 - JohnTitor:rollup-0lum0jh, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #69618 (Clarify the relationship between `forget()` and `ManuallyDrop`.)
 - #69768 (Compute the correct layout for variants of uninhabited enums)
 - #69935 (codegen/mir: support polymorphic `InstanceDef`s)
 - #70103 (Clean up E0437 explanation)
 - #70131 (Add regression test for TAIT lifetime inference (issue #55099))
 - #70133 (remove unused imports)
 - #70145 (doc: Add quote to .init_array)
 - #70146 (Clean up e0438 explanation)
 - #70150 (triagebot.toml: accept cleanup-crew)

Failed merges:

r? @ghost
2020-03-20 15:58:34 +00:00
Mazdak Farrokhzad
9b9a22cd2e can_begin_literal_maybe_minus: true on "-"? lit NTs. 2020-03-20 16:42:53 +01:00
Kornel
2f7d7c0333 must_use on split_off 2020-03-20 14:40:35 +00:00
Alex Crichton
5edaa7eefd Fix abort-on-eprintln during process shutdown
This commit fixes an issue where if `eprintln!` is used in a TLS
destructor it can accidentally cause the process to abort. TLS
destructors are executed after `main` returns on the main thread, and at
this point we've also deinitialized global `Lazy` values like those
which store the `Stderr` and `Stdout` internals. This means that despite
handling TLS not being accessible in `eprintln!`, we will fail due to
not being able to call `stderr()`. This means that we'll double-panic
quickly because panicking also attempt to write to stderr.

The fix here is to reimplement the global stderr handle to avoid the
need for destruction. This avoids the need for `Lazy` as well as the
hidden panic inside of the `stderr` function.

Overall this should improve the robustness of printing errors and/or
panics in weird situations, since the `stderr` accessor should be
infallible in more situations.
2020-03-20 07:34:56 -07:00
Mark Rousskov
4d85314a00 Update test commentary for shared root removal 2020-03-20 09:43:41 -04:00
Mark Rousskov
13f6d771bb Simplify ensure_root_is_owned callers
This makes ensure_root_is_owned return a reference to the (now guaranteed to
exist) root, allowing callers to operate on it without going through another
unwrap.

Unfortunately this is only rarely useful as it's frequently the case that both
the length and the root need to be accessed and field-level borrows in methods
don't yet exist.
2020-03-20 09:43:41 -04:00
Mark Rousskov
54b7c38889 Drop NodeHeader type from BTree code
We no longer have a separate header because the shared root is gone; all code
can work solely with leafs now.
2020-03-20 09:43:41 -04:00
Mark Rousskov
3c04fda751 Make functions dependent only on shared root avoidance safe 2020-03-20 09:43:40 -04:00
Mark Rousskov
1c44f852df Remove shared root code and assertions from BTree nodes 2020-03-20 09:43:19 -04:00
Mark Rousskov
e61f126fb4 Replace shared root with optional root
This simplifies the node manipulation, as we can (in later commits) always know
when traversing nodes that we are not in a shared root.
2020-03-20 09:42:10 -04:00
TyPR124
45416cd91a add comment about maintaining OsStr encoding 2020-03-20 09:00:53 -04:00
Ryan Levick
5444aded02 Add tests for #58319 and #65131 2020-03-20 13:24:35 +01:00
bjorn3
3f6236ea5a
Fix oudated comment for NamedRegionMap 2020-03-20 13:23:24 +01:00
DutchGhost
d6f3a433d9
Update const_forget.rs 2020-03-20 10:36:40 +01:00
Yuki Okushi
43c7a503fe
Rollup merge of #70150 - rust-lang:accept-felixes-typo, r=Mark-Simulacrum
triagebot.toml: accept cleanup-crew

r? @Mark-Simulacrum
2020-03-20 17:02:14 +09:00
Yuki Okushi
8965f63f84
Rollup merge of #70146 - GuillaumeGomez:cleanup-e0438, r=Dylan-DPC
Clean up e0438 explanation

r? @Dylan-DPC
2020-03-20 17:02:12 +09:00
Yuki Okushi
d6ebf215b1
Rollup merge of #70145 - lzutao:patch-1, r=Dylan-DPC
doc: Add quote to .init_array

The current formatting is not good without quotes:
![without-quote](https://i.imgur.com/RkIm4cr.png)
2020-03-20 17:02:11 +09:00
Yuki Okushi
8615a365b6
Rollup merge of #70133 - hermitcore:libpanic_unwind, r=nikomatsakis
remove unused imports

patch is required to avoid compiler errors by building src/libpanic_unwind/hermit.rs
2020-03-20 17:02:09 +09:00
Yuki Okushi
2f77d5fe39
Rollup merge of #70131 - Aaron1011:fix/issue-55099-test, r=nikomatsakis
Add regression test for TAIT lifetime inference (issue #55099)

Fixes #55099

The minimized reproducer in issue #55099 now compiles successfully.
This commit adds a regression test for it.
2020-03-20 17:02:08 +09:00
Yuki Okushi
532133b71d
Rollup merge of #70103 - GuillaumeGomez:cleanup-e0437, r=Dylan-DPC
Clean up E0437 explanation

r? @Dylan-DPC
2020-03-20 17:02:06 +09:00
Yuki Okushi
9dc699430f
Rollup merge of #69935 - davidtwco:issue-69925, r=eddyb
codegen/mir: support polymorphic `InstanceDef`s

cc #69925

This PR modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s.

r? @eddyb
cc @nikomatsakis
2020-03-20 17:02:05 +09:00
Yuki Okushi
3554f2d941
Rollup merge of #69768 - oli-obk:union_field_ice, r=eddyb,RalfJung
Compute the correct layout for variants of uninhabited enums

r? @eddyb
cc @RalfJung

fixes #69191
cc #69763
2020-03-20 17:02:03 +09:00
Yuki Okushi
5d39517680
Rollup merge of #69618 - hniksic:mem-forget-doc-fix, r=RalfJung
Clarify the relationship between `forget()` and `ManuallyDrop`.

As discussed on reddit, this commit addresses two issues with the
documentation of `mem::forget()`:

* The documentation of `mem::forget()` can confuse the reader because of the
  discrepancy between usage examples that show correct usage and the
  accompanying text which speaks of the possibility of double-free.  The
  text that says "if the panic occurs before `mem::forget` was called"
  refers to a variant of the second example that was never shown, modified
  to use `mem::forget` instead of `ManuallyDrop`.  Ideally the documentation
  should show both variants, so it's clear what it's talking about.

  Also, the double free could be fixed just by placing `mem::forget(v)`
  before the construction of `s`.  Since the lifetimes of `s` and `v`
  wouldn't overlap, there would be no point where panic could cause a double
  free.  This could be mentioned, and contrasted against the more robust fix
  of using `ManuallyDrop`.

* This sentence seems unjustified: "For some types, operations such as
  passing ownership (to a funcion like `mem::forget`) requires them to
  actually be fully owned right now [...]".  Unlike C++, Rust has no move
  constructors, its moves are (possibly elided) bitwise copies.  Even if you
  pass an invalid object to `mem::forget`, no harm should come to pass
  because `mem::forget` consumes the object and exists solely to prevent
  drop, so there no one left to observe the invalid state state.
2020-03-20 17:02:01 +09:00
Eduard-Mihai Burtescu
6f6fe38b19 parse/lexer: support StringReader::retokenize called on external files. 2020-03-20 08:00:06 +02:00
Mark Mansi
2d75a339ca Refactorings to begin getting rid of rustc_codegen_utils 2020-03-19 23:14:46 -05:00
Bastian Kauschke
17c94c6746
fix FIXME comment
Co-Authored-By: varkor <github@varkor.com>
2020-03-20 00:28:49 +01:00
Tomasz Miąsko
fd0e15bbcd Make std::sync::Arc compatible with ThreadSanitizer
The memory fences used previously in Arc implementation are not properly
understood by ThreadSanitizer as synchronization primitives. This had
unfortunate effect where running any non-trivial program compiled with
`-Z sanitizer=thread` would result in numerous false positives.

Replace acquire fences with acquire loads when using ThreadSanitizer to
address the issue.
2020-03-20 00:18:44 +01:00
CDirkx
6570e275b9 Removed unused Hasher import. 2020-03-19 21:58:11 +01:00
Matthew Jasper
0f0f254a9c Use erased regions in MIR 2020-03-19 19:59:13 +00:00
CDirkx
bd6deaa08d Derive PartialEq, Eq and Hash for RangeInclusive
The manual implementation of PartialEq, Eq and Hash for RangeInclusive was functionally equivalent to a derived implementation.

This change removes the manual implementation and adds the respective derives.
A side effect of this change is that the derives also add implementations for StructuralPartialEq and StructuralEq, which enables RangeInclusive to be used in const generics.
2020-03-19 20:45:47 +01:00
Bastian Kauschke
6cb584608c sort generic param order in generics_of 2020-03-19 20:20:09 +01:00
Waffle
121bffce81 make "other" in docs of Option::{zip,zip_with} monofont 2020-03-19 22:19:37 +03:00
Nikita Popov
497f879b1e Update CreateMemSet() usage for LLVM 10 2020-03-19 20:09:57 +01:00
Nikita Popov
a94fa896cc Fix timeTraceProfilerInitialize for LLVM 10 2020-03-19 20:09:57 +01:00
Nikita Popov
66008eb9e4 Adjust data layout in test 2020-03-19 20:09:57 +01:00
Nikita Popov
7a14f9ed4f Fix LLVM version handling in compiletest
Convert version string to integer before comparing. Otherwise
we get into trouble with double digit versions ;)
2020-03-19 20:09:57 +01:00
Nikita Popov
841558d3bd Remove trailing newline from llvm-config output 2020-03-19 20:09:57 +01:00
Josh Stone
3a2a4429a2 Avoid llvm-config in more situations, like bootstrap test runs 2020-03-19 10:28:47 -07:00
Eduard-Mihai Burtescu
be9679de5c rustc/query: tweak comments on hir_owner{,_nodes}. 2020-03-19 19:05:41 +02:00
Alex Crichton
d1a4a57777 Update the bundled wasi-libc with libstd
Brings in WebAssembly/wasi-libc#184 which can help standalone programs
with environment variables!
2020-03-19 09:58:31 -07:00
bors
f4c675c476 Auto merge of #69402 - GuillaumeGomez:extend-search, r=kinnison
Extend search

I realized that when looking for "struct:String" in the rustdoc search for example, the "in arguments" and "returned" tabs were always empty. After some investigation, I realized it was because we only provided the name, and not the type, making it impossible to pass the "type filtering" check.

To resolve this, I added the type alongside the name. Note for the future: we could improve this by instead only registering the path id and use the path dictionary directly. The only problem with that solution (which I already tested) is that it becomes complicated for types in other crates. It'd force us to handle both case with an id and a case with `(name, type)`. I found the current PR big enough to not want to provide it directly. However, I think this is definitely worth it to make it work this way in the future.

About the two tests I added: they don't have much interest except checking that we actually have something returned in the search in the cases of a type filtering with and without literal search.

I also had to update a bit the test script to add the new locally global (haha) variable I created (`NO_TYPE_FILTER`). I added this variable to make the code easier to read than just "-1".

r? @kinnison

cc @ollie27
2020-03-19 16:07:59 +00:00
flip1995
2b3168ce5f
Update Clippy 2020-03-19 16:46:51 +01:00
Mazdak Farrokhzad
89ef59af78
triagebot.toml: accept typo due to pnkfelix 2020-03-19 15:38:31 +01:00
Amanieu d'Antras
203bb2b572 Update stdarch submodule 2020-03-19 14:38:09 +00:00
John Kåre Alsaker
027c8d998e Use assert_ignored when encoding metadata 2020-03-19 15:22:55 +01:00
John Kåre Alsaker
801e4420b6 Add some comments 2020-03-19 15:22:55 +01:00
John Kåre Alsaker
a2bca90077 Make metadata prefetching more accurate 2020-03-19 15:22:55 +01:00