Commit Graph

93771 Commits

Author SHA1 Message Date
Mark Mansi
3f2dd24adc these errors can happen after all 2019-05-22 10:29:36 -05:00
Alex Crichton
194679c9da Disable LLVM/debug assertions in gnu-full-bootstrap
This builder already is very close to the 2 hour mark and the debug
assertions aren't really buying us anything over what all the other
containers are enabling, so let's disable them for this slow builder.
2019-05-22 08:02:19 -07:00
Alex Crichton
e59f0cc0d3 Bump compiler-builtins to 0.1.15
This commit bumps the `compiler-builtins` dependency to 0.1.15 which
expects to have the source for `compiler-rt` provided externally if the
`c` feature is enabled. This then plumbs through the necessary support
in the build system to ensure that if the `llvm-project` directory is
checked out and present that we enable the `c` feature of
`compiler-builtins` and compile in all the C intrinsics.
2019-05-22 07:46:36 -07:00
Michael Bradshaw
a31dc8e3b1 Allow null-pointer-optimized enums in FFI if their underlying representation is FFI safe
This allows types like Option<NonZeroU8> to be used in FFI without triggering the improper_ctypes lint. This works by changing the is_repr_nullable_ptr function to consider an enum E to be FFI-safe if:

- E has no explicit #[repr(...)].
- It only has two variants.
- One of those variants is empty (meaning it has no fields).
- The other variant has only one field.
- That field is one of the following:
  - &T
  - &mut T
  - extern "C" fn
  - core::num::NonZero*
  - core::ptr::NonNull<T>
  - #[repr(transparent)] struct wrapper around one of the types in this list.
- The size of E and its field are both known and are both the same size (implying E is participating in the nonnull optimization).
2019-05-22 07:24:28 -07:00
Alex Crichton
a8ac80b7bc Final cleanups
* Clean up the `install-windows-build-deps.yml` file and add some more
  comments where appropriate.

* Add some comments to `run.yml`

* Don't fast path the `rustfmt` submodule, but we'll take care of that
  later if necessary.
2019-05-22 07:09:25 -07:00
Santiago Pastorino
3fd4b22bce Make maybe_codegen_consume_direct iterate instead of doing recursion 2019-05-22 14:22:37 +02:00
Pietro Albini
36ee777ceb
remove azure badge from the readme 2019-05-22 13:28:20 +02:00
Oliver Scherer
08c91f8bef Update clippy submodule 2019-05-22 13:12:37 +02:00
Eduard-Mihai Burtescu
7327768a75 rustc_metadata: rip out unused incremental infrastructure. 2019-05-22 12:16:48 +03:00
Eduard-Mihai Burtescu
c99090761c rustc_metadata: parametrize schema::CrateRoot by 'tcx. 2019-05-22 11:52:30 +03:00
bors
37ff5d388f Auto merge of #59445 - alexreg:ban-multi-trait-objects-via-aliases, r=oli-obk
Ban multi-trait objects via trait aliases

Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases.

This has been factored out from the previous PR https://github.com/rust-lang/rust/pull/55994 (see point 1).

r? @Centril

CC @nikomatsakis

------------------

### RELNOTES:

We now allow `dyn Send + fmt::Debug` with equivalent semantics to `dyn fmt::Debug + Send`.
That is, the order of the mentioned traits does not matter wrt. principal/not-principal traits.
This is a small change that might deserve a mention in the blog post because it is a language change but most likely not.

See ce2ee305f9/src/test/ui/traits/wf-trait-object-reverse-order.rs.

// @Centril
2019-05-22 08:22:17 +00:00
bors
1cc822c261 Auto merge of #60840 - tmandry:preserve-scope-in-generator-mir, r=cramertj
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-22 04:42:20 +00:00
Santiago Pastorino
f47b87279c Migrate from recursion to iterate on qualify consts visitor impl 2019-05-22 06:00:04 +02:00
Brent Kerby
e641fb47c4 Simplify RefCell minimum_spanning_tree example 2019-05-21 21:52:21 -06:00
bors
dbfe70dfcd Auto merge of #61027 - Centril:rollup-oewauf1, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #59742 (Move `edition` outside the hygiene lock and avoid accessing it)
 - #60581 (convert custom try macro to `?`)
 - #60963 (Update boxed::Box docs on memory layout)
 - #60973 (Avoid symbol interning in `file_metadata`.)
 - #60982 (Do not fail on child without DefId)
 - #60991 (LocalDecl push returns Local len)
 - #60995 (Add stream_to_parser_with_base_dir)
 - #60998 (static_assert: make use of anonymous constants)
 - #61003 (Remove impls for `InternedString`/string equality.)
 - #61006 (adjust deprecation date of mem::uninitialized)

Failed merges:

r? @ghost
2019-05-22 01:51:31 +00:00
Mazdak Farrokhzad
2551a54af1
Rollup merge of #61006 - RalfJung:maybe-uninit, r=Centril
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-22 03:47:43 +02:00
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
Alex Crichton
e5418f61de Update webrender we're testing
The one locked here has a dependency on an old enough `cmake` crate that
it's not detecting visual studio correctly. Let's update webrender which
updates `cmake` which should be able to detect Visual Studio correctly.
2019-05-21 15:57:47 -07:00
Alex Crichton
e0ed2a3f60 Correct the upload_dir in script 2019-05-21 15:55:26 -07:00
Alex Crichton
fe3dd0b50f Merge remote-tracking branch 'origin/master' into azure-pipelines 2019-05-21 15:37:07 -07:00
Alex Crichton
e764f475ca Disable solaris target since toolchain no longer builds 2019-05-21 15:34:56 -07:00
Alex Crichton
78965f49c8 Use xcode 9.3 on all osx builders 2019-05-21 15:14:20 -07: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
Alex Crichton
beea4f5e4a Execute everything! 2019-05-21 13:32:53 -07:00
Matthew Jasper
8dc945c169 Remove unused parameter in borrowck error reporting 2019-05-21 20:38:17 +01:00
Matthew Jasper
df5d072172 Move conflict error reporting to its own module 2019-05-21 20:38:17 +01:00
Matthew Jasper
ebd6c7164e Dont show variables from desugarings in borrowck errors 2019-05-21 20:38:17 +01:00
Pietro Albini
190d1988e0
ci: switch to xcode 9.3 on azure 2019-05-21 21:25:42 +02:00
Alex Crichton
8d42b87ac0 Use new-style s3 urls in docker download script 2019-05-21 12:20:50 -07:00
Alex Crichton
0f4b546af3 Go back to fewer builders to test on try 2019-05-21 12:09:44 -07:00
Alex Crichton
7b7e172f6d Place timeouts at the job level 2019-05-21 12:06:47 -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