Commit Graph

93646 Commits

Author SHA1 Message Date
Alex Crichton f7cc467b59 rustbuild: Tweak how stage1 compilers are selected
This commit furthers the previous one to ensure that we don't build an
extra stage of the compiler in CI. A test has been added to rustbuild to
ensure that this doesn't regress, and then in debugging this test it was
hunted down that the `dist::Std` target was the one erroneously pulling
in the wrong compiler.

The `dist::Std` step was updated to instead account for the "full
bootstrap" or not flag, ensuring that the correct compiler for compiling
the final standard library was used. This was another use of the
`force_use_stage1` function which was in theory supposed to be pretty
central, so existing users were all evaluated and a new function,
`Builder::compiler_for`, was introduced. All existing users of
`force_use_stage1` have been updated to use `compiler_for`, where the
semantics of `compiler_for` are similar to that of `compiler` except
that it doesn't guarantee the presence of a sysroot for the arguments
passed (as they may be modified).

Perhaps one day we can unify `compiler` and `compiler_for`, but the
usage of `Builder::compiler` is so ubiquitous it would take quite some
time to evaluate whether each one needs the sysroot or not, so it's
hoped that can be done in parallel.
2019-05-28 11:23:53 -07:00
Alex Crichton ad52c77a46 ci: Attempt to skip a full rustc compile on dist*
Currently when we're preparing cross-compiled compilers it can take
quite some time because we have to build the compiler itself three
different times. The first is the normal bootstrap, the second is a
second build for the build platform, and the third is the actual target
architecture compiler. The second compiler was historically built
exclusively for procedural macros, and long ago we didn't actually need
it.

This commit tries out avoiding that second compiled compiler, meaning we
only compile rustc for the build platform only once. Some local testing
shows that this is promising, but bors is of course the ultimate test!
2019-05-26 07:39:14 -07:00
bors d96c01e77c Auto merge of #60803 - varkor:remove-in-place-syntax, r=petrochenkov
Remove `ObsoleteInPlace`

The in place syntax has been deprecated for over a year. As it is, this is accumulated cruft: the error messages are unlikely to be helpful any more and it conflicts with some useful syntax (e.g. const generics in some instances).

It may be that removing `Token::LArrow` is backwards-incompatible. We should do a crater run to check.

cc @eddyb
2019-05-24 09:54:17 +00:00
bors 46805805ab Auto merge of #60984 - matthewjasper:borrowck-error-reporting-cleanup, r=pnkfelix
Borrowck error reporting cleanup

* Don't show variables created by desugarings in borrowck errors
* Move "conflict error" reporting to it's own module, so that `error_reporting` contains only common error reporting methods.
* Remove unused `ScopeTree` parameter.

r? @pnkfelix
2019-05-24 03:07:07 +00:00
varkor 36f654262d Update tests 2019-05-24 01:27:32 +01:00
varkor 7948b68d02 Remove `ObsoleteInPlace` 2019-05-24 01:27:32 +01:00
bors fd8e23c6b2 Auto merge of #61105 - Centril:rollup-t9lemjf, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59545 (Use arenas to avoid Lrc in queries #2)
 - #61054 (Suggest dereferencing on assignment to mutable borrow)
 - #61056 (tweak discriminant on non-nullary enum diagnostic)
 - #61082 (fix dangling reference in Vec::append)
 - #61086 (Box::into_unique: do the reborrow-to-raw *after* destroying the Box)
 - #61098 (Fix overflowing literal lint in loops)

Failed merges:

r? @ghost
2019-05-24 00:21:00 +00:00
Mazdak Farrokhzad 92fda925e3
Rollup merge of #61098 - varkor:fix-overflowing-literal-in-loop, r=estebank
Fix overflowing literal lint in loops

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

r? @estebank
2019-05-24 01:30:25 +02:00
Mazdak Farrokhzad 3388028776
Rollup merge of #61086 - RalfJung:box, r=alexcrichton
Box::into_unique: do the reborrow-to-raw *after* destroying the Box

Currently we first "reborrow" the box to a raw pointer, and then `forget` it. When tracking raw pointers more strictly (something I am experimenting with locally in Miri), the "use" induced by passing the box to `forget` invalidates the previously created raw pointer.

So adjust my hack from https://github.com/rust-lang/rust/pull/58429 to reorder the two operations.
2019-05-24 01:30:24 +02:00
Mazdak Farrokhzad ee972100b2
Rollup merge of #61082 - RalfJung:vec, r=alexcrichton
fix dangling reference in Vec::append

Turns out I forgot to enable Miri again for the Vec tests. And there was a dangling reference hiding in there!  `get_unchecked_mut` is UB to call on an empty vector (there is no memory to get a reference to), and yet this code did it.
2019-05-24 01:30:23 +02:00
Mazdak Farrokhzad 26f3528434
Rollup merge of #61056 - euclio:custom-discriminant-error, r=estebank
tweak discriminant on non-nullary enum diagnostic

Adds notes pointing at the non-nullary variants, and uses "custom
discriminant" language to be consistent with the Reference.

Fixes #61039.

r? @estebank
2019-05-24 01:30:21 +02:00
Mazdak Farrokhzad b9459e7e4d
Rollup merge of #61054 - estebank:mut-ref-reassign, r=zackmdavis
Suggest dereferencing on assignment to mutable borrow

Fix #33570
2019-05-24 01:30:20 +02:00
Mazdak Farrokhzad e0e9c86e05
Rollup merge of #59545 - Zoxc:the-arena-3, r=eddyb,michaelwoerister
Use arenas to avoid Lrc in queries #2

The `Remove subtle Default impl for Value` makes the compilation stop due earlier due to cycle errors, since there's no longer a default value to continue the compilation with.

Based on https://github.com/rust-lang/rust/pull/59540.
2019-05-24 01:30:18 +02:00
bors 8869ee03d7 Auto merge of #60970 - MaulingMonkey:pr-compiletest-cdb-support, r=alexcrichton
Add basic CDB support to debuginfo compiletest s, to help catch `*.natvis` regressions, like those fixed in #60687.

First draft, feedback welcome.

Several Microsoft debuggers (VS, VS Code, WinDbg, CDB, ...) consume the `*.natvis` files we embed into rust `*.pdb` files.  While this only tests CDB, that test coverage should help for all of them.

# Changes

## src\bootstrap
  - test.rs:  Run CDB debuginfo tests on MSVC targets

## src\test\debuginfo
  - issue-13213.rs:  CDB has trouble with this, skip for now (newly discovered regression?)
  - pretty-std.rs:  Was ignored, re-enable for CDB only to start with, add CDB tests.
  - should-fail.rs:  Add CDB tests.

## src\tools\compiletest:
  - Added "-cdb" option
  - Added Mode::DebugInfoCdb ("debuginfo-cdb")
  - Added run_debuginfo_cdb_test[_no_opt]
  - Renamed Mode::DebugInfoBoth -> DebugInfoGdbLldb ("debuginfo-gdb+lldb") since it's no longer clear what "Both" means.
  - Find CDB at the default Win10 SDK install path "C:\Program Files (x86)\Windows Kits\10\Debugger\\*\cdb.exe"
  - Ignore CDB tests if CDB not found.

# Issues

  - `compute_stamp_hash`: not sure if there's any point in hashing `%ProgramFiles(x86)%`
  - `OsString` lacks any `*.natvis` entries (would be nice to add in a followup changelist)
  - DSTs (array/string slices) which work in VS & VS Code fail in CDB.
  - I've avoided `Mode::DebugInfoAll` as 3 debuggers leads to pow(2,3)=8 possible combinations.

# Reference

CDB is not part of the base Visual Studio install, but can be added via the Windows 10 SDK:
  https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
Installing just "Debugging Tools for Windows" is sufficient.

CDB appears to already be installed on appveyor CI, where this changelist can find it, based on it's use here:
  0ffc573110/appveyor.yml (L227)

CDB commands and command line reference:
  https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-reference
2019-05-23 20:58:21 +00:00
varkor 12de24ce81 Add test for denying overflowing literal in loop 2019-05-23 21:48:26 +01:00
varkor 3e4cefe1bd Update unreachable loop patterns test 2019-05-23 21:39:36 +01:00
varkor 49f01d823f Fix missing overflowing literal lint in for loop 2019-05-23 21:39:27 +01:00
Esteban Küber 7fbbcfaafd Add regression test for negative case 2019-05-23 10:32:01 -07:00
John Kåre Alsaker d46e732e39 Update crate_variances and inferred_outlives_crate 2019-05-23 18:51:52 +02:00
John Kåre Alsaker a58999c19e Update dylib_dependency_formats, extern_crate and reachable_non_generics 2019-05-23 18:51:52 +02:00
John Kåre Alsaker 469831f4da Update foreign_modules and dllimport_foreign_items 2019-05-23 18:51:51 +02:00
John Kåre Alsaker 2f74d90ef3 Update visible_parent_map 2019-05-23 18:51:51 +02:00
John Kåre Alsaker 3f87975d65 Update get_lib_features, defined_lib_features, get_lang_items, defined_lang_items, missing_lang_items, postorder_cnums and maybe_unused_extern_crates 2019-05-23 18:51:51 +02:00
John Kåre Alsaker 46f2511296 Update wasm_import_module_map and target_features_whitelist 2019-05-23 18:51:50 +02:00
John Kåre Alsaker 9b648f7088 Update upvars and module_exports 2019-05-23 18:51:50 +02:00
John Kåre Alsaker 5f808f6588 Update in_scope_traits_map 2019-05-23 18:51:50 +02:00
John Kåre Alsaker fb578794b0 Update privacy_access_levels 2019-05-23 18:51:49 +02:00
John Kåre Alsaker 5751fcc3b1 Update all_traits 2019-05-23 18:51:49 +02:00
John Kåre Alsaker 10ef70bb68 Update stability_index, all_crate_nums and features_query 2019-05-23 18:51:49 +02:00
John Kåre Alsaker 9dcc60b081 Update lint_levels 2019-05-23 18:51:48 +02:00
John Kåre Alsaker 5bcc80be10 Update Cargo.lock 2019-05-23 18:51:48 +02:00
John Kåre Alsaker ad2b35bb31 Make ArenaField private 2019-05-23 18:51:47 +02:00
John Kåre Alsaker 42145659fd Add a comment for arena_types! 2019-05-23 18:51:47 +02:00
John Kåre Alsaker e77096b08c Remove subtle Default impl for Value 2019-05-23 18:51:47 +02:00
John Kåre Alsaker ae8975c812 Update GenericPredicates queries 2019-05-23 18:51:46 +02:00
John Kåre Alsaker ba5d9c094d Optimize alloc_from_iter 2019-05-23 18:51:46 +02:00
John Kåre Alsaker 28482db247 Update used_trait_imports 2019-05-23 18:51:45 +02:00
John Kåre Alsaker b1398a0de6 Update item_children 2019-05-23 18:51:45 +02:00
John Kåre Alsaker 529aed81de Update resolve_lifetimes, named_region_map, is_late_bound_map and object_lifetime_defaults_map 2019-05-23 18:51:45 +02:00
John Kåre Alsaker 093940ddc4 Update implementations_of_trait and all_trait_implementations 2019-05-23 18:51:43 +02:00
John Kåre Alsaker 95dfd82666 Update upstream_monomorphizations and upstream_monomorphizations_for 2019-05-23 18:51:42 +02:00
John Kåre Alsaker 99f6221bb6 Update borrowck 2019-05-23 18:51:42 +02:00
John Kåre Alsaker 8c936e422f Update inherent_impls 2019-05-23 18:51:42 +02:00
John Kåre Alsaker 4ba144d5dd Update associated_item_def_ids 2019-05-23 18:51:41 +02:00
Ralf Jung 8d4e7fde47 adjust comment 2019-05-23 18:13:08 +02:00
Ralf Jung 6116f19f7b Box::into_unique: do the reborrow-to-raw *after* destroying the Box 2019-05-23 18:01:47 +02:00
Andy Russell 3cbf5864a6
tweak discriminant on non-nullary enum diagnostic
Adds notes pointing at the non-nullary variants, and uses "custom
discriminant" language to be consistent with the Reference.
2019-05-23 11:13:48 -04:00
Ralf Jung f44b264447 fix dangling reference in Vec::append 2019-05-23 16:30:54 +02:00
bors 27cc0db7a2 Auto merge of #60965 - petrochenkov:lit3, r=matklad
syntax: Continue refactoring literals

A follow up to https://github.com/rust-lang/rust/pull/60679.

a2fd002bd5: Similarly to `EscapeError`, literal parsing now produces a `LitError`.
This way we can get rid of `diag: Option<(Span, &Handler)>` in interfaces while leaving attr/mod alone.

d9516d1120: Gathers all components of a literal token in a single struct.
2019-05-23 13:28:27 +00:00
Vadim Petrochenkov 90d15e7704 syntax: Some code cleanup 2019-05-23 12:46:41 +03:00