76722 Commits

Author SHA1 Message Date
kennytm
574c0502f1
Rollup merge of #49734 - alexcrichton:generalize-token-stream, r=nikomatsakis
proc_macro: Generalize `FromIterator` impl

While never intended to be stable we forgot that trait impls are insta-stable!
This construction of `FromIterator` wasn't our first choice of how to stabilize
the impl but our hands are tied at this point, so revert back to the original
definition of `FromIterator` before #49597

Closes #49725
2018-04-12 03:37:12 +08:00
kennytm
57b15f62e0
Rollup merge of #49849 - alecmocatta:master, r=alexcrichton
Add --enable-debug flag to musl CI build script

Building for x86_64-unknown-linux-musl currently results in an executable lacking debug information for musl libc itself. If you request a backtrace in GDB while control flow is within musl – including sycalls made by musl – the result looks like:

```
#0  0x0000000000434b46 in __cp_end ()
#1  0x0000000000432dbd in __syscall_cp_c ()
#2  0x0000000000000000 in ?? ()
```

i.e. not very helpful. Adding --enable-debug resolves this, and --enable-optimize re-enables optimisations which default to off given the previous flag.
2018-04-12 03:34:49 +08:00
kennytm
dfdcf63612
Rollup merge of #49857 - Amanieu:aarch64_fp, r=alexcrichton
Fix "fp" target feature for AArch64

This fixes the following warning on AArch64:
```
'+fp' is not a recognized feature for this target (ignoring feature)
```

Fixes #49782
2018-04-12 03:23:22 +08:00
kennytm
7a7092846c
Rollup merge of #49863 - memoryleak47:andorid, r=oli-obk
fixed typo
2018-04-12 03:23:21 +08:00
kennytm
0629309a7d
Rollup merge of #49856 - varkor:no_mangle-statics-unlinted, r=michaelwoerister
Do not uppercase-lint #[no_mangle] statics

The reasoning being that `#[no_mangle]` expresses enough intention that there's likely a good reason for the name.

Fixes #36258.
2018-04-12 03:23:19 +08:00
kennytm
4dbca4c8ac
Rollup merge of #49809 - Mark-Simulacrum:no-color-for-dumb, r=alexcrichton
Stop emitting color codes on TERM=dumb

These terminals generally don't support color.

Fixes #49191

cc @nikomatsakis

r? @alexcrichton
2018-04-11 19:56:48 +08:00
kennytm
6eb66fc315
Rollup merge of #49795 - nox:niche-with-uninhabited-fields, r=eddyb
Properly look for uninhabitedness of variants in niche-filling check
2018-04-11 19:56:47 +08:00
kennytm
f4b9fdace5
Rollup merge of #49781 - Robbepop:master, r=nikomatsakis
add regression test for #16223 (NLL): use of collaterally moved value

Adds regression test for https://github.com/rust-lang/rust/issues/16223 which NLL fixes.

The current downside of this test is that it uses the `#![feature(box_patterns)]` and I haven't come up with a proper test that only uses the `#![feature(nll)]` - however, I don't know if this is even possible to test without `#![feature(box_syntax)]` or `#![feature(box_patterns)]`.
2018-04-11 19:56:46 +08:00
kennytm
1bdb9a5cfa
Rollup merge of #49665 - draganmladjenovic:mips_tests, r=nikomatsakis
Small nits to make couple of tests pass on mips targets.
2018-04-11 19:56:44 +08:00
kennytm
63c4d50e8a
Rollup merge of #49614 - zackmdavis:the_phantom_menace, r=petrochenkov
in which the non-shorthand patterns lint keeps its own counsel in macros

In issue #49588, Michael Lamparski pointed out a scenario in which the
non-shorthand-field-patterns lint could be triggered by a macro-expanded
pattern, in a way which was direly unwieldy for the macro author to guard
against and unreasonable to expect the macro user to take into account. We can
avoid this by not linting patterns that come from macro-expansions. Although
this entails accepting "false negatives" where the lint could genuinely improve
macro-templated code, avoiding the reported "true-but-super-annoying positive"
may be worth the trade? (Some precedent for these relative priorities exists as
no. 47775 (5985b0b0).)

Resolves #49588.
2018-04-11 19:56:43 +08:00
kennytm
5ee5de10d2
Rollup merge of #49575 - tmccombs:option-filter-stabilize, r=withoutboats
Stabilize `Option::filter`.

Fixes #45860
2018-04-11 19:56:42 +08:00
kennytm
77777b4528
Rollup merge of #49525 - varkor:sort_by_cached_key-conversion, r=scottmcm
Use sort_by_cached_key where appropriate

A follow-up to https://github.com/rust-lang/rust/pull/48639, converting various slice sorting calls to `sort_by_cached_key` when the key functions are more expensive.
2018-04-11 19:56:41 +08:00
bors
ca26ef321c Auto merge of #49681 - tmccombs:take-set-limit-stable, r=sfackler
Stabilize take_set_limit

Fixes #42781
2018-04-11 06:03:46 +00:00
bors
43e994c8b8 Auto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichton
Move deny(warnings) into rustbuild

This permits easier iteration without having to worry about warnings
being denied.

Fixes #49517
2018-04-11 03:30:04 +00:00
Mark Simulacrum
53718d2ef1 Allow incorrectly reported unused attribute warning 2018-04-10 20:04:57 -06:00
bors
88ebd97d65 Auto merge of #49695 - michaelwoerister:unhygienic-ty-min, r=nikomatsakis
Use InternedString instead of Symbol for type parameter types (2)

Reduced alternative to #49266. Let's see if this causes a performance regression.
2018-04-11 00:51:38 +00:00
memoryleak47
a648267dff fixed typo 2018-04-11 01:34:10 +02:00
Amanieu d'Antras
5e5374677a Fix "fp" feature for AArch64 2018-04-10 22:34:15 +01:00
varkor
6e0089ea77 Do not uppercase-lint no_mangle statics 2018-04-10 22:30:23 +01:00
bors
0b72d48f8e Auto merge of #48914 - gaurikholkar:e0389, r=nikomatsakis
Modify compile-fail/E0389 error message WIP

This fixes #47388

cc @nikomatsakis @estebank

r? @nikomatsakis

Certain ui tests were failing locally. I'll check if the same happens here too.
2018-04-10 19:00:19 +00:00
Alec Mocatta
18e9532098
Add --enable-debug flag to musl CI build script
Building for x86_64-unknown-linux-musl currently results in an executable lacking debug information for musl libc itself. If you request a backtrace in GDB while control flow is within musl – including sycalls made by musl – the result looks like:

#0  0x0000000000434b46 in __cp_end ()
#1  0x0000000000432dbd in __syscall_cp_c ()
#2  0x0000000000000000 in ?? ()

i.e. not very helpful. Adding --enable-debug resolves this, and --enable-optimize re-enables optimisations which default to off given the previous flag.
2018-04-10 18:44:47 +01:00
bors
b2a7b94b8e Auto merge of #49386 - GuillaumeGomez:fix-path-attribute, r=eddyb
Add tcx in item_body_nested_bodies

Fixes #47391.

r? @eddyb
2018-04-10 12:58:27 +00:00
dragan.mladjenovic
0a94344fa7 Add ignores for powerpc and s390x to target-feature-wrong.rs and update references. 2018-04-10 11:26:47 +02:00
bors
67712d7945 Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoerister
More thread-safety changes

r? @michaelwoerister
2018-04-10 09:00:27 +00:00
dragan.mladjenovic
1e5145db9f Update ui test references. 2018-04-10 09:11:21 +02:00
dragan.mladjenovic
dab317f04f Small nits to make couple of tests pass on mips targets. 2018-04-10 09:11:21 +02:00
bors
a1c21ed7e2 Auto merge of #49504 - GuillaumeGomez:doc-all-types, r=QuietMisdreavus
Add page to list all crate's items

r? @QuietMisdreavus
2018-04-10 06:23:52 +00:00
bors
5d7f892356 Auto merge of #49258 - zackmdavis:not_going_to_recover, r=petrochenkov
suggest `!` for erroneous identifier `not`

![not_recovery](https://user-images.githubusercontent.com/1076988/37753255-3b669c42-2d59-11e8-9071-efad8eaf3086.png)

This supersedes #48858.

r? @petrochenkov
2018-04-10 03:27:43 +00:00
bors
a8a8d6b5bf Auto merge of #49435 - tmandry:rule-implied-bound-from-trait, r=nikomatsakis
chalkify: Implement lowering rule Implied-Bound-From-Trait

For #49177.

TODO:
- [x] Implement where clauses besides trait and projection predicates
- [x] Is the output of the `lower_trait_higher_rank` test correct?
- [ ] Remove `Self::Trait` from the query `tcx.predicates_of(<trait_id>).predicates`
- [ ] Consider moving tests to compile-fail to make them more manageable
2018-04-10 00:32:54 +00:00
bors
880fbd7c4e Auto merge of #49811 - alexcrichton:fix-android, r=SimonSapin
std: Be sure to modify atomics in tests

See #49775 for some more information but it looks like this is working around an
LLVM bug for the time being.

Closes #49775
2018-04-09 21:41:10 +00:00
Alex Crichton
69c3830c44 std: Be sure to modify atomics in tests
See #49775 for some more information but it looks like this is working around an
LLVM bug for the time being.

Closes #49775
2018-04-09 12:57:03 -07:00
Hero
f62c210d90 add regression test for issue #16223: fixed by NLL 2018-04-09 20:34:09 +02:00
gaurikholkar
c792d1e0c1 tidy fixes 2018-04-09 23:12:13 +05:30
Mark Simulacrum
d326bebf91 Stop emitting color codes on TERM=dumb
These terminals generally don't support color.

Fixes #49191
2018-04-09 11:39:55 -06:00
Zack M. Davis
a1d90a2a2a in which the non-shorthand patterns lint keeps its own counsel in macros
In issue #49588, Michael Lamparski pointed out a scenario in which the
non-shorthand-field-patterns lint could be triggered by a macro-expanded
pattern, in a way which was direly unwieldy for the macro author to guard
against and unreasonable to expect the macro user to take into account. We can
avoid this by not linting patterns that come from macro-expansions. Although
this entails accepting "false negatives" where the lint could genuinely improve
macro-templated code, avoiding the reported "true-but-super-annoying positive"
may be worth the trade? (Some precedent for these relative priorities exists as
no. 47775 (5985b0b0).)

Resolves #49588.
2018-04-09 08:53:30 -07:00
varkor
e7aa1397ea Use sort_by_cached_key for partitioning 2018-04-09 16:45:14 +01:00
varkor
2cc52f08b3 Use cmp::Reverse instead of subtraction 2018-04-09 16:45:14 +01:00
Zack M. Davis
ba0dd8eb02 in which ! is suggested for erroneous identifier not
Impressing confused Python users with magical diagnostics is perhaps
worth this not-grossly-unreasonable (only 40ish lines) extra complexity
in the parser?

Thanks to Vadim Petrochenkov for guidance.

This resolves #46836.
2018-04-09 08:45:12 -07:00
Zack M. Davis
944c401736 don't suggest placing code in block if next token is open-brace
Thanks to the inestimably inimitable Esteban "Estebank" Küber for
pointing this out.

This is relevant to #46836.
2018-04-09 08:45:12 -07:00
varkor
1aa61526a7 Add trivial early return for sort_by_cached_key 2018-04-09 16:44:20 +01:00
varkor
57eedbaaf8 Convert sort_by to sort_by_cached_key 2018-04-09 16:44:19 +01:00
varkor
5cd0504d10 Convert sort_unstable_by to sort_by_cached_key 2018-04-09 16:44:05 +01:00
varkor
d3fe534fcf Convert sort_unstable_by_key to sort_by_cached_key 2018-04-09 16:43:48 +01:00
varkor
eacfb330e6 Convert sort_by_key to sort_by_cached_key 2018-04-09 16:43:48 +01:00
bors
4b9b70c394 Auto merge of #49805 - nrc:update, r=kennytm
Update Rustfmt

r? @alexcrichton

Fixes broken rustfmt
2018-04-09 11:04:15 +00:00
Nick Cameron
7e297ff96a Update Rustfmt 2018-04-09 21:55:07 +12:00
bors
561fb39559 Auto merge of #49778 - tamird:install-relative-prefix, r=Mark-Simulacrum
rustbuild: canonicalize prefix `install_sh`

Testing:
```
  $ git diff
  diff --git a/config.toml.example b/config.toml.example
  index 9dd3002506..b47bc490cd 100644
  --- a/config.toml.example
  +++ b/config.toml.example
  @@ -196,7 +196,7 @@
   [install]

   # Instead of installing to /usr/local, install to this path instead.
  -#prefix = "/usr/local"
  +prefix = "install-prefix"

   # Where to install system configuration files
   # If this is a relative path, it will get installed in `prefix` above
  $ mkdir install-prefix
  $ ./x.py install -i --stage 0 --config config.toml.example
  ...
  $ ls install-prefix/
  bin	lib	share
```

Closes #36989.

r? @Mark-Simulacrum
2018-04-09 06:05:49 +00:00
bors
8ae79efce3 Auto merge of #49673 - ollie27:stab, r=sfackler
Correct a few stability attributes

* `const_indexing` language feature was stabilized in 1.26.0 by #46882
* `Display` impls for `PanicInfo` and `Location` were stabilized in 1.26.0 by #47687
* `TrustedLen` is still unstable so its impls should be as well even though `RangeInclusive` was stabilized by #47813
* `!Send` and `!Sync` for `Args` and `ArgsOs` were stabilized in 1.26.0 by #48005
* `EscapeDefault` has been stable since 1.0.0 so should continue to show that even though it was moved to core in #48735

This could be backported to beta like #49612
2018-04-09 03:32:32 +00:00
bors
292685e896 Auto merge of #49770 - tamird:csv-dumper-comment, r=nrc
Remove mention of CsvDumper

...it was removed in 9a47160.

Updates #18582.

r? @nrc
2018-04-09 00:50:39 +00:00
Mark Simulacrum
c115cc655c Move deny(warnings) into rustbuild
This permits easier iteration without having to worry about warnings
being denied.

Fixes #49517
2018-04-08 16:59:14 -06:00