Commit Graph

65938 Commits

Author SHA1 Message Date
Corey Farwell
57bc82d637 Rollup merge of #43228 - redox-os:backtrace_fix, r=alexcrichton
Fix backtrace on Redox

This fixes sys::backtrace on Redox
2017-07-14 20:57:18 -07:00
Corey Farwell
877e62e471 Rollup merge of #43222 - RalfJung:symlink, r=sfackler
windows::fs::symlink_dir: fix example to actually use symlink_dir

I don't have a windows machine, so I couldn't test if this doctest still works -- but it looks trivial enough. (I know, famous last words.)
2017-07-14 20:57:17 -07:00
Corey Farwell
351c476f6d Rollup merge of #43202 - jackpot51:patch-1, r=sfackler
Fix sys::redox::net::tcp

A change to the upper level API needed to be filtered down
2017-07-14 20:57:16 -07:00
Corey Farwell
721f736b1b Rollup merge of #43159 - cuviper:ptr-swap-simd, r=arielb1
Disable big-endian simd in swap_nonoverlapping_bytes

This is a workaround for #42778, which was git-bisected to #40454's
optimizations to `mem::swap`, later moved to `ptr` in #42819.  Natively
compiled rustc couldn't even compile stage1 libcore on powerpc64 and
s390x, but they work fine without this `repr(simd)`.  Since powerpc64le
works OK, it seems probably related to being big-endian.

The underlying problem is not yet known, but this at least makes those
architectures functional again in the meantime.

cc @arielb1
2017-07-14 20:57:15 -07:00
Corey Farwell
c3a8347349 Rollup merge of #43145 - GuillaumeGomez:build-error-if-nothing, r=Mark-Simulacrum
fail in case nothing to run was found

Fixes #43121.

r? @Mark-Simulacrum
2017-07-14 20:57:14 -07:00
Corey Farwell
e7a9f1b626 Rollup merge of #43074 - SimonSapin:iter, r=aturon
Forward more Iterator methods

This allows in more cases to take advantage of specific (possibly more optimized) impls of these methods, rather than the default one defined for all `Iterator`s.

I also wanted to do this for `&mut I` and `Box<I>`, but that didn’t compile for two reasons:

* To make the trait object-safe, generic methods (e.g. that take a closure parameter) have a `where Self: Sized` bound. But e.g. `Box<I>: Sized` does not imply `I: Sized`, and adding an additional bound in the impl is not allowed. Some for of specialization would be needed here.
* With e.g. a `F: FnMut(Self::Item) -> bool` bound and a `type Item = I::Item` associated types, I got errors like `F does not implement FnMut(I::Item) -> bool`. This looks like a limitation in the trait resolution system not recognizing that `Self::Item == I::Item` or "propagating" that fact to `FnMut` bounds.
2017-07-14 20:57:13 -07:00
est31
94fc09c68f Tidy: allow common lang+lib features
This allows changes to the Rust language that have both library
and language components share one feature gate.

The feature gates need to be "about the same change", so that both
library and language components must either be both unstable, or
both stable, and share the tracking issue.

Removes the ugly "proc_macro" exception.

Closes #43089
2017-07-15 05:53:58 +02:00
bors
b4502f7c0b Auto merge of #43184 - nikomatsakis:incr-comp-anonymize-trait-selection, r=michaelwoerister
integrate anon dep nodes into trait selection

Use anonymous nodes for trait selection. In all cases, we use the same basic "memoization" strategy:

- Store the `DepNodeIndex` in the slot along with value.
- If value is present, return it, and add a read of the dep-node-index.
- Else, start an anonymous task, and store resulting node.

We apply this strategy to a number of caches in trait selection:

- The "trans" caches of selection and projection
- The "evaluation" cache
- The "candidate selection" cache

In general, for our cache strategy to be "dep-correct", the computation of the value is permitted to rely on the *value in the key* but nothing else. The basic argument is this: in order to look something up, you have to produce the key, and to do that you must have whatever reads were needed to create the key. Then, you get whatever reads were further needed to produce the value. But if the "closure" that produced the value made use of *other* environmental data, not derivable from the key, that would be bad -- but that would **also** suggest that the cache is messed up (though it's not proof).

The structure of these caches do not obviously prove that the correctness criteria are met, and I aim to address that in further refactorings. But I *believe* it to be the case that, if we assume that the existing caches are correct, there are also no dependency failures (in other words, if there's a bug, it's a pre-existing one). Specifically:

- The trans caches: these take as input just a `tcx`, which is "by definition" not leaky, the `trait-ref` etc, which is part of the key, and sometimes a span (doesn't influence the result). So they seem fine.
- The evaluation cache:
    - This computation takes as input the "stack" and has access to the infcx.
    - The infcx is a problem -- would be better to take the tcx -- and this is exactly one of the things I plan to improve in later PRs. Let's ignore it for now. =)
    - The stack itself is also not great, in that the *key* only consists of the top-entry in the stack.
    - However, the stack can cause a problem in two ways:
        - overflow (we panic)
        - cycle check fails (we do not update the cache, I believe)
- The candidate selection cache:
    - as before, takes the "stack" and has access to the infcx.
    - here it is not as obvious that we avoid caching stack-dependent computations. However, to the extent that we do, this is a pre-existing bug, in that we are making cache entries we shouldn't.
    - I aim to resolve this by -- following the chalk-style of evaluation -- merging candidate selection and evaluation.
    - The infcx is a problem -- would be better to take the tcx -- and this is exactly one of the things I plan to improve in later PRs. Let's ignore it for now. =)
    - The stack itself is also not great, in that the *key* only consists of the top-entry in the stack.
    - Moreover, the stack would generally just introduce ambiguities and errors anyhow, so that lessens the risk.

Anyway, the existing approach to handle dependencies in the trait code carries the same risks or worse, so this seems like a strict improvement!

r? @michaelwoerister

cc @arielb1
2017-07-15 02:22:11 +00:00
bors
23ecebd6bd Auto merge of #43174 - RalfJung:refactor-ty, r=nikomatsakis
Refactor: {Lvalue,Rvalue,Operand}::ty only need the locals' types, not the full &Mir

I am writing code that needs to call these `ty` methods while mutating MIR -- which is impossible with the current API.

Even with the refactoring the situation is not great: I am cloning the `local_decls` and then passing the clone to the `ty` methods. I have to clone because `Mir::basic_blocks_mut` borrows the entire `Mir` including the `local_decls`. But even that is better than not being able to get these types at all...

Cc @nikomatsakis
2017-07-14 23:29:51 +00:00
William Brown
0af5c002a2 Add support for dylibs with Address Sanitizer. This supports cdylibs and staticlibs on gnu-linux targets. 2017-07-15 08:22:46 +10:00
Johannes Löthberg
ecf3f6d4de Make partial RELRO default on ppc64 due to segfault
On at least RHEL6 there is a segfault caused by the older ld.so version
when BIND_NOW is used, so use partial RELRO by default on ppc64
architectures for now.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-07-14 22:19:20 +02:00
Johannes Löthberg
94b9cc90fb Support both partial and full RELRO
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-07-14 22:01:37 +02:00
bors
6d9d82d3df Auto merge of #43180 - oli-obk:compiletest, r=alexcrichton
Reduce the usage of features in compiletest and libtest
2017-07-14 19:35:37 +00:00
Zack M. Davis
30ad6252a3 add u128/i128 to sum/product implementors
Resolves #43235.
2017-07-14 10:51:14 -07:00
steveklabnik
e760ba2fa1 Update the books. 2017-07-14 13:33:19 -04:00
bors
ae4803a750 Auto merge of #43175 - tlively:wasm-split-bots, r=alexcrichton
Split old and experimental wasm builders

#42784 introduced configuration errors in the wasm builder by mixing different versions of the tools. This PR separates the wasm32-unknown-emscripten and wasm32-experimental-emscripten builders to resolve these errors.
2017-07-14 13:14:18 +00:00
bors
20f77c6dfd Auto merge of #43026 - arielb1:llvm-next, r=alexcrichton
[LLVM] Avoid losing the !nonnull attribute in SROA

Fixes #37945.

r? @alexcrichton
2017-07-14 09:54:13 +00:00
Jeremy Soller
5757e05619 Fix backtrace on Redox 2017-07-13 20:07:37 -06:00
kennytm
1da51cca9e
Fix minor typo in std::path documentation.
Replace all `'C' as u8` with `b'C'`.
2017-07-14 10:06:06 +08:00
bors
ab91c70cc6 Auto merge of #43216 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests

- Successful merges: #42926, #43125, #43157, #43167, #43187, #43203, #43204
- Failed merges:
2017-07-14 00:50:33 +00:00
Jeffrey Seyfried
b5c5a0c3fd Fix regression involving identifiers in macro_rules! patterns. 2017-07-13 14:12:57 -07:00
Simon Sapin
2007987099 Forward more Iterator methods for iter::Rev
`position` could not be implemented because calling `rposition`
on the inner iterator would require more trait bounds.
2017-07-13 12:35:39 -07:00
Simon Sapin
b90e5107c0 Forward more Iterator methods for str::Bytes
These are overridden by slice::Iter
2017-07-13 12:35:39 -07:00
Ralf Jung
03f22fdf5e windows::fs::symlink_dir: fix example to actually use symlink_dir 2017-07-13 11:14:35 -07:00
Ryan Thomas
aca6cd052d Update docs on Error struct. #29355
This adds a pretty contrived example of the usage of fmt::Error. I am
very open to suggestions for a better one.

I have also highlighted the fmt::Error vs std::error::Error.

r? @steveklabnik
2017-07-13 17:24:28 +01:00
Thomas Lively
3bf8116280 Split old and experimental wasm builders 2017-07-13 08:59:01 -07:00
Michael Woerister
678d37700d Address some nits in trans-collector and partitioner. 2017-07-13 17:45:40 +02:00
Alex Crichton
bdcebc938b Update the cargo submodule
Notably pull in an update to the `jobserver` crate to have Cargo set the
`CARGO_MAKEFLAGS` environment variable instead of the `MAKEFLAGS` environment
variable.
2017-07-13 07:54:28 -07:00
Steve Klabnik
da3f5b80ed Rollup merge of #43204 - jackpot51:patch-3, r=alexcrichton
Implement fs::rename in sys::redox

This uses a simple implementation of copy + unlink. Redox does not have a rename or link system call for a faster implementation.
2017-07-13 10:45:22 -04:00
Steve Klabnik
9d4b462250 Rollup merge of #43203 - jackpot51:patch-2, r=alexcrichton
Remove obsolete oom handler from sys::redox

Alloc no longer has set_oom_handler.
2017-07-13 10:45:21 -04:00
Steve Klabnik
a14b30c463 Rollup merge of #43187 - steveklabnik:code-of-conduct, r=alexcrichton
Add the Code of Conduct to the repository.

https://github.com/rust-lang/rust/community currently shows that we have
no code of conduct. This will make it understand.

This is an exact copy of the page on the website.
2017-07-13 10:45:20 -04:00
Steve Klabnik
591d8a1081 Rollup merge of #43167 - SimonSapin:alt-profiler, r=alexcrichton
Enable profiler on "alternate" builds

This hopefully fixes #42967 and #43085.
2017-07-13 10:45:19 -04:00
Steve Klabnik
ddf43b5c3e Rollup merge of #43157 - zackmdavis:mail_map, r=steveklabnik
update .mailmap

It's nice to have an up-to-date .mailmap so that contributor listings (like those provided by `git shortlog` or http://thanks.rust-lang.org/) don't split the same author's contributions across two or more variations of their name.

Affected contributors—

@Aaronepower (3 commits as "Aaron Power", 1 as "Aaronepower")
@djrollins (5 commits as "Daniel J Rollins", 1 as "Daniel Rollins")
@eddyb (345 commits as "Eduard-Mihai Burtescu", 678 as "Eduard Burtescu", assuming former is canonical based on recency and GitHub profile display name)
@edunham (1 more recent commit contradicts existing .mailmap entry)
@GuillaumeGomez (942 commits as "Guillaume Gomez", 55 commits as "ggomez", 22 commits as "GuillaumeGomez")
@jonathandturner (362 commits as "Jonathan Turner", 1 as "jonathandturner")
@Mark-Simulacrum (248 commits as "Mark Simulacrum", 97 "Mark-Simulacrum")
@fiveop (1 commit each as "Philipp Matthias Schäfer" and "Philipp Matthias Schaefer", assuming former is canonical based on GitHub profile display name)
@shyaamsundhar (1 commit as "Shyam Sundar B", 3 as ShyamSundarB, assuming former is canonical based on recency)
@steveklabnik (1634 commits as "Steve Klabnik", 41 as "steveklabnik")
2017-07-13 10:45:18 -04:00
Steve Klabnik
8dc69ff9c4 Rollup merge of #43125 - aochagavia:stable_drop, r=arielb1
Add regression tests to ensure stable drop order

Work towards #43034

I think this is all we need to do on the testing front regarding RFC 1857
2017-07-13 10:45:17 -04:00
Steve Klabnik
3aaa809c7b Rollup merge of #42926 - Havvy:doc-path-ext, r=steveklabnik
Document what happens on failure in path ext is_file is_dir

r? @steveklabnik

Also, what other ways could there be an error that gets discarded and returns false? Should we list them all? Should we say that any errors trying to access the metadata at that path causes it to return false, even if there might be a file or directory there?

Should I add a See also link to the original functions that do return Results?
2017-07-13 10:45:16 -04:00
Oliver Schneider
cb92ab93a2 Reduce the usage of features in compiletest and libtest 2017-07-13 16:37:57 +02:00
Michael Woerister
c93e62b2c5 Adapt cgu-partitioning tests to pre-trans symbol internalization. 2017-07-13 13:29:25 +02:00
Michael Woerister
2f07eb3261 trans: Internalize symbols at the trans-item level, without relying on LLVM. 2017-07-13 13:28:16 +02:00
bors
b2c0707872 Auto merge of #43158 - PlasmaPower:thread-local-try-with, r=alexcrichton
Thread local try with

https://github.com/rust-lang/rfcs/pull/2030 was turned into this PR (the RFC was closed, but it looks like just a PR should be good).

See also: state stabilization issue: #27716

`try_with` is used in two places in std: stdio and thread_info. In stdio, it would be better if the result was passed to the closure, but in thread_info, it's better as is where the result is returned from the function call. I'm not sure which is better, but I prefer the current way as it better represents the scope.
2017-07-13 10:50:23 +00:00
bors
06ffdeb781 Auto merge of #43129 - Ophirr33:master, r=alexcrichton
Updated docker images to share scripts

Attempts to resolve #42201. I managed to pull out five scripts (android-base-apt-get, ubuntu16-apt-get, make3, rustbuild-setup, and crosstool-ng). Let me know if there's more I can do or if I should change some names.
r? @malbarbo
2017-07-13 08:06:11 +00:00
bors
cfd4c81188 Auto merge of #43198 - rust-lang:travis-shell, r=alexcrichton
Change language in Travis configuration to shell

In theory, this will give us more disk space to work with and unblock the queue.

See https://github.com/travis-ci/packer-templates/pull/454 and https://github.com/travis-ci/docs-travis-ci-com/issues/1267#issuecomment-313675483.

cc @kennytm
r? @alexcrichton
2017-07-13 04:35:32 +00:00
Jeremy Soller
4259ae6475 Update fs.rs 2017-07-12 22:16:35 -06:00
Jeremy Soller
21f2ace8cf Update mod.rs 2017-07-12 20:48:04 -06:00
Jeremy Soller
362dd8a986 Update fs.rs 2017-07-12 20:40:43 -06:00
Jeremy Soller
bd9428a46b Update mod.rs 2017-07-12 20:39:02 -06:00
Jeremy Soller
0d617ce4c9 Update tcp.rs 2017-07-12 20:37:18 -06:00
Ty Coghlan
250346128b Updated docker images to factor out common scripts 2017-07-12 21:25:36 -04:00
Zack M. Davis
eac7410405 suggest one-argument enum variant to fix type mismatch when applicable
Most notably, this will suggest `Some(x)` when the expected type was
an Option<T> but we got an x: T.

Resolves #42764.
2017-07-12 17:36:22 -07:00
Mark Simulacrum
b7a4c54413 Change language in Travis configuration to shell
In theory, this will give us more disk space to work with and unblock the queue.
2017-07-12 16:34:18 -06:00
Ralf Jung
0bbc315830 please tidy by shortening lines 2017-07-12 13:19:58 -07:00