Commit Graph

66107 Commits

Author SHA1 Message Date
Ralf Jung
a8129d128c add a closure inside an unsafe fn to the tests 2017-08-01 13:14:32 -07:00
Ralf Jung
c5154d036d use FnLike to recognize functions for us 2017-08-01 13:07:45 -07:00
Ralf Jung
8f910bcbbc handle trait items as well 2017-08-01 09:22:58 -07:00
Ralf Jung
4310edb4cb handle tuple struct ctors 2017-08-01 08:48:28 -07:00
Ralf Jung
584d823bf2 Handle closures. Add some more tests. 2017-07-31 20:00:20 -07:00
Ralf Jung
e73d3145f5 fix AddValidation on methods 2017-07-31 18:33:45 -07:00
Ralf Jung
26ca0d1b3a tidy 2017-07-31 16:15:37 -07:00
Ralf Jung
09cbe588c3 more readable printing of validation operands 2017-07-31 15:59:29 -07:00
Ralf Jung
5e426e1068 optionally only emit basic validation for functions containing unsafe block / unsafe function 2017-07-31 15:46:36 -07:00
Ralf Jung
6135461f9a CleanEndRegions: use default impl where possible 2017-07-31 13:21:10 -07:00
Ralf Jung
6ff7c8fa04 more documentation 2017-07-31 13:20:37 -07:00
Ralf Jung
6641415e87 do not use doc comments inside functions 2017-07-30 10:29:15 -07:00
Ralf Jung
29ed317ecb silence tidy 2017-07-30 01:11:59 -07:00
Ralf Jung
57958d1a04 Add tests for emitting validation statements 2017-07-30 01:11:59 -07:00
Ralf Jung
7ec50dfee3 also release/validate around non-Misc casts 2017-07-30 01:11:59 -07:00
Ralf Jung
b934506e68 Reorder passes so that AddValidation can run after ElaborateDrops 2017-07-30 01:11:59 -07:00
Ralf Jung
04f962adc3 after a Ref, only acquire the Deref'd destination 2017-07-30 01:11:59 -07:00
Ralf Jung
b6816b2b56 please the tidy 2017-07-30 01:11:59 -07:00
Ralf Jung
23cd90ed41 add -Z flag for AddValidation pass 2017-07-30 01:11:59 -07:00
Ralf Jung
e869cf2be7 make ValidationOperand generic so that we can reuse it in miri with a different Lvalue type 2017-07-30 01:11:59 -07:00
Ralf Jung
60096b9e82 when suspending, we need to specify for which lifetime to recover
This matters if the lvalues that is suspended involves Deref'ing a reference --
that reference's lifetime will then not be in the type any more
2017-07-30 01:11:59 -07:00
Ralf Jung
a233afa794 respect lifetime rendering when rendering Suspend validation op 2017-07-30 01:11:59 -07:00
Ralf Jung
511b88cdce only emit Suspend validation for mutable paths 2017-07-30 01:11:59 -07:00
Ralf Jung
24a2ac9e46 add_validation: handle drop 2017-07-30 01:11:59 -07:00
Ralf Jung
82786b2fe1 emit validation for function calls and Ref 2017-07-30 01:11:59 -07:00
Ralf Jung
33585f4fe1 CleanEndRegions: do not clean regions that occur in types in validation statements 2017-07-30 01:11:59 -07:00
Ralf Jung
735ace977c add a pass for validation commands; for now just emit the initial AcquireValid 2017-07-30 01:11:59 -07:00
Ralf Jung
5264103de4 add new instructions for asserting when values are valid, and to describe when we can rely on them being locked in memory 2017-07-30 01:11:59 -07:00
bors
5c71e4ef90 Auto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 8 pull requests

- Successful merges: #43409, #43501, #43509, #43512, #43513, #43536, #43544, #43549
- Failed merges:
2017-07-30 01:40:11 +00:00
Mark Simulacrum
16c3fd9f3d Rollup merge of #43549 - alexcrichton:build-llvm, r=Mark-Simulacrum
rustbuild: Enable building LLVM

I use this from time to time debugging LLVM builds, useful to have!
2017-07-29 18:03:58 -06:00
Mark Simulacrum
de5c5251f8 Rollup merge of #43544 - redox-os:update_redox_sys, r=sfackler
Update redox sys

- Add JoinHandleExt
- Split FL and FD for fcntl
2017-07-29 18:03:57 -06:00
Mark Simulacrum
e5116b661a Rollup merge of #43536 - alexcrichton:privileged, r=TimNN
Flag docker invocations as --privileged on CI

When upgrading to LLVM 5.0 it was found that the leak sanitizer tests were
failing with fatal errors, but they were passing locally when run. Turns out it
looks like they may be using new ptrace-like syscalls so the docker container
now needs `--privileged` when executing to complete the test.
2017-07-29 18:03:56 -06:00
Mark Simulacrum
a3eadd767e Rollup merge of #43513 - alexcrichton:inline-repeat, r=BurntSushi
std: Mark `Layout::repeat` as `#[inline]`

This fixes an optimization regression by allowing LLVM to see through more
functions.

Closes #43272
2017-07-29 18:03:55 -06:00
Mark Simulacrum
5b85f650cf Rollup merge of #43512 - arielb1:untyped-move-paths, r=eddyb
erase types in the move-path abstract domain

Leaving types unerased would lead to 2 types with a different "name"
getting different move-paths, which would cause major brokenness (see
e.g. #42903).

This does not fix any *known* issue, but is required if we want to use
abs_domain with non-erased regions (because the same can easily
have different names). cc @RalfJung.

r? @eddyb
2017-07-29 18:03:54 -06:00
Mark Simulacrum
4122b6bd5b Rollup merge of #43509 - QuietMisdreavus:method-src, r=GuillaumeGomez
rustdoc: add [src] links to associated functions inside an impl block

While impl blocks currently have a `[src]` link to show the source for the impl block as a whole, individual methods inside that impl block do not. This can pose a problem for structs with a lot of methods, like many in libstd. This change adds little `[src]` links to individual methods that point directly to the function in the bundled source.

fixes #12932

![methods on HashMap, showing the new src links](https://user-images.githubusercontent.com/5217170/28686066-9e7a19de-72cf-11e7-8e6b-b7d60fa33032.png)
2017-07-29 18:03:53 -06:00
Mark Simulacrum
e61e73fcc4 Rollup merge of #43501 - topecongiro:span-to-whereclause, r=nrc
Add Span to ast::WhereClause

This PR adds `Span` field to `ast::WhereClause`. The motivation here is to make rustfmt's life easier when recovering comments before and after where clause.
r? @nrc
2017-07-29 18:03:52 -06:00
Mark Simulacrum
f205f48a00 Rollup merge of #43409 - tshepang:concise, r=steveklabnik
doc: make into_iter example more concise

Also, remove dupe example
2017-07-29 18:03:51 -06:00
bors
53bf7903fa Auto merge of #43009 - GuillaumeGomez:unused-doc-comments, r=nrc
Throw errors when doc comments are added where they're unused

#42617
2017-07-29 23:01:45 +00:00
Guillaume Gomez
3142ca0a65 Update rls submodule 2017-07-29 22:52:18 +02:00
Alex Crichton
b121689c6a Flag docker invocations as --privileged on CI
When upgrading to LLVM 5.0 it was found that the leak sanitizer tests were
failing with fatal errors, but they were passing locally when run. Turns out it
looks like they may be using new ptrace-like syscalls so the docker container
now needs `--privileged` when executing to complete the test.
2017-07-29 13:44:28 -07:00
Alex Crichton
ad1f19479c rustbuild: Enable building LLVM
I use this from time to time debugging LLVM builds, useful to have!
2017-07-29 13:39:43 -07:00
bors
cfe1668ca3 Auto merge of #43541 - gaurikholkar:lifetime_errors, r=nikomatsakis
Changing E0623 error message - both anonymous lifetime regions

Changing the error message to
```
error[E0623]: lifetime mismatch
  --> $DIR/ex3-both-anon-regions.rs:12:12
   |
11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
   |                    ---      --- these references are not declared with the same lifetime...
12 |     x.push(y);
   |            ^ ...but data from `y` flows into `x` here

error: aborting due to previous error
```
cc @nikomatsakis @aturon @jonathandturner

r? @nikomatsakis
2017-07-29 19:41:53 +00:00
Alex Crichton
54b6b23fc0 std: Mark Layout::repeat as #[inline]
This fixes an optimization regression by allowing LLVM to see through more
functions.

Closes #43272
2017-07-29 09:03:06 -07:00
Jeremy Soller
a30092fbf6 Split FL and FD fcntls 2017-07-29 09:31:18 -06:00
Ian Douglas Scott
c83f97533a Redox: Add JoinHandleExt (matching Unix version) 2017-07-29 09:31:18 -06:00
Guillaume Gomez
5636d325ed Update cargo version 2017-07-29 15:11:31 +02:00
bors
ad36f8feba Auto merge of #43534 - alexcrichton:cargo-target-runner, r=Mark-Simulacrum
rustbuild: Use Cargo's "target runner"

This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.
2017-07-29 12:30:12 +00:00
gaurikholkar
cb93cc6299 changing E0623 error message 2017-07-29 17:40:16 +05:30
bors
91aff5775d Auto merge of #43530 - alexcrichton:update-freebsd-compilers, r=Mark-Simulacrum,cuviper
rustbuild: Update cross-compilers for FreeBSD

When working through bugs for the LLVM 5.0 upgrade it looks like the FreeBSD
cross compilers we're currently using are unable to build LLVM, failing with
references to the function `std::to_string` claiming it doesn't exist. I don't
actually know what this function is, but assuming that it was added in a more
recent version of a C++ standard I've updated the gcc versions for the
toolchains we're using. This made the error go away!
2017-07-29 08:48:57 +00:00
bors
8d0ad26b95 Auto merge of #43527 - alexcrichton:different-llvm-cross, r=Mark-Simulacrum
rustbuild: Tweak how we cross-compile LLVM

In preparation for upgrading to LLVM 5.0 it looks like we need to tweak how we
cross compile LLVM slightly. It's using `CMAKE_SYSTEM_NAME` to infer whether to
build libFuzzer which only works on some platforms, and then once we configure
that it needs to apparently reach into the host build area to try to compile
`llvm-config` as well. Once these are both configured, though, it looks like we
can successfully cross-compile LLVM.
2017-07-29 06:13:55 +00:00