Commit Graph

67965 Commits

Author SHA1 Message Date
Vadim Petrochenkov
419069d984 Use recorded types in rustc_privacy 2017-09-23 00:50:46 +03:00
Vadim Petrochenkov
505ff71ac1 Record semantic types for all syntactic types in bodies 2017-09-23 00:48:02 +03:00
Vadim Petrochenkov
5b9b50e712 Give HirId to hir::Ty 2017-09-23 00:48:02 +03:00
Niko Matsakis
9276b8b9b8 expand text, make link to forge more prominent 2017-09-22 16:27:55 -04:00
Santiago Pastorino
84dfade3cc Link to Rust forge from CONTRIBUTING.md 2017-09-22 17:16:03 -03:00
bors
14039a42ac Auto merge of #44696 - michaelwoerister:fingerprints-in-dep-graph-3, r=nikomatsakis
incr.comp.: Move task result fingerprinting into DepGraph.

This PR
- makes the DepGraph store all `Fingerprints` of task results,
- allows `DepNode` to be marked as input nodes,
- makes HIR node hashing use the regular fingerprinting infrastructure,
- removes the now unused `IncrementalHashesMap`, and
- makes sure that `traits_in_scope_map` fingerprints are stable.

r? @nikomatsakis
cc @alexcrichton
2017-09-22 17:24:29 +00:00
bors
3eb19bf9b1 Auto merge of #44691 - cramertj:underscore-lifetimes, r=nikomatsakis
Implement underscore lifetimes

Part of https://github.com/rust-lang/rust/issues/44524
2017-09-22 14:05:16 +00:00
Guillaume Gomez
b472b2829b Add missing links for Arc 2017-09-22 15:45:37 +02:00
bors
ee409a489e Auto merge of #44624 - tmerr:master, r=sfackler
Retain suid/sgid/sticky bits in Metadata.permissions

Most users would expect set_permissions(Metadata.permissions()) to be
non-destructive. While we can't guarantee this, we can at least pass
the needed info to chmod.

Also update the PermissionsExt documentation to disambiguate what it
contains, and to refer to the underlying value as `st_mode` rather than
its type `mode_t`.

Closes #44147
2017-09-22 10:30:20 +00:00
bors
0962b8fe4f Auto merge of #44754 - marcusbuffett:bootstrap-config-toml-fix, r=alexcrichton
Catch IOError in bootstrap.py when loading config.toml

When I pulled this repo and tried to build using the command in the readme, I got an error about a missing `config.toml`.

If config.toml doesn't exist, then an `IOError` will be raised the `with open(...)` line. Prior to e788fa7b6c, this was caught because the `except` clause didn't specify what exceptions it caught, so both `IOError` and `OSError` were caught.

First time contributing, so please let me know if I'm doing anything wrong.
2017-09-22 05:01:41 +00:00
David Tolnay
f9d92d219d
Less confusing placeholder when RefCell is exclusively borrowed
Based on ExpHP's comment in
https://users.rust-lang.org/t/refcell-borrow-mut-get-strange-result/12994

> it would perhaps be nicer if it didn't put something that could be
> misinterpreted as a valid string value

The previous Debug implementation would show:

    RefCell { value: "<borrowed>" }

The new one is:

    RefCell { value: <borrowed> }
2017-09-21 21:53:04 -07:00
Zack M. Davis
083f053294 suggest an outer attribute when #![derive(...)] (predictably) fails 2017-09-21 21:20:31 -07:00
Zack M. Davis
35176867f6 only set non-ADT derive error once per attribute, not per trait
A slight eccentricity of this change is that now non-ADT-derive errors prevent
derive-macro-not-found errors from surfacing (see changes to the
gating-of-derive compile-fail tests).

Resolves #43927.
2017-09-21 21:20:23 -07:00
Tamir Duberstein
5c82a5434b
Trim and document libc shim 2017-09-21 22:25:02 -04:00
Corey Farwell
859ebef62f Add note about being blocked on input. 2017-09-21 21:11:11 -04:00
Corey Farwell
5ee7db6a0e Remove platform-specific terminology. 2017-09-21 21:01:51 -04:00
bors
17600c1ea7 Auto merge of #44682 - bluss:iter-rfold, r=dtolnay
Add iterator method .rfold(init, function); the reverse of fold

rfold is the reverse version of fold.

Fold allows iterators to implement a different (non-resumable) internal
iteration when it is more efficient than the external iteration implemented
through the next method. (Common examples are VecDeque and .chain()).

Introduce rfold() so that the same customization is available for reverse
iteration. This is achieved by both adding the method, and by having the
Rev\<I> adaptor connect Rev::rfold → I::fold and Rev::fold → I::rfold.

On the surface, rfold(..) is just .rev().fold(..), but the special case
implementations allow a data structure specific fold to be used through for
example .iter().rev(); we thus have gains even for users never calling exactly
rfold themselves.
2017-09-21 23:44:11 +00:00
Guillaume Gomez
c30435be5b Add deref suggestion 2017-09-21 23:30:00 +02:00
Alex Burka
cf2bad8d4b improve english in create_dir_all docs 2017-09-21 16:31:39 -04:00
bors
17f56c549c Auto merge of #44215 - oli-obk:import_sugg, r=nrc
don't suggest placing `use` statements into expanded code

r? @nrc

fixes #44210

```rust
#[derive(Debug)]
struct Foo;

type X = Path;
```

will try to place `use std::path::Path;` between `#[derive(Debug)]` and `struct Foo;`

I am not sure how to obtain a span before the first attribute, because derive attributes are removed during expansion.

It would be trivial to detect this case and place the `use` after the item, but that would be somewhat weird I think.
2017-09-21 20:12:22 +00:00
Marcus Buffett
5463aa06b8 Catch IOError
If config.toml doesn't exist, then an IOError will be raised
on the `with open(...)` line. Prior to e788fa7, this was
caught because the `except` clause didn't specify what
exceptions it caught, so both IOError and OSError were
caught
2017-09-21 12:15:10 -07:00
John Kåre Alsaker
f5affb5951 Make the fallback of generator resumption be unreachable instead of using return 2017-09-21 19:31:26 +02:00
Taylor Cramer
f5505d185c Add tests for underscore lifetimes in impl headers and struct definitions 2017-09-21 10:19:12 -07:00
Taylor Cramer
06926b6298 Add tests for multiple underscore and non-underscore lifetimes 2017-09-21 10:19:12 -07:00
Taylor Cramer
f64af7a32e Refactor lifetime name into an enum 2017-09-21 10:19:03 -07:00
Seiichi Uchida
ded73a85e2 Include unary operator to span for ExprKind::Unary 2017-09-22 01:19:34 +09:00
Alex Crichton
50534425e5 rustc: Don't use DelimToken::None if possible
This commit fixes a regression from #44601 where lowering attribute to HIR now
involves expanding interpolated tokens to their actual tokens. In that commit
all interpolated tokens were surrounded with a `DelimToken::None` group of
tokens, but this ended up causing regressions like #44730 where the various
attribute parsers in `syntax/attr.rs` weren't ready to cope with
`DelimToken::None`. Instead of fixing the parser in `attr.rs` this commit
instead opts to just avoid the `DelimToken::None` in the first place, ensuring
that the token stream should look the same as it did before where possible.

Closes #44730
2017-09-21 08:13:25 -07:00
Basile Desloges
8c1b958cf7 mir-borrowck: Add FIXME comment to report name of field instead of index at a later date 2017-09-21 16:42:30 +02:00
Basile Desloges
e84581192d mir-borrowck: Add span labels to report_use_while_mutably_borrowed() 2017-09-21 16:42:30 +02:00
Basile Desloges
86a7347fa1 mir-borrowck: Add borrow data parameter to report_use_while_mutably_borrowed() 2017-09-21 16:42:30 +02:00
Basile Desloges
70ef08f213 mir-borrowck: Add method to MIR borrowck context to retrieve the span of a given borrow 2017-09-21 16:42:30 +02:00
bors
1b55d19479 Auto merge of #44679 - oli-obk:clippy_ci, r=alexcrichton
Add clippy to `toolstate.toml`

r? @alexcrichton

cc @Manishearth

I have no idea how to get clippy working... it needs proc macros, and I think I did everything right (I just did what the cargo step is doing), but it's not working:

```
error: libproc_macro-6210e4b46662ec28.so: cannot open shared object file: No such file or directory
  --> src/tools/clippy/clippy_lints/src/lib.rs:47:1
   |
47 | extern crate serde_derive;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: libproc_macro-6210e4b46662ec28.so: cannot open shared object file: No such file or directory
  --> src/tools/clippy/clippy_lints/src/lib.rs:47:1
   |
47 | extern crate serde_derive;
   | ^
```

It's especially weird since it used to work

Anyway. Fixing it can be left for a future PR, this one adds it to CI, but marks it as "broken"
2017-09-21 13:33:58 +00:00
bors
35edf7d8cb Auto merge of #44627 - zackmdavis:the_capgate_perogative, r=nrc
`--cap-lints allow` switches off `can_emit_warnings`

This boolean field on the error `Handler` is toggled to silence
warnings when `-A warnings` is passed. (This is actually a separate
mechanism from the global lint level—whether there's some redundancy
to be factored away here is an important question, but not one we
concern ourselves with in this commit.)  But the same rationale
applies for `--cap-lints allow`. In particular, this makes the "soft"
feature-gate warning introduced in 8492ad24 (which is not a lint, but
just calls `struct_span_warn`) not pollute the builds of dependent
crates.

Thanks to @kennytm for pointing out the potential of
`can_emit_warnings` for this purpose.

Resolves #44213.
2017-09-21 09:41:26 +00:00
Taylor Cramer
64314e3ae2 Implement underscore lifetimes 2017-09-20 23:45:05 -07:00
Havvy
548686ff12 Document stable size_of primitives and pointer size guarantees 2017-09-20 21:11:03 -07:00
bors
e2504cfc76 Auto merge of #44551 - scalexm:copy-clone-closures, r=arielb1
Implement `Copy`/`Clone` for closures

Implement RFC [#2132](https://github.com/rust-lang/rfcs/pull/2132) (tracking issue: #44490).

NB: I'm not totally sure about the whole feature gates thing, that's my first PR of this kind...
2017-09-21 00:35:33 +00:00
bors
870483a57f Auto merge of #44392 - Zoxc:yield-order, r=nikomatsakis
Only consider yields coming after the expressions when computing generator interiors

When looking at the scopes which temporaries of expressions can live for during computation of generator interiors, only consider yields which appear after the expression in question in the HIR.
2017-09-20 21:26:15 +00:00
Matt Ickstadt
5bafba4759 Fix librusc/README.md diagram 2017-09-20 14:08:30 -05:00
scalexm
3fa3fe01b6 Fix ICE 2017-09-20 20:48:06 +02:00
scalexm
f7964aebe5 Implement Copy/Clone for closures 2017-09-20 20:43:41 +02:00
est31
913007be28 Use SHA512 for signatures 2017-09-20 17:25:56 +02:00
bors
01c65cb15a Auto merge of #44525 - aidanhs:aphs-no-null-deref, r=alexcrichton
Correctly bubble up errors from libbacktrace

Previously the first part of this code didn't check for a null pointer and blindly passed it back down, causing a segfault if libbacktrace failed to initialise. I've changed this to check and bubble up the error if relevant.

Suggested diff view: https://github.com/rust-lang/rust/pull/44525/files?w=1
2017-09-20 14:50:31 +00:00
Ariel Ben-Yehuda
2384dd92dc rebase fixup 2017-09-20 17:28:49 +03:00
Ariel Ben-Yehuda
018525ea70 address review comments 2017-09-20 16:49:21 +03:00
Ariel Ben-Yehuda
5c0feb86b9 add proofs and fix postorder traversal
I don't think the "quasi-postorder" travesal could cause any issues, but
there's no reason for it to stay broken.
2017-09-20 16:36:24 +03:00
John Kåre Alsaker
0bb3dc19bf Mark yields after visiting subexpressions. Never ignore yields for scopes in bindings. 2017-09-20 16:36:24 +03:00
John Kåre Alsaker
0bf7b55158 Remove debug statements 2017-09-20 16:36:24 +03:00
John Kåre Alsaker
dba2ca888a Sanity check the Expr visitation count 2017-09-20 16:36:24 +03:00
John Kåre Alsaker
3a511e06a5 Only consider yields coming after the expressions when computing generator interiors 2017-09-20 16:36:24 +03:00
John Kåre Alsaker
1e6ec9f33a Fix HIR printing of yield 2017-09-20 16:36:23 +03:00