]> git.lizzy.rs Git - rust.git/log
rust.git
6 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

6 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?

6 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.

6 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

6 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

6 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

6 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.

6 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

6 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:

6 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

6 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

6 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.

6 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.

6 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()

6 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)

6 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.

6 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`
```

6 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.

6 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.

6 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.

6 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

6 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.

6 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.

6 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.

6 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()

6 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()

6 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

6 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.

6 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

6 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.

6 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.

6 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

6 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.

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

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

6 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.

6 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.

6 years agoAuto merge of #43006 - GuillaumeGomez:e0611-cleanup, r=nikomatsakis
bors [Tue, 11 Jul 2017 10:07:24 +0000 (10:07 +0000)]
Auto merge of #43006 - GuillaumeGomez:e0611-cleanup, r=nikomatsakis

Clean up some code

From #42669.

r? @nikomatsakis

6 years agoMerge ui/README.md into COMPILER_TESTS.md and describe how custom UI normalization...
kennytm [Thu, 6 Jul 2017 18:10:48 +0000 (02:10 +0800)]
Merge ui/README.md into COMPILER_TESTS.md and describe how custom UI normalization works.

6 years agocompiletest: Support custom normalization rules.
kennytm [Thu, 6 Jul 2017 05:54:58 +0000 (13:54 +0800)]
compiletest: Support custom normalization rules.

6 years agotweak word ordering
Niko Matsakis [Mon, 10 Jul 2017 17:45:10 +0000 (13:45 -0400)]
tweak word ordering

6 years agoClean up some code
Guillaume Gomez [Sat, 1 Jul 2017 13:41:49 +0000 (15:41 +0200)]
Clean up some code

6 years agocompiletest: Refactor: Move the `ignore-{}` logic into its own method.
kennytm [Thu, 6 Jul 2017 03:25:29 +0000 (11:25 +0800)]
compiletest: Refactor: Move the `ignore-{}` logic into its own method.

Prepare for `normalize-std???` which will share the same logic.
Added `ignore-32bit` and `ignore-64bit`.

6 years agoAuto merge of #43147 - oyvindln:deflate_fix, r=alexcrichton
bors [Tue, 11 Jul 2017 07:42:13 +0000 (07:42 +0000)]
Auto merge of #43147 - oyvindln:deflate_fix, r=alexcrichton

Use similar compression settings as before updating to use flate2

Fixes #42879

(My first PR to rust-lang yay)

This changes the compression settings back to how they were before the change to use the flate2 crate rather than the in-tree flate library. The specific changes are to use the `Fast` compression level (which should be equivialent to what was used before), and use a raw deflate stream rather than wrapping the stream in a zlib wrapper. The [zlib](https://tools.ietf.org/html/rfc1950) wrapper adds an extra 2 bytes of header data, and 4 bytes for a checksum at the end. The change to use a faster compression level did give some compile speedups in the past (see #37298). Having to calculate a checksum also added a small overhead, which didn't exist before the change to flate2.

r? @alexcrichton

6 years agoAuto merge of #42913 - kennytm:fix-40569-ident-without-backtrack, r=jseyfried
bors [Tue, 11 Jul 2017 04:04:11 +0000 (04:04 +0000)]
Auto merge of #42913 - kennytm:fix-40569-ident-without-backtrack, r=jseyfried

Only match a fragment specifier the if it starts with certain tokens.

When trying to match a fragment specifier, we first predict whether the current token can be matched at all. If it cannot be matched, don't bother to push the Earley item to `bb_eis`. This can fix a lot of issues which otherwise requires full backtracking (#42838).

In this PR the prediction treatment is not done for `:item`, `:stmt` and `:tt`, but it could be expanded in the future.

Fixes #24189.
Fixes #26444.
Fixes #27832.
Fixes #34030.
Fixes #35650.
Fixes #39964.
Fixes the 4th comment in #40569.
Fixes the issue blocking #40984.

6 years agoUse LocalKey::try_with in std
Lee Bousfield [Tue, 11 Jul 2017 00:18:36 +0000 (20:18 -0400)]
Use LocalKey::try_with in std

6 years agoAdd LocalKey::try_with as an alternative to state
Lee Bousfield [Mon, 10 Jul 2017 23:26:11 +0000 (19:26 -0400)]
Add LocalKey::try_with as an alternative to state

6 years agoAuto merge of #43028 - michaelwoerister:dedup-dep-nodes, r=nikomatsakis
bors [Mon, 10 Jul 2017 21:18:14 +0000 (21:18 +0000)]
Auto merge of #43028 - michaelwoerister:dedup-dep-nodes, r=nikomatsakis

incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes

This is a parallel PR to the pending https://github.com/rust-lang/rust/pull/42769. It implements most of what is possible in terms of DepNode re-opening without having anonymous DepNodes yet (https://github.com/rust-lang/rust/issues/42298).

r? @nikomatsakis

6 years agodon't panic in `dep_node_debug_str` if `self.data` is `None`
Niko Matsakis [Mon, 10 Jul 2017 19:45:36 +0000 (15:45 -0400)]
don't panic in `dep_node_debug_str` if `self.data` is `None`

6 years agoAuto merge of #43152 - Mark-Simulacrum:test-src-doc, r=alexcrichton
bors [Mon, 10 Jul 2017 18:17:00 +0000 (18:17 +0000)]
Auto merge of #43152 - Mark-Simulacrum:test-src-doc, r=alexcrichton

Test src/doc once more

This was accidentally broken in https://github.com/rust-lang/rust/pull/42437 since we filtered too early to recurse into sub-directories.

In theory, @bors p=10

r? @alexcrichton

6 years agoTest src/doc once more
Mark Simulacrum [Mon, 10 Jul 2017 17:43:02 +0000 (11:43 -0600)]
Test src/doc once more

6 years agoUse similar compression settings as before updating to use flate2
oyvindln [Mon, 10 Jul 2017 15:54:50 +0000 (17:54 +0200)]
Use similar compression settings as before updating to use flate2

Fixes #42879

6 years agoAuto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakis
bors [Mon, 10 Jul 2017 15:39:47 +0000 (15:39 +0000)]
Auto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakis

Fix feature gate for `#[link_args(..)]` attribute

Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute.

See also #29596 and #43106

6 years agoFix feature gate for `#[link_args(..)]` attribute so that it will fire
Felix S. Klock II [Fri, 7 Jul 2017 14:09:46 +0000 (16:09 +0200)]
Fix feature gate for `#[link_args(..)]` attribute so that it will fire
regardless of context of attribute.

Extend the gating test to include the attribute in "weird" places.

6 years agoincr.comp.: Cache DepNodes with corresponding query results.
Michael Woerister [Tue, 4 Jul 2017 15:33:43 +0000 (17:33 +0200)]
incr.comp.: Cache DepNodes with corresponding query results.

6 years agoincr.comp.: Introduce the concept of anonymous DepNodes.
Michael Woerister [Fri, 23 Jun 2017 14:37:12 +0000 (16:37 +0200)]
incr.comp.: Introduce the concept of anonymous DepNodes.

6 years agoincr.comp.: Manage dependency graph on main thread.
Michael Woerister [Tue, 4 Jul 2017 13:06:57 +0000 (15:06 +0200)]
incr.comp.: Manage dependency graph on main thread.

6 years agoFix some `tidy` errors.
Michael Woerister [Tue, 4 Jul 2017 12:23:07 +0000 (14:23 +0200)]
Fix some `tidy` errors.

6 years agoDeduplicate DepNode::ConstEval()
Michael Woerister [Mon, 3 Jul 2017 14:37:48 +0000 (16:37 +0200)]
Deduplicate DepNode::ConstEval()

6 years agoAllow 'tcx in define_dep_nodes! and deduplicate some DepNodes.
Michael Woerister [Fri, 30 Jun 2017 21:53:35 +0000 (14:53 -0700)]
Allow 'tcx in define_dep_nodes! and deduplicate some DepNodes.

6 years agoAdd StableHash implementation for ty::Instance.
Michael Woerister [Fri, 30 Jun 2017 21:51:03 +0000 (14:51 -0700)]
Add StableHash implementation for ty::Instance.

6 years agoincr.comp.: Improve debug output for work products.
Michael Woerister [Fri, 23 Jun 2017 14:37:12 +0000 (16:37 +0200)]
incr.comp.: Improve debug output for work products.

6 years agoSplit DepNode::ItemSignature into non-overlapping variants.
Michael Woerister [Thu, 22 Jun 2017 08:54:26 +0000 (10:54 +0200)]
Split DepNode::ItemSignature into non-overlapping variants.

6 years agoCorrect some stability attributes
Oliver Middleton [Mon, 10 Jul 2017 01:07:29 +0000 (02:07 +0100)]
Correct some stability attributes

These show up in rustdoc so need to be correct.

6 years agoAdd warning to BufWriter documentation
John Gallagher [Sun, 9 Jul 2017 21:52:20 +0000 (17:52 -0400)]
Add warning to BufWriter documentation

6 years agoAuto merge of #43115 - petrochenkov:methlife2, r=eddyb
bors [Sun, 9 Jul 2017 21:40:16 +0000 (21:40 +0000)]
Auto merge of #43115 - petrochenkov:methlife2, r=eddyb

Store all generic arguments for method calls in AST/HIR

The first part of https://github.com/rust-lang/rust/pull/42492.
Landed separately to start the process of merging libsyntax changes breaking rustfmt, which is not easy these days.

6 years agoUpdate rls to pull rustfmt with libsyntax changes
Vadim Petrochenkov [Sat, 8 Jul 2017 00:32:19 +0000 (03:32 +0300)]
Update rls to pull rustfmt with libsyntax changes

6 years agoStore all generic arguments for method calls in HIR
Vadim Petrochenkov [Fri, 7 Jul 2017 12:57:51 +0000 (15:57 +0300)]
Store all generic arguments for method calls in HIR

6 years agoStore all generic arguments for method calls in AST
Vadim Petrochenkov [Thu, 6 Jul 2017 23:39:55 +0000 (02:39 +0300)]
Store all generic arguments for method calls in AST

6 years agoAuto merge of #43130 - GuillaumeGomez:rustdoc-fn-spacing, r=QuietMisdreavus
bors [Sun, 9 Jul 2017 17:58:10 +0000 (17:58 +0000)]
Auto merge of #43130 - GuillaumeGomez:rustdoc-fn-spacing, r=QuietMisdreavus

Add spacing between trait functions

Fixes #42988.

<img width="1440" alt="screen shot 2017-07-09 at 17 02 16" src="https://user-images.githubusercontent.com/3050060/27995068-672a3208-64c8-11e7-9bc7-c7288f2cd27b.png">

6 years agoAuto merge of #43117 - MJDSys:fix_rustbuild_libdir_2, r=alexcrichton
bors [Sun, 9 Jul 2017 15:42:47 +0000 (15:42 +0000)]
Auto merge of #43117 - MJDSys:fix_rustbuild_libdir_2, r=alexcrichton

Fix stage 2 builds with a custom libdir.

When copying libstd for the stage 2 compiler, the builder ignores the
configured libdir/libdir_relative configuration parameters.  This causes
the compiler to fail to find libstd, which cause any tools built with the
stage 2 compiler to fail.

To fix this, make the copy steps of rustbuild aware of the libdir_relative
parameter when the stage >= 2.  Also update the dist target to be aware of
the new location of libstd.

6 years agoAdd spacing between trait functions
Guillaume Gomez [Sat, 8 Jul 2017 22:40:29 +0000 (00:40 +0200)]
Add spacing between trait functions

6 years agoAuto merge of #43082 - ids1024:condvar2, r=alexcrichton
bors [Sun, 9 Jul 2017 04:23:29 +0000 (04:23 +0000)]
Auto merge of #43082 - ids1024:condvar2, r=alexcrichton

Redox: Fix Condvar.wait(); do not lock mutex twice

The atomic_xchg() loop locks the mutex, so the call to mutex_lock is
incorrect, and blocks.

6 years agoAuto merge of #43128 - ibabushkin:master, r=eddyb
bors [Sun, 9 Jul 2017 01:48:11 +0000 (01:48 +0000)]
Auto merge of #43128 - ibabushkin:master, r=eddyb

Implemented `TypeFoldable` for `TypeError`s.

This is quite handy in some user code, for instance to pull out type errors from an inference context when `fresh_substs_for_item` has been used before.

6 years agoAuto merge of #43097 - PlasmaPower:large-align, r=eddyb
bors [Sat, 8 Jul 2017 22:09:04 +0000 (22:09 +0000)]
Auto merge of #43097 - PlasmaPower:large-align, r=eddyb

Raise alignment limit from 2^15 to 2^31 - 1

Fixes #42960

6 years agoImplemented `TypeFoldable` for `TypeError`s.
Inokentiy Babushkin [Sat, 8 Jul 2017 21:24:00 +0000 (23:24 +0200)]
Implemented `TypeFoldable` for `TypeError`s.

6 years agoAuto merge of #43075 - durka:error-long-link, r=nikomatsakis
bors [Sat, 8 Jul 2017 19:50:13 +0000 (19:50 +0000)]
Auto merge of #43075 - durka:error-long-link, r=nikomatsakis

Fix links for typeck diagnostics without tripping tidy

Pick up #42624 to fix #43070 (cc @frewsxcv). I fixed a few other links while I was at it.

6 years agoInternally limit alignment to 2^30
Lee Bousfield [Sat, 8 Jul 2017 17:43:52 +0000 (13:43 -0400)]
Internally limit alignment to 2^30

6 years agoAuto merge of #43019 - kevinmehall:cleanup-errors, r=nikomatsakis
bors [Sat, 8 Jul 2017 17:30:37 +0000 (17:30 +0000)]
Auto merge of #43019 - kevinmehall:cleanup-errors, r=nikomatsakis

Remove unused code from librustc_errors

While extracting librustc_errors into a [reusable library](https://github.com/kevinmehall/codemap-diagnostic), I noticed some obsolete code that the `dead_code` warning missed because it was marked `pub` but not used elsewhere.

6 years agoBox large array to avoid blowing the stack
Lee Bousfield [Sat, 8 Jul 2017 17:02:52 +0000 (13:02 -0400)]
Box large array to avoid blowing the stack

6 years agoAuto merge of #42996 - Boreeas:merge-e0609-e0612, r=GuillaumeGomez
bors [Sat, 8 Jul 2017 15:18:46 +0000 (15:18 +0000)]
Auto merge of #42996 - Boreeas:merge-e0609-e0612, r=GuillaumeGomez

Fold E0612, E0613 into E0609

As discussed in #42945, with PR 1506 tuple indices are no longer considered a separate case from normal field. This PR folds E06012 ("tuple index out of bounds") and E0613 ("type is not a tuple") into E0609 ("type does not have field with that name")

Resolves #42945

6 years agoLower alignment limit down to 2^31 - 1 (from LLVM)
Lee Bousfield [Sat, 8 Jul 2017 14:28:20 +0000 (10:28 -0400)]
Lower alignment limit down to 2^31 - 1 (from LLVM)

6 years agoRaised alignment limit from 2^15 to 2^31
Lee Bousfield [Thu, 6 Jul 2017 22:00:46 +0000 (18:00 -0400)]
Raised alignment limit from 2^15 to 2^31

6 years agoAuto merge of #43104 - nbaksalyar:rustbuild-illumos-fix, r=sanxiyn
bors [Sat, 8 Jul 2017 13:08:11 +0000 (13:08 +0000)]
Auto merge of #43104 - nbaksalyar:rustbuild-illumos-fix, r=sanxiyn

Fix Rustbuild linking on Illumos

Illumos (an OpenSolaris fork) expects to get several extra library references for some system functions used by Rust standard library. This commit adds required linker options to rustbuild, which is currently doesn't work on Illumos-based operating systems.

6 years agoAuto merge of #43077 - SimonSapin:ranges, r=alexcrichton
bors [Sat, 8 Jul 2017 07:30:21 +0000 (07:30 +0000)]
Auto merge of #43077 - SimonSapin:ranges, r=alexcrichton

Implement O(1)-time Iterator::nth for Range*, and slim the Step trait

Fixes #43064.
Fixes part of #39975.
Fixes items 1 <s>and 3</s> of #42168.
CC #27741.

I think #42310 and #43012 should not have landed without the `nth` part of this PR, but oh well.

6 years agoAdd tests for reaching the end of RangeInclusive as an iterator
Simon Sapin [Thu, 6 Jul 2017 16:13:44 +0000 (18:13 +0200)]
Add tests for reaching the end of RangeInclusive as an iterator

6 years agoAdd tests for Range*::nth
Simon Sapin [Thu, 6 Jul 2017 15:13:29 +0000 (17:13 +0200)]
Add tests for Range*::nth

6 years agoImplement O(1)-time Iterator::nth for Range*
Simon Sapin [Wed, 5 Jul 2017 23:14:20 +0000 (01:14 +0200)]
Implement O(1)-time Iterator::nth for Range*

6 years agoFactorize some macros in iter/range.rs
Simon Sapin [Wed, 5 Jul 2017 22:32:54 +0000 (00:32 +0200)]
Factorize some macros in iter/range.rs

6 years agoRemove Step::steps_between, rename steps_between_by_one to steps_between
Simon Sapin [Wed, 5 Jul 2017 22:10:40 +0000 (00:10 +0200)]
Remove Step::steps_between, rename steps_between_by_one to steps_between

6 years agoRemove unused Step methods
Simon Sapin [Wed, 5 Jul 2017 21:54:08 +0000 (23:54 +0200)]
Remove unused Step methods

6 years agoRemove unused Add bounds in iterator for ranges impls.
Simon Sapin [Wed, 5 Jul 2017 21:49:33 +0000 (23:49 +0200)]
Remove unused Add bounds in iterator for ranges impls.

6 years agoAuto merge of #43072 - cuviper:linux-stack-guard, r=alexcrichton
bors [Sat, 8 Jul 2017 04:22:49 +0000 (04:22 +0000)]
Auto merge of #43072 - cuviper:linux-stack-guard, r=alexcrichton

Skip the main thread's manual stack guard on Linux

Linux doesn't allocate the whole stack right away, and the kernel has its own stack-guard mechanism to fault when growing too close to an existing mapping.  If we map our own guard, then the kernel starts enforcing a rather large gap above that, rendering much of the possible stack space useless.

Instead, we'll just note where we expect rlimit to start faulting, so our handler can report "stack overflow", and trust that the kernel's own stack guard will work.

Fixes #43052.
r? @alexcrichton

### Kernel compatibility:

Strictly speaking, Rust claims support for Linux kernels >= 2.6.18, and stack guards were only added to mainline in 2.6.36 for [CVE-2010-2240].  But since that vulnerability was so severe, the guards were backported to many stable branches, and Red Hat patched this all the way back to RHEL3's 2.4.21!  I think it's reasonable for us to assume that any *supportable* kernel should have these stack guards.

At that time, the kernel only enforced one page of padding between the stack and other mappings, but thanks to [Stack Clash] that padding is now much larger, causing #43052.  The kernel side of those fixes are in [CVE-2017-1000364], which Red Hat has backported to at least RHEL5's 2.6.18 so far.

[CVE-2010-2240]: https://access.redhat.com/security/cve/CVE-2010-2240
[CVE-2017-1000364]: https://access.redhat.com/security/cve/CVE-2017-1000364
[Stack Clash]: https://access.redhat.com/security/vulnerabilities/stackguard

6 years agoUpdate compiler_builtins submodule for probestack fix
Alex Crichton [Sat, 8 Jul 2017 04:11:35 +0000 (21:11 -0700)]
Update compiler_builtins submodule for probestack fix

Closes #43102

6 years agoFix stage 2 builds with a custom libdir.
Matthew Dawson [Sat, 8 Jul 2017 03:00:38 +0000 (23:00 -0400)]
Fix stage 2 builds with a custom libdir.

When copying libstd for the stage 2 compiler, the builder ignores the
configured libdir/libdir_relative configuration parameters.  This causes
the compiler to fail to find libstd, which cause any tools built with the
stage 2 compiler to fail.

To fix this, make the copy steps of rustbuild aware of the libdir_relative
parameter when the stage >= 2.  Also update the dist target to be aware of
the new location of libstd.

6 years agoAuto merge of #42894 - petrochenkov:deny, r=nikomatsakis
bors [Sat, 8 Jul 2017 02:03:38 +0000 (02:03 +0000)]
Auto merge of #42894 - petrochenkov:deny, r=nikomatsakis

Make sufficiently old or low-impact compatibility lints deny-by-default

Needs crater run before proceeding.

r? @nikomatsakis

6 years agoMake `patterns_in_fns_without_body` warn-by-default again
Vadim Petrochenkov [Sat, 8 Jul 2017 00:01:11 +0000 (03:01 +0300)]
Make `patterns_in_fns_without_body` warn-by-default again

Fix some tests on Linux

6 years agoMove public reexports of private extern crates into a separate lint
Vadim Petrochenkov [Sun, 25 Jun 2017 02:50:51 +0000 (05:50 +0300)]
Move public reexports of private extern crates into a separate lint

This is going to be a hard error while all private-in-public errors from rustc_privacy will be reclassified into lints.

6 years agoMake sufficiently old or low-impact compatibility lints deny-by-default
Vadim Petrochenkov [Sun, 25 Jun 2017 02:30:20 +0000 (05:30 +0300)]
Make sufficiently old or low-impact compatibility lints deny-by-default

6 years agoRemove more anonymous trait method parameters
Vadim Petrochenkov [Sun, 25 Jun 2017 02:29:10 +0000 (05:29 +0300)]
Remove more anonymous trait method parameters