Felix S. Klock II
9a76c9337a
Use default of preferring static over dynamic linking in rustdoc tests.
2018-10-09 23:05:20 +02: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
Guillaume Gomez
26479c4637
Add test for docs without examples
2018-10-09 17:55:12 +02:00
Guillaume Gomez
2def81a5f1
Store nightly build instead of checking env var every time
2018-10-09 16:47:14 +02:00
Guillaume Gomez
d6385631f4
Add lint for doc without codeblocks
2018-10-09 16:47:12 +02:00
ljedrz
fa81576023
codegen_llvm/misc: convert string literals with to_owned
2018-10-09 15:16:20 +02:00
ljedrz
b07a2d02ca
codegen_llvm/misc: improve common patterns
2018-10-09 15:15:41 +02:00
ljedrz
e90e8aaeba
codegen_llvm/misc: remove explicit returns
2018-10-09 15:14:38 +02:00
ljedrz
8efd9dd81b
codegen_llvm/misc: whitespace & formatting improvements
2018-10-09 15:13:11 +02: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
David Wood
c65e119229
Improve errors for FnMut
closures.
...
This commit improves the errors for `FnMut` closures where a reference
to a captured variable is escaping.
2018-10-09 12:31:47 +02:00
bors
e1643a8968
Auto merge of #54757 - nikomatsakis:nll-issue-54573-user-annot, r=pnkfelix
...
user annotations in patterns
Fixes https://github.com/rust-lang/rust/issues/54573
r? @pnkfelix
2018-10-09 10:15:44 +00:00
bors
607243b6f9
Auto merge of #54798 - matthewjasper:free-region-closure-errors, r=nikomatsakis
...
[NLL] Improve closure region bound errors
Previously, we would report free region errors that originate from closure with the span of the closure and a "closure body requires ..." message. This is now updated to use a reason and span from inside the closure.
2018-10-09 07:22:14 +00:00
Jorge Aparicio
faa733dd18
fix tidy
2018-10-09 08:58:02 +02:00
Jorge Aparicio
4d8310cef2
gdb_rust_pretty_printing: adapt to the changes in the layout of btree::LeafNode
2018-10-09 08:58:01 +02:00
Jorge Aparicio
6644e18e30
address RalfJung's comment
2018-10-09 08:58:01 +02:00
Jorge Aparicio
aeea992fa2
alloc: fix deprecated warnings
2018-10-09 08:58:01 +02:00
Paweł Romanowski
1f7dafbb77
Fix test for windows os
2018-10-09 08:24:29 +02:00
mandeep
1e584bf5c9
Refactor macro comment and add resize with zeros example
2018-10-09 01:51:22 -04:00
Matthew Russo
344747330c
parse_trait_item_ now handles interpolated blocks as function body decls
2018-10-08 22:50:34 -04:00
Niko Matsakis
ccba716099
add some debug!
to type checking
2018-10-08 19:21:22 -04:00
Niko Matsakis
16e1aaf09d
document create_substs_for_generic_args
2018-10-08 19:20:37 -04:00
Niko Matsakis
40ab41fd18
add pattern type ascriptions for tuple/brace structs/enums
2018-10-08 19:20:37 -04:00
Niko Matsakis
a609384561
do not skip renumbering the place in place-type-ascriptions
2018-10-08 19:20:37 -04:00
Niko Matsakis
71fed065f7
extract more helper fns around user substs
2018-10-08 19:20:37 -04:00
Niko Matsakis
f4b711516d
move user_annotated_ty_for_adt
into a helper trait
2018-10-08 19:20:37 -04:00
bors
b1a137d015
Auto merge of #54686 - zackmdavis:zero_life, r=nikomatsakis
...
structured suggestions for unused-lifetimes lint
Regretfully, resolve_lifetime.rs is suffering from a bit of rightward-drift, but
![zero_life](https://user-images.githubusercontent.com/1076988/46253407-010e7880-c430-11e8-8faf-b9afc1405415.png )
r? @nikomatsakis
2018-10-08 22:06:52 +00:00
varkor
be8896109a
Fix handling of #[must_use] on unit and uninhabited types
2018-10-08 23:01:42 +01:00
ljedrz
a0fc2e6ddc
codegen_llvm: remove explicit returns
2018-10-08 19:17:25 +02:00
ljedrz
b168e5f125
codegen_llvm: fix spelling & grammatical errors
2018-10-08 19:17:24 +02:00