Commit Graph

84620 Commits

Author SHA1 Message Date
Matthew Jasper
55ec104313 Use the span of the user type for AscribeUserType
Also change the order of the fake read for let and the AscribeUserType,
so that we use the better span and message from the fake read in errors.
2018-10-10 11:56:16 +01:00
Ralf Jung
bc9435d239 tidy up 2018-10-10 11:31:31 +02:00
Ralf Jung
a332387b87 add a macro for static assertions 2018-10-10 11:03:58 +02:00
ljedrz
a01a994231 A handful of random string-related improvements 2018-10-10 10:39:18 +02:00
Ralf Jung
9a9dbfff6e vtables are not leaks 2018-10-10 10:11:35 +02:00
Ralf Jung
3fb617d0c5 more comments for these sublte games we are playing with allocations in the miri engine 2018-10-10 10:11:35 +02:00
Kazuyoshi Kato
da17e07c14 "(using ..." doesn't have the matching ")"
Fixes #54948.
2018-10-10 01:09:18 -07:00
Ralf Jung
83667d64a2 abstract mono_hash_map through a trait, only miri actually needs the fancy one 2018-10-10 10:08:17 +02:00
Ralf Jung
75ea7c7fc2 typos and spaces 2018-10-10 09:58:17 +02:00
Ralf Jung
03545109f4 clarify alloc_map description 2018-10-10 09:58:17 +02:00
Ralf Jung
e0b17ad26c fix typos 2018-10-10 09:58:17 +02:00
Ralf Jung
d4b21f1ed3 expand safety comment in memory.rs 2018-10-10 09:58:17 +02:00
Ralf Jung
397283dbc3 rename extra -> meta in place 2018-10-10 09:58:17 +02:00
Ralf Jung
50c00a9301 expand comment 2018-10-10 09:51:16 +02:00
Ralf Jung
f3a39e38f6 tidy, oh tidy 2018-10-10 09:51:16 +02:00
Ralf Jung
4e9f9329e3 miri engine: basic support for pointer provenance tracking 2018-10-10 09:50:06 +02:00
Ralf Jung
e4434be6b7 remove a now outdated comment 2018-10-10 09:16:05 +02:00
bors
71d3a71572 Auto merge of #54831 - davidtwco:issue-52663-struct-field-suggestion, r=nikomatsakis
NLL is missing struct field suggestion

Part of #52663.

This commit adds suggestions to change the definitions of fields in
struct definitions from immutable references to mutable references.

r? @nikomatsakis
cc @pnkfelix
2018-10-10 06:36:11 +00:00
Alex Crichton
c1f7e922e6 std: Synchronize global allocator on wasm32
We originally didn't have threads, and now we're starting to add them!
Make sure we properly synchronize access to dlmalloc when the `atomics`
feature is enabled for `wasm32-unknown-unknown`.
2018-10-09 23:35:45 -07:00
bors
4623d48893 Auto merge of #54764 - tromey:test-rust-lldb, r=alexcrichton
Run debuginfo tests against rust-enabled lldb, when possible

If the rust-enabled lldb was built, then use it when running the
debuginfo tests.  Updating the lldb submodule was necessary as this
needed a way to differentiate the rust-enabled lldb, so I added a line
to the --version output.

This adds compiletest commands to differentiate between the
rust-enabled and non-rust-enabled lldb, as is already done for gdb.  A
new "rust-lldb" header directive is also added, but not used in this
patch; I plan to use it in #54004.

This updates all the tests.
2018-10-10 02:08:23 +00:00
flip1995
ffe15277ff Remove nightly check for tool_lints warning 2018-10-09 16:38:38 -07:00
flip1995
6328850e6d Remove unstable-book documentation 2018-10-09 16:38:38 -07:00
flip1995
ac231d40a3 Remove feature-gate code 2018-10-09 16:38:38 -07:00
flip1995
a249981a43 Remove feature-gate tests 2018-10-09 16:38:38 -07:00
flip1995
5e9084ccc3 Remove feature(tool_lints) from tests 2018-10-09 16:38:38 -07:00
flip1995
dc2343c1a8 Update feature-gate listing 2018-10-09 16:38:34 -07:00
Esteban Küber
57f10c7911 Point to variable in asm! macro when failing borrowck 2018-10-09 15:53:37 -07:00
bors
eae47a4048 Auto merge of #54734 - pawroman:fix_range_borrowing_suggestion, r=varkor
Fix range literals borrowing suggestions

Fixes #54505. The compiler issued incorrect range borrowing suggestions (missing `()` around borrows of range literals). This was not correct syntax (see the issue for an example).

With changes in this PR, this is fixed for all types of `Range` literals.

Thanks again to @varkor and @estebank for their invaluable help and guidance.

r? @varkor
2018-10-09 22:36:14 +00:00
bors
96cafc53cf Auto merge of #54613 - matthiaskrgr:string_from_inline_53681, r=nagisa
liballoc: mark str.to_owned() and String::from(&str) as #[inline].

Fixes #53681
2018-10-09 19:57:55 +00:00
bors
0e07c4281c Auto merge of #54762 - RalfJung:miri-validate, r=oli-obk
Prepare miri engine for enforcing validity invariant during execution

In particular, make recursive checking of references optional, and add a `const_mode` parameter that says whether `usize` is allowed to contain a pointer. Also refactor validation a bit to be type-driven at the "leafs" (primitive types), and separately validate scalar layout to catch `NonNull` violations (which it did not properly validate before).

Fixes https://github.com/rust-lang/rust/issues/53826
Also fixes https://github.com/rust-lang/rust/issues/54751

r? @oli-obk
2018-10-09 17:19:56 +00:00
Ralf Jung
fe96f8235c validity: check dynamic size, not static
also less verbose logging
2018-10-09 13:08:00 +02:00
Ralf Jung
976880aa84 dont fail when validating non-local closures 2018-10-09 13:08:00 +02:00
Ralf Jung
6899af82fd box is also a primitive type 2018-10-09 13:08:00 +02:00
Ralf Jung
db1663d598 update miri 2018-10-09 13:08:00 +02:00
Ralf Jung
fcf6b5c79b add fixme for potential perf optimization 2018-10-09 13:08:00 +02:00
Ralf Jung
e09e3c898c fix nits and handling of extern static 2018-10-09 13:08:00 +02:00
Ralf Jung
322017b2bc unify handling of thin and fat pointers by moving primitive type handling out of aggregate handling
Also, make enum variant handling a bit nicer
2018-10-09 13:08:00 +02:00
Ralf Jung
95593331bf add some tests with constants that better be valid 2018-10-09 13:08:00 +02:00
Ralf Jung
22c1a0acc8 For now, accept all data for integer types when not in const mode
We'll try ruling out undef later
2018-10-09 13:08:00 +02:00
Ralf Jung
9bb4bcd770 tidy up 2018-10-09 13:08:00 +02:00
Ralf Jung
654d9ff618 do not look at refs to external statics at all 2018-10-09 13:08:00 +02:00
Ralf Jung
616cb6356f miri engine: also check return type before calling function 2018-10-09 13:08:00 +02:00
Ralf Jung
d2b9b1de05 add machine option to validate things on every copy 2018-10-09 13:08:00 +02:00
Ralf Jung
13bdc1673d move a test to a better place 2018-10-09 13:08:00 +02:00
Ralf Jung
69a320f40d also validate everything that has a Scalar layout, to catch NonNull 2018-10-09 13:08:00 +02:00
Ralf Jung
0a2fae6cb7 fix validating arrays of ZSTs
Fixes #54751
2018-10-09 13:08:00 +02:00
Ralf Jung
f65d3b5491 switch validation of scalars to be type-driven
This does not actually regress anything.  It would regress NonNull, but we
didn't handle that correctly previously either.
2018-10-09 13:08:00 +02:00
Ralf Jung
ff5a245f52 check that entire ref is in-bounds before recursing; add macro for validation msgs on error 2018-10-09 13:08:00 +02:00
Ralf Jung
bf5e6ebdd3 miri validity: make recursive ref checking optional 2018-10-09 13:08:00 +02:00
David Wood
98633b458b
Improve message for closure returning a closure.
Now when a `FnMut` closure is returning a closure that contains a
reference to a captured variable, we provide an error that makes it more
clear what is happening.
2018-10-09 12:31:51 +02:00