]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoMove resolve diagnostic instability to compile-fail
Oliver Schneider [Mon, 17 Jul 2017 08:16:08 +0000 (10:16 +0200)]
Move resolve diagnostic instability to compile-fail

The produced paths aren't stable between builds, since
reporting paths inside resolve, before resolve is finished
might produce paths resolved to type aliases instead of
the concrete type.

Compile-fail tests can match just parts of messages, so they
don't "suffer" from this issue.

This is just a workaround, the instability should be fixed
in the future.

7 years agoChange some helps to suggestions
Oliver Schneider [Tue, 16 May 2017 13:12:24 +0000 (15:12 +0200)]
Change some helps to suggestions

7 years agoMove some tests from compile-fail to ui
Oliver Schneider [Tue, 16 May 2017 13:11:34 +0000 (15:11 +0200)]
Move some tests from compile-fail to ui

7 years agoAuto merge of #43258 - petrochenkov:cbabort, r=alexcrichton
bors [Mon, 17 Jul 2017 03:03:19 +0000 (03:03 +0000)]
Auto merge of #43258 - petrochenkov:cbabort, r=alexcrichton

Compile `compiler_builtins` with `abort` panic strategy

A workaround for https://github.com/rust-lang/rust/issues/43095

In case this causes unexpected consequences, I use a simpler workaround locally:
```diff
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -175,7 +175,9 @@ fn main() {
         }

         if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
-            cmd.arg("-C").arg(format!("codegen-units={}", s));
+            if crate_name != "compiler_builtins" {
+                cmd.arg("-C").arg(format!("codegen-units={}", s));
+            }
         }

         // Emit save-analysis info.
```

r? @alexcrichton

7 years agoAuto merge of #43055 - est31:stabilize_float_bits_conv, r=sfackler
bors [Mon, 17 Jul 2017 00:19:43 +0000 (00:19 +0000)]
Auto merge of #43055 - est31:stabilize_float_bits_conv, r=sfackler

Stabilize float_bits_conv for Rust 1.21

Stabilizes the `float_bits_conv` lib feature for the 1.20 release of Rust. I've initially implemented the feature in #39271 and later made PR #43025 to output quiet NaNs even on platforms with different encodings, which seems to have been the only unresolved issue of the API.

Due to PR #43025 being only applied to master this stabilisation can't happen for Rust 1.19 through the usual "stabilisation on beta" system that is being done for library APIs.

r? @BurntSushi

closes #40470.

7 years agoAuto merge of #43237 - zackmdavis:missing_sum_and_product_for_128_bit_integers, r...
bors [Sun, 16 Jul 2017 12:42:56 +0000 (12:42 +0000)]
Auto merge of #43237 - zackmdavis:missing_sum_and_product_for_128_bit_integers, r=nagisa

add u128/i128 to sum/product implementors

Resolves #43235.

7 years agoAuto merge of #43252 - vbrandl:doc/default-values, r=GuillaumeGomez
bors [Sun, 16 Jul 2017 10:22:00 +0000 (10:22 +0000)]
Auto merge of #43252 - vbrandl:doc/default-values, r=GuillaumeGomez

Document default values for primitive types

All primitive types implement the `Default` trait but the documentation just says `Returns the "default value" for a type.` and doesn't give a hint about the actual default value. I think it would be good to document the default values in a proper way.
I changed the `default_impl` macro to accept a doc string as a third parameter and use this string to overwrite the documentation of `default()` for each primitive type.
The generated documentation now looks like this:
![Documentation of default() on the bool primitive](https://i.imgur.com/nK6TApo.png)

7 years agoCompile `compiler_builtins` with `abort` panic strategy
Vadim Petrochenkov [Sat, 15 Jul 2017 23:02:34 +0000 (02:02 +0300)]
Compile `compiler_builtins` with `abort` panic strategy

7 years agoAuto merge of #43224 - jseyfried:fix_macro_idents_regression, r=nrc
bors [Sat, 15 Jul 2017 19:12:03 +0000 (19:12 +0000)]
Auto merge of #43224 - jseyfried:fix_macro_idents_regression, r=nrc

macros: fix regression involving identifiers in `macro_rules!` patterns.

Fixes #42019.
r? @nrc

7 years agoRephrase the doc string
Valentin Brandl [Sat, 15 Jul 2017 15:34:37 +0000 (17:34 +0200)]
Rephrase the doc string

7 years agoAuto merge of #43246 - frewsxcv:rollup, r=frewsxcv
bors [Sat, 15 Jul 2017 14:51:02 +0000 (14:51 +0000)]
Auto merge of #43246 - frewsxcv:rollup, r=frewsxcv

Rollup of 8 pull requests

- Successful merges: #43074, #43145, #43159, #43202, #43222, #43228, #43229, #43240
- Failed merges:

7 years agoDocument default values for primitive types
Valentin Brandl [Sat, 15 Jul 2017 13:35:03 +0000 (15:35 +0200)]
Document default values for primitive types

7 years agoAuto merge of #43207 - alexcrichton:update-cargo, r=nikomatsakis
bors [Sat, 15 Jul 2017 11:02:35 +0000 (11:02 +0000)]
Auto merge of #43207 - alexcrichton:update-cargo, r=nikomatsakis

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.

cc https://github.com/rust-lang/rust/issues/42635

7 years agoAuto merge of #43179 - oli-obk:mark_all_the_expansions, r=jseyfried
bors [Sat, 15 Jul 2017 08:36:27 +0000 (08:36 +0000)]
Auto merge of #43179 - oli-obk:mark_all_the_expansions, r=jseyfried

Reintroduce expansion info for proc macros 1.1

r? @jseyfried

7 years agoAuto merge of #43185 - durka:thread-local-pub-restricted, r=alexcrichton
bors [Sat, 15 Jul 2017 06:14:11 +0000 (06:14 +0000)]
Auto merge of #43185 - durka:thread-local-pub-restricted, r=alexcrichton

support pub(restricted) in thread_local! (round 2)

Resurrected #40984 now that the issue blocking it was fixed. Original description:

`pub(restricted)` was stabilized in #40556 so let's go!

Here is a [playground](https://play.rust-lang.org/?gist=f55f32f164a6ed18c219fec8f8293b98&version=nightly&backtrace=1).

I changed the interface of `__thread_local_inner!`, which is supposedly unstable but this is not checked for macros (#34097 cc @petrochenkov @jseyfried), so this may be an issue.

7 years agoRollup merge of #43240 - steveklabnik:update-books, r=QuietMisdreavus
Corey Farwell [Sat, 15 Jul 2017 03:57:19 +0000 (20:57 -0700)]
Rollup merge of #43240 - steveklabnik:update-books, r=QuietMisdreavus

Update the books.

`python x.py test src\doc` passes on my machine.

7 years agoRollup merge of #43229 - kennytm:return-false-if-path-is-relative-hahaha, r=steveklabnik
Corey Farwell [Sat, 15 Jul 2017 03:57:19 +0000 (20:57 -0700)]
Rollup merge of #43229 - kennytm:return-false-if-path-is-relative-hahaha, r=steveklabnik

Fix minor typo in std::path documentation.

Fix minor typo in `std::path` documentation.

Replace all `'C' as u8` with `b'C'`.

7 years agoRollup merge of #43228 - redox-os:backtrace_fix, r=alexcrichton
Corey Farwell [Sat, 15 Jul 2017 03:57:18 +0000 (20:57 -0700)]
Rollup merge of #43228 - redox-os:backtrace_fix, r=alexcrichton

Fix backtrace on Redox

This fixes sys::backtrace on Redox

7 years agoRollup merge of #43222 - RalfJung:symlink, r=sfackler
Corey Farwell [Sat, 15 Jul 2017 03:57:17 +0000 (20:57 -0700)]
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.)

7 years agoRollup merge of #43202 - jackpot51:patch-1, r=sfackler
Corey Farwell [Sat, 15 Jul 2017 03:57:16 +0000 (20:57 -0700)]
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

7 years agoRollup merge of #43159 - cuviper:ptr-swap-simd, r=arielb1
Corey Farwell [Sat, 15 Jul 2017 03:57:15 +0000 (20:57 -0700)]
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

7 years agoRollup merge of #43145 - GuillaumeGomez:build-error-if-nothing, r=Mark-Simulacrum
Corey Farwell [Sat, 15 Jul 2017 03:57:14 +0000 (20:57 -0700)]
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

7 years agoRollup merge of #43074 - SimonSapin:iter, r=aturon
Corey Farwell [Sat, 15 Jul 2017 03:57:13 +0000 (20:57 -0700)]
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.

7 years agoAuto merge of #43184 - nikomatsakis:incr-comp-anonymize-trait-selection, r=michaelwoe...
bors [Sat, 15 Jul 2017 02:22:11 +0000 (02:22 +0000)]
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

7 years agoAuto merge of #43174 - RalfJung:refactor-ty, r=nikomatsakis
bors [Fri, 14 Jul 2017 23:29:51 +0000 (23:29 +0000)]
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

7 years agoAuto merge of #43180 - oli-obk:compiletest, r=alexcrichton
bors [Fri, 14 Jul 2017 19:35:37 +0000 (19:35 +0000)]
Auto merge of #43180 - oli-obk:compiletest, r=alexcrichton

Reduce the usage of features in compiletest and libtest

7 years agoadd u128/i128 to sum/product implementors
Zack M. Davis [Fri, 14 Jul 2017 15:50:22 +0000 (08:50 -0700)]
add u128/i128 to sum/product implementors

Resolves #43235.

7 years agoUpdate the books.
steveklabnik [Fri, 14 Jul 2017 17:33:19 +0000 (13:33 -0400)]
Update the books.

7 years agoAuto merge of #43175 - tlively:wasm-split-bots, r=alexcrichton
bors [Fri, 14 Jul 2017 13:14:18 +0000 (13:14 +0000)]
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.

7 years agoAuto merge of #43026 - arielb1:llvm-next, r=alexcrichton
bors [Fri, 14 Jul 2017 09:54:13 +0000 (09:54 +0000)]
Auto merge of #43026 - arielb1:llvm-next, r=alexcrichton

[LLVM] Avoid losing the !nonnull attribute in SROA

Fixes #37945.

r? @alexcrichton

7 years agoFix backtrace on Redox
Jeremy Soller [Fri, 14 Jul 2017 02:07:37 +0000 (20:07 -0600)]
Fix backtrace on Redox

7 years agoFix minor typo in std::path documentation.
kennytm [Fri, 14 Jul 2017 01:55:39 +0000 (09:55 +0800)]
Fix minor typo in std::path documentation.

Replace all `'C' as u8` with `b'C'`.

7 years agoAuto merge of #43216 - steveklabnik:rollup, r=steveklabnik
bors [Fri, 14 Jul 2017 00:50:33 +0000 (00:50 +0000)]
Auto merge of #43216 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #42926, #43125, #43157, #43167, #43187, #43203, #43204
- Failed merges:

7 years agoFix regression involving identifiers in `macro_rules!` patterns.
Jeffrey Seyfried [Thu, 13 Jul 2017 21:12:57 +0000 (14:12 -0700)]
Fix regression involving identifiers in `macro_rules!` patterns.

7 years agoForward more Iterator methods for iter::Rev
Simon Sapin [Wed, 5 Jul 2017 18:23:55 +0000 (20:23 +0200)]
Forward more Iterator methods for iter::Rev

`position` could not be implemented because calling `rposition`
on the inner iterator would require more trait bounds.

7 years agoForward more Iterator methods for str::Bytes
Simon Sapin [Wed, 5 Jul 2017 18:21:29 +0000 (20:21 +0200)]
Forward more Iterator methods for str::Bytes

These are overridden by slice::Iter

7 years agowindows::fs::symlink_dir: fix example to actually use symlink_dir
Ralf Jung [Thu, 13 Jul 2017 18:14:35 +0000 (11:14 -0700)]
windows::fs::symlink_dir: fix example to actually use symlink_dir

7 years agoSplit old and experimental wasm builders
Thomas Lively [Fri, 7 Jul 2017 23:20:24 +0000 (16:20 -0700)]
Split old and experimental wasm builders

7 years agoUpdate the `cargo` submodule
Alex Crichton [Thu, 13 Jul 2017 05:22:25 +0000 (22:22 -0700)]
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.

7 years agoRollup merge of #43204 - jackpot51:patch-3, r=alexcrichton
Steve Klabnik [Thu, 13 Jul 2017 14:45:22 +0000 (10:45 -0400)]
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.

7 years agoRollup merge of #43203 - jackpot51:patch-2, r=alexcrichton
Steve Klabnik [Thu, 13 Jul 2017 14:45:21 +0000 (10:45 -0400)]
Rollup merge of #43203 - jackpot51:patch-2, r=alexcrichton

Remove obsolete oom handler from sys::redox

Alloc no longer has set_oom_handler.

7 years agoRollup merge of #43187 - steveklabnik:code-of-conduct, r=alexcrichton
Steve Klabnik [Thu, 13 Jul 2017 14:45:20 +0000 (10:45 -0400)]
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.

7 years agoRollup merge of #43167 - SimonSapin:alt-profiler, r=alexcrichton
Steve Klabnik [Thu, 13 Jul 2017 14:45:19 +0000 (10:45 -0400)]
Rollup merge of #43167 - SimonSapin:alt-profiler, r=alexcrichton

Enable profiler on "alternate" builds

This hopefully fixes #42967 and #43085.

7 years agoRollup merge of #43157 - zackmdavis:mail_map, r=steveklabnik
Steve Klabnik [Thu, 13 Jul 2017 14:45:18 +0000 (10:45 -0400)]
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")

7 years agoRollup merge of #43125 - aochagavia:stable_drop, r=arielb1
Steve Klabnik [Thu, 13 Jul 2017 14:45:17 +0000 (10:45 -0400)]
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

7 years agoRollup merge of #42926 - Havvy:doc-path-ext, r=steveklabnik
Steve Klabnik [Thu, 13 Jul 2017 14:45:16 +0000 (10:45 -0400)]
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?

7 years agoReduce the usage of features in compiletest and libtest
Oliver Schneider [Wed, 12 Jul 2017 08:44:49 +0000 (10:44 +0200)]
Reduce the usage of features in compiletest and libtest

7 years agoAuto merge of #43158 - PlasmaPower:thread-local-try-with, r=alexcrichton
bors [Thu, 13 Jul 2017 10:50:23 +0000 (10:50 +0000)]
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.

7 years agoAuto merge of #43129 - Ophirr33:master, r=alexcrichton
bors [Thu, 13 Jul 2017 08:06:11 +0000 (08:06 +0000)]
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

7 years agoAuto merge of #43198 - rust-lang:travis-shell, r=alexcrichton
bors [Thu, 13 Jul 2017 04:35:32 +0000 (04:35 +0000)]
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

7 years agoUpdate fs.rs
Jeremy Soller [Thu, 13 Jul 2017 04:16:35 +0000 (22:16 -0600)]
Update fs.rs

7 years agoUpdate mod.rs
Jeremy Soller [Thu, 13 Jul 2017 02:48:04 +0000 (20:48 -0600)]
Update mod.rs

7 years agoUpdate fs.rs
Jeremy Soller [Thu, 13 Jul 2017 02:40:43 +0000 (20:40 -0600)]
Update fs.rs

7 years agoUpdate mod.rs
Jeremy Soller [Thu, 13 Jul 2017 02:39:02 +0000 (20:39 -0600)]
Update mod.rs

7 years agoUpdate tcp.rs
Jeremy Soller [Thu, 13 Jul 2017 02:37:18 +0000 (20:37 -0600)]
Update tcp.rs

7 years agoUpdated docker images to factor out common scripts
Ty Coghlan [Sun, 9 Jul 2017 15:01:27 +0000 (11:01 -0400)]
Updated docker images to factor out common scripts

7 years agoChange language in Travis configuration to shell
Mark Simulacrum [Wed, 12 Jul 2017 22:34:18 +0000 (16:34 -0600)]
Change language in Travis configuration to shell

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

7 years agoplease tidy by shortening lines
Ralf Jung [Wed, 12 Jul 2017 20:19:58 +0000 (13:19 -0700)]
please tidy by shortening lines

7 years agorename trait to conform with 'getter trait' pattern
Ralf Jung [Wed, 12 Jul 2017 20:15:29 +0000 (13:15 -0700)]
rename trait to conform with 'getter trait' pattern

7 years agooverload the mir ty methods to make them more ergonomic to use
Ralf Jung [Wed, 12 Jul 2017 19:59:05 +0000 (12:59 -0700)]
overload the mir ty methods to make them more ergonomic to use

7 years agoDocument error coercion to false in path-ext methods + see also sections
Havvy [Tue, 27 Jun 2017 10:59:07 +0000 (03:59 -0700)]
Document error coercion to false in path-ext methods + see also sections

7 years agoAuto merge of #43181 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Wed, 12 Jul 2017 17:04:14 +0000 (17:04 +0000)]
Auto merge of #43181 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 8 pull requests

- Successful merges: #42670, #42826, #43000, #43011, #43098, #43100, #43136, #43137
- Failed merges:

7 years agoUse try_with for with implementation
Lee Bousfield [Wed, 12 Jul 2017 16:55:39 +0000 (10:55 -0600)]
Use try_with for with implementation

7 years agoTweak the CoC to point to the online version.
steveklabnik [Wed, 12 Jul 2017 16:40:09 +0000 (12:40 -0400)]
Tweak the CoC to point to the online version.

7 years agoAdd the Code of Conduct to the repository.
steveklabnik [Wed, 12 Jul 2017 16:34:29 +0000 (12:34 -0400)]
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.

7 years agoAdd regression tests to ensure stable drop order
Adolfo Ochagavía [Sat, 8 Jul 2017 19:32:29 +0000 (21:32 +0200)]
Add regression tests to ensure stable drop order

7 years agoRollup merge of #43137 - ollie27:stab, r=aturon
Mark Simulacrum [Wed, 12 Jul 2017 12:58:49 +0000 (06:58 -0600)]
Rollup merge of #43137 - ollie27:stab, r=aturon

Correct some stability attributes

These show up in rustdoc so need to be correct.

7 years agoRollup merge of #43136 - jgallag88:bufWriterDocs, r=steveklabnik
Mark Simulacrum [Wed, 12 Jul 2017 12:58:48 +0000 (06:58 -0600)]
Rollup merge of #43136 - jgallag88:bufWriterDocs, r=steveklabnik

Add warning to BufWriter documentation

When using `BufWriter`, it is very easy to unintentionally ignore errors, because errors which occur when flushing buffered data when the `BufWriter` is dropped are ignored. This has been noted in a couple places:  #32677, #37045.

There has been some discussion about how to fix this problem in #32677, but no solution seems likely to land in the near future. For now, anyone who wishes to have robust error handling must remember to manually call `flush()` on a `BufWriter` before it is dropped.  Until a permanent fix is in place, it seems worthwhile to add a warning to that effect to the documentation.

7 years agoRollup merge of #43100 - ids1024:stat2, r=aturon
Mark Simulacrum [Wed, 12 Jul 2017 12:58:47 +0000 (06:58 -0600)]
Rollup merge of #43100 - ids1024:stat2, r=aturon

Redox: add stat methods(); support is_symlink()

7 years agoRollup merge of #43098 - alexcrichton:more-proc-macro, r=jseyfried
Mark Simulacrum [Wed, 12 Jul 2017 12:58:46 +0000 (06:58 -0600)]
Rollup merge of #43098 - alexcrichton:more-proc-macro, r=jseyfried

Add `isize` and `usize` constructors to Literal

This commit fills out the remaining integer literal constructors on the
`proc_macro::Literal` type with `isize` and `usize`. (I think these were just
left out by accident)

7 years agoRollup merge of #43011 - qnighy:unsized-tuple-impls, r=aturon
Mark Simulacrum [Wed, 12 Jul 2017 12:58:45 +0000 (06:58 -0600)]
Rollup merge of #43011 - qnighy:unsized-tuple-impls, r=aturon

Implement Eq/Hash/Debug etc. for unsized tuples.

As I mentioned in [the comment in #18469](https://github.com/rust-lang/rust/issues/18469#issuecomment-306767422), the implementations of `PartialEq`, `Eq`, `PartialOrd`, `Ord`, `Debug`, `Hash` can be generalized to unsized tuples.

This is consistent with the `derive` behavior for unsized structs.

```rust
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Hash)]
struct MyTuple<X, Y, Z: ?Sized>(X, Y, Z);

fn f(x: &MyTuple<i32, i32, [i32]>) {
    x == x;
    x < x;
    println!("{:?}", x);
}
```

Questions:

- Need an RFC?
- Need a feature gate? I don't think it does because the unsized tuple coercion #42527 is feature-gated.
- I changed `builder.field($name);` into `builder.field(&$name);` in the `Debug` implementation to pass compilation. This won't affect the behavior because `Debug for &'a T` is a mere redirection to `Debug for T`. However, I don't know if it affects code size / performance.

7 years agoRollup merge of #43000 - estebank:on-unimplemented-path, r=arielb1
Mark Simulacrum [Wed, 12 Jul 2017 12:58:44 +0000 (06:58 -0600)]
Rollup merge of #43000 - estebank:on-unimplemented-path, r=arielb1

`rustc_on_unimplemented` supports referring to trait

Add support to `rustc_on_unimplemented` to reference the full path of
the annotated trait. For the following code:

```rust
pub mod Bar {
    #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{Foo}`"]
    pub trait Foo<Bar, Baz, Quux> {}
}
```

the error message will be:

```
test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`
```

7 years agoRollup merge of #42826 - Yorwba:type-mismatch-same-absolute-paths, r=arielb1
Mark Simulacrum [Wed, 12 Jul 2017 12:58:44 +0000 (06:58 -0600)]
Rollup merge of #42826 - Yorwba:type-mismatch-same-absolute-paths, r=arielb1

Note different versions of same crate when absolute paths of different types match.

The current check to address #22750 only works when the paths of the mismatched types relative to the current crate are equal, but this does not always work if one of the types is only included through an indirect dependency. If reexports are involved, the indirectly included path can e.g. [contain private modules](https://github.com/rust-lang/rust/issues/22750#issuecomment-302755516).

This PR takes care of these cases by also comparing the *absolute* path, which is equal if the type hasn't moved in the module hierarchy between versions. A more coarse check would be to compare only the crate names instead of full paths, but that might lead to too many false positives.

Additionally, I believe it would be helpful to show where the differing crates came from, i.e. the information in `rustc::middle::cstore::CrateSource`, but I'm not sure yet how to nicely display all of that, so I'm leaving it to a future PR.

7 years agoRollup merge of #42670 - dns2utf8:panic_return_code, r=steveklabnik
Mark Simulacrum [Wed, 12 Jul 2017 12:58:43 +0000 (06:58 -0600)]
Rollup merge of #42670 - dns2utf8:panic_return_code, r=steveklabnik

Add hint about the return code of panic!

I hope the link works on all cases, since the `unreachable` doc is copied to `std::` as well.

7 years ago[LLVM] Avoid losing the !nonnull attribute in SROA
Ariel Ben-Yehuda [Sat, 1 Jul 2017 19:00:20 +0000 (22:00 +0300)]
[LLVM] Avoid losing the !nonnull attribute in SROA

This still does not work on 32-bit archs because of an LLVM limitation,
but this is only an optimization, so let's push it on 64-bit only for now.

Fixes #37945

7 years agoAuto merge of #42897 - Mark-Simulacrum:pretty-print-refactor, r=jseyfried
bors [Wed, 12 Jul 2017 11:10:37 +0000 (11:10 +0000)]
Auto merge of #42897 - Mark-Simulacrum:pretty-print-refactor, r=jseyfried

Refactor pretty printing slightly

This doesn't introduce any functional changes (that I'm aware of). The primary intention here is to clean up the code a little. Each commit is intended to stand alone, reviewing commit-by-commit may be easiest.

7 years agointegrate anon dep nodes into trait selection
Niko Matsakis [Mon, 10 Jul 2017 21:10:30 +0000 (17:10 -0400)]
integrate anon dep nodes into trait selection

7 years agoAuto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakis
bors [Wed, 12 Jul 2017 08:45:39 +0000 (08:45 +0000)]
Auto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakis

incr.comp.: Don't include span information in the ICH of type definitions

This should improve some of the `regex` tests on perf.rlo. Not including spans into the ICH is harmless until we also cache warnings. To really solve the problem, we need to do more refactoring (see #43088).

r? @nikomatsakis

7 years agoReintroduce expansion info for proc macros 1.1
Oliver Schneider [Tue, 11 Jul 2017 07:52:50 +0000 (09:52 +0200)]
Reintroduce expansion info for proc macros 1.1

7 years agoAuto merge of #42697 - Mark-Simulacrum:take-limit, r=aturon
bors [Wed, 12 Jul 2017 06:23:38 +0000 (06:23 +0000)]
Auto merge of #42697 - Mark-Simulacrum:take-limit, r=aturon

Allow setting the limit on std::io::Take.

Fixes https://github.com/rust-lang/rust/issues/27269.

7 years agoAuto merge of #42936 - steveklabnik:update-mdbook, r=alexcrichton
bors [Wed, 12 Jul 2017 04:07:32 +0000 (04:07 +0000)]
Auto merge of #42936 - steveklabnik:update-mdbook, r=alexcrichton

update crate dependencies

I wanted to update mdbook's version. This ended up updating a bunch of other stuff too.

I am not sure if updating this much stuff is considered a Good Idea or not; happy to figure out how to make it smaller if someone can help me figure out how to use x.py to do it.

7 years agoupdate crate dependencies
steveklabnik [Tue, 27 Jun 2017 17:33:32 +0000 (13:33 -0400)]
update crate dependencies

I wanted to update mdbook's version. This ended up updating a bunch of other stuff too.

7 years agoAuto merge of #43056 - ids1024:nofollow2, r=burntsushi
bors [Wed, 12 Jul 2017 00:49:51 +0000 (00:49 +0000)]
Auto merge of #43056 - ids1024:nofollow2, r=burntsushi

Redox: Use O_NOFOLLOW for lstat()

7 years agoRefactor: {Lvalue,Rvalue,Operand}::ty only need the locals' types, not the full &Mir
Ralf Jung [Tue, 11 Jul 2017 23:02:06 +0000 (16:02 -0700)]
Refactor: {Lvalue,Rvalue,Operand}::ty only need the locals' types, not the full &Mir

7 years agoRedox: Use O_NOFOLLOW for lstat()
Ian Douglas Scott [Tue, 4 Jul 2017 02:21:03 +0000 (19:21 -0700)]
Redox: Use O_NOFOLLOW for lstat()

7 years agoAuto merge of #43083 - kennytm:fix-42434-custom-stdxxx-normalization, r=nikomatsakis
bors [Tue, 11 Jul 2017 22:02:20 +0000 (22:02 +0000)]
Auto merge of #43083 - kennytm:fix-42434-custom-stdxxx-normalization, r=nikomatsakis

compilertest (UI test): Support custom normalization.

Closes #42434.

Adds this header for UI tests:

```rust
// normalize-stderr-32bit: "fn() (32 bits)" -> "fn() ($PTR bits)"
```

It will normalize the `stderr` output on 32-bit platforms, by replacing all instances of `fn() (32 bits)` by `fn() ($PTR bits)`.

Extends the UI tests in #42304 and #41968 to 32-bit targets.

r? @nikomatsakis

7 years agolet #[allow_internal_unstable] cover :vis
Alex Burka [Fri, 21 Apr 2017 23:54:38 +0000 (23:54 +0000)]
let #[allow_internal_unstable] cover :vis

7 years agostage0 fallback
Alex Burka [Fri, 21 Apr 2017 04:30:08 +0000 (04:30 +0000)]
stage0 fallback

7 years agouse :vis in thread_local!
Alex Burka [Wed, 19 Apr 2017 02:29:40 +0000 (02:29 +0000)]
use :vis in thread_local!

7 years agosupport pub(restricted) in thread_local!
Alex Burka [Sat, 1 Apr 2017 03:06:34 +0000 (23:06 -0400)]
support pub(restricted) in thread_local!

7 years agoRefactor call_with_pp functions to not take a payload.
Mark Simulacrum [Sun, 25 Jun 2017 15:54:09 +0000 (09:54 -0600)]
Refactor call_with_pp functions to not take a payload.

This is needless noise; the closure we take is FnOnce, so move || {} is
fine to pass other parameters necessary.

7 years agoMake a few functions non-public
Mark Simulacrum [Sun, 25 Jun 2017 13:51:55 +0000 (07:51 -0600)]
Make a few functions non-public

7 years agoRefactor cur_cmnt_and_lit away.
Mark Simulacrum [Sun, 25 Jun 2017 12:38:13 +0000 (06:38 -0600)]
Refactor cur_cmnt_and_lit away.

The literal index was increased in only next_lit, so it isn't
necessary: code now uses an iterator. The cur_cmnt field is also moved
to be increased in print_comment instead of after each call to
print_comment.

7 years agoRefactor methods onto Printer struct.
Mark Simulacrum [Sun, 25 Jun 2017 03:22:42 +0000 (21:22 -0600)]
Refactor methods onto Printer struct.

No (intentional) changes to behavior. This is intended to avoid the
anti-pattern of having to import individual methods throughout code.

7 years agoAuto merge of #43116 - alexcrichton:probestack, r=sfackler
bors [Tue, 11 Jul 2017 17:52:42 +0000 (17:52 +0000)]
Auto merge of #43116 - alexcrichton:probestack, r=sfackler

Update compiler_builtins submodule for probestack fix

Closes #43102

7 years agoAuto merge of #42388 - tschottdorf:projty-substs, r=nikomatsakis
bors [Tue, 11 Jul 2017 15:14:32 +0000 (15:14 +0000)]
Auto merge of #42388 - tschottdorf:projty-substs, r=nikomatsakis

Downgrade ProjectionTy's TraitRef to its substs

Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.

Closes #42171.

7 years agoFix @alexcrichton comments
Lee Bousfield [Tue, 11 Jul 2017 15:04:19 +0000 (11:04 -0400)]
Fix @alexcrichton comments

7 years agoWrap long line
Stefan Schindler [Tue, 11 Jul 2017 14:45:39 +0000 (16:45 +0200)]
Wrap long line

7 years agoDowngrade ProjectionTy's TraitRef to its substs
Tobias Schottdorf [Tue, 11 Jul 2017 14:33:09 +0000 (10:33 -0400)]
Downgrade ProjectionTy's TraitRef to its substs

Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.

Closes #42171.

7 years agoAllow setting the limit on std::io::Take.
Mark Simulacrum [Fri, 16 Jun 2017 14:24:10 +0000 (08:24 -0600)]
Allow setting the limit on std::io::Take.