Commit Graph

93906 Commits

Author SHA1 Message Date
Santiago Pastorino
8173febf93 Avoid catch-all arm, use Base(PlaceBase::Static(_)) 2019-05-24 21:13:19 +02:00
Esteban Küber
da57ac38a6 Move diagnostic logic out of parser 2019-05-24 11:50:21 -07:00
Esteban Küber
a2f853a691 Fix rebase 2019-05-24 11:50:21 -07:00
Esteban Küber
5c5fa775e5 review comments 2019-05-24 11:50:21 -07:00
Esteban Küber
24160171e4 Tweak macro parse errors when reaching EOF during macro call parse
- Add detail on origin of current parser when reaching EOF and stop
  saying "found <eof>" and point at the end of macro calls
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
2019-05-24 11:49:33 -07:00
Santiago Pastorino
10fe26962c Make ignore_borrow iterate instead of recurse 2019-05-24 19:43:42 +02:00
Santiago Pastorino
9613779855 Make borrow_of_local_data iterate instead of recurse 2019-05-24 18:42:04 +02:00
Erin
aba152d14c
Updated my mailmap entry 2019-05-24 18:32:22 +02:00
Santiago Pastorino
03dc30d3d5 Make sanitize_place iterate instead of recurse 2019-05-24 18:31:11 +02:00
Santiago Pastorino
34314caea3 Make find iterate instead of recurse 2019-05-24 18:16:55 +02:00
Ralf Jung
a90cdcca7e this is for tidy 2019-05-24 16:44:52 +02:00
Ralf Jung
d01ef7d918 improve debug-printing of scalars
Before: Immediate(ScalarMaybeUndef(Scalar(Ptr(Pointer { alloc_id: AllocId(3401), offset: Size { raw: 4 }, tag: Tagged(7723) }))))
After: Immediate(Scalar(AllocId(3401).0x4[<7723>]))

Before: Immediate(ScalarMaybeUndef(Scalar(Bits { size: 8, bits: 10 })))
After: Immediate(Scalar(0x000000000000000A))

Before: Immediate(ScalarMaybeUndef(Scalar(Bits { size: 1, bits: 1 })))
After: Immediate(Scalar(0x01))
2019-05-24 16:11:50 +02:00
Felix S. Klock II
c235ba4d0b Regression test for issue #60654. 2019-05-24 15:15:55 +02:00
Edd Barrett
123a456a4f Make place projections concrete.
Once upon a time (commit 9bd35c07c2) there were two kinds of
projection: one for places, and one for constants. It therefore made
sense to share the `Projection` struct for both. Although the different
use-cases used different concrete types, sharing was made possible by
type-parameterisation of `Projection`.

Since then, however, the usage of projections in constants has
disappeared, meaning that (forgetting lifetimes for a moment) the
parameterised type is only every instantiated under one guise. So it may
as well be a concrete type.
2019-05-24 14:14:36 +01:00
bors
fc45382c12 Auto merge of #60568 - petrochenkov:debi, r=Mark-Simulacrum
rustbuild: Simplify debuginfo configuration

This is supposed to fix https://github.com/rust-lang/rust/issues/52179

This PR introduces one option `debuginfo-level` replacing `debuginfo` and `debuginfo-lines` and corresponding to the `rustc` flag `-C debuginfo=N`.

`debuginfo-level` serves as a default for all Rust code built during bootstrap, but it can be overridden for specific subsets of code using finer-grained options `debuginfo-level-{rustc,std,tools,tests}` replacing `debuginfo-only-std`, `debuginfo-tools` and `debuginfo-tests`.
2019-05-24 12:51:50 +00:00
Felix S. Klock II
8e4132a55c Delay ICE in early_free_scope so feature gate has chance to stop compilation cleanly. 2019-05-24 14:02:41 +02:00
Felix S. Klock II
698e50f985 Delay ICE in fold_region so feature gate has chance to stop compilation cleanly. 2019-05-24 14:02:19 +02:00
Nicholas Nethercote
e396f99255 Don't arena-allocate static symbols.
It's just a waste of memory. This also gets rid of the special case for
"".
2019-05-24 20:11:52 +10:00
Vadim Petrochenkov
780e406db2 Address review comments 2019-05-24 13:01:23 +03:00
Vadim Petrochenkov
763470dc13 rustbuild: Untie debuginfo-level-tests from debuginfo-level 2019-05-24 13:01:05 +03: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
Vadim Petrochenkov
3da7bbc6da ci: Enable debuginfo for std only if release channel is set 2019-05-24 11:49:30 +03:00
Vadim Petrochenkov
28405cabd5 rustbuild: Simplify debuginfo configuration 2019-05-24 11:49:30 +03:00
Pietro Albini
2244ca3973
ci: fix invalid syntax in the azure auto.yml 2019-05-24 10:33:14 +02:00
Simon Sapin
73fd3497d4 Deprecate FnBox. Box<dyn FnOnce()> can be called directly, since 1.35
FCP completion: https://github.com/rust-lang/rust/issues/28796#issuecomment-439731515
2019-05-24 09:11:04 +02:00
Scott McMurray
67ee2862ad Remove the incorrect warning from README.md
My problem was user error; thanks to @Zoxc for fixing me!

r? @alexcrichton
2019-05-23 23:40:07 -07:00
Simon Sapin
a8fc09be39 Use FnOnce instead of FnBox in libtest 2019-05-24 07:51:48 +02:00
Cerberuser
9be8b7edc9
Fixed type-alias-bounds lint doc
The example code under type-alias-bounds lint produced two warnings - one from the lint itself and another from the dead_code lint, and only the second one was in the doc. This looked like an error, so I've added `#[allow(dead_code)]` and replaced the example output with the expected one.
[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&code=%23%5Ballow(dead_code)%5D%0Atype%20SendVec%3CT%3A%20Send%3E%20%3D%20Vec%3CT%3E%3B)
2019-05-24 12:09:33 +07:00
Eric Huss
fbc6a4b9f0 Revert edition-guide toolstate override 2019-05-23 21:21:13 -07: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
Brent Kerby
0123fab873 Fix typo "spit_paths", add link 2019-05-23 19:38:23 -06:00
Brent Kerby
d3c73ddec9 typo 2019-05-23 19:36:06 -06: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
Brent Kerby
27c75372f1 Remove phrase "instead of a panic!" 2019-05-23 17:34:10 -06: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
Eric Huss
46ffb6adba tidy: don't short-circuit on license error
If there is more than one license error, tidy would only print the first
error. This changes it so that all license errors are printed.
2019-05-23 13:33:08 -07:00
Eric Huss
d5e03530f7 Update cargo 2019-05-23 13:27:49 -07:00
Santiago Pastorino
2e39b9c51f Make find_local iterate instead of recurse 2019-05-23 22:17:45 +02:00
Esteban Küber
7fbbcfaafd Add regression test for negative case 2019-05-23 10:32:01 -07:00