]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #49551 - scottmcm:deprecate-offset_to, r=KodrAus
bors [Thu, 12 Apr 2018 08:29:10 +0000 (08:29 +0000)]
Auto merge of #49551 - scottmcm:deprecate-offset_to, r=KodrAus

Deprecate offset_to; switch core&alloc to using offset_from instead

Bonus: might make code than uses `.len()` on slice iterators faster

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

6 years agoAuto merge of #49371 - scottmcm:catch-wrapping, r=nikomatsakis
bors [Thu, 12 Apr 2018 05:38:49 +0000 (05:38 +0000)]
Auto merge of #49371 - scottmcm:catch-wrapping, r=nikomatsakis

Add ok-wrapping to catch blocks, per RFC

Updates the `catch{}` lowering to wrap the result in `Try::from_ok`.

r? @nikomatsakis

Fixes #41414
Fixes #43818

6 years agoAuto merge of #48528 - bitshifter:repr_packed, r=eddyb
bors [Thu, 12 Apr 2018 03:08:14 +0000 (03:08 +0000)]
Auto merge of #48528 - bitshifter:repr_packed, r=eddyb

Implementation of `#[repr(packed(n))]` RFC 1399.

Tracking issue https://github.com/rust-lang/rust/issues/33158.

6 years agoAuto merge of #49698 - SimonSapin:unicode-for-everyone, r=alexcrichton
bors [Thu, 12 Apr 2018 00:35:33 +0000 (00:35 +0000)]
Auto merge of #49698 - SimonSapin:unicode-for-everyone, r=alexcrichton

Merge the std_unicode crate into the core crate

[The standard library facade](https://github.com/rust-lang/rust/issues/27783) has historically contained a number of crates with different roles, but that number has decreased over time. `rand` and `libc` have moved to crates.io, and [`collections` was merged into `alloc`](https://github.com/rust-lang/rust/pull/42648). Today we have `core` that applies everywhere, `std` that expects a full operating system, and `alloc` in-between that only requires a memory allocator (which can be provided by users)… and `std_unicode`, which doesn’t really have a reason to be separate anymore. It contains functionality based on Unicode data tables that can be large, but as long as relevant functions are not called the tables should be removed from binaries by linkers.

This deprecates the unstable `std_unicode` crate and moves all of its contents into `core`, replacing them with `pub use` reexports. The crate can be removed later. This also removes the `CharExt` trait (replaced with inherent methods in libcore) and `UnicodeStr` trait (merged into `StrExt`). There traits were both unstable and not intended to be used or named directly.

A number of new items are newly-available in libcore and instantly stable there, but only if they were already stable in libstd.

Fixes #49319.

6 years agoMark the rest of the `unicode` feature flag as perma-unstable.
Simon Sapin [Fri, 6 Apr 2018 12:23:00 +0000 (14:23 +0200)]
Mark the rest of the `unicode` feature flag as perma-unstable.

6 years agoDedicated tracking issue for UnicodeVersion and UNICODE_VERSION.
Simon Sapin [Fri, 6 Apr 2018 12:18:28 +0000 (14:18 +0200)]
Dedicated tracking issue for UnicodeVersion and UNICODE_VERSION.

6 years agoMove core::char::printable to core::unicode::printable
Simon Sapin [Fri, 6 Apr 2018 08:26:57 +0000 (10:26 +0200)]
Move core::char::printable to core::unicode::printable

6 years agoMerge unstable Utf16Encoder into EncodeUtf16
Simon Sapin [Fri, 6 Apr 2018 08:24:01 +0000 (10:24 +0200)]
Merge unstable Utf16Encoder into EncodeUtf16

6 years agoMerge core::unicode::str into core::str
Simon Sapin [Thu, 5 Apr 2018 17:00:48 +0000 (19:00 +0200)]
Merge core::unicode::str into core::str

And the UnicodeStr trait into StrExt

6 years agoRemove the CharExt trait, now that libcore has inherent methods for char
Simon Sapin [Thu, 5 Apr 2018 16:46:16 +0000 (18:46 +0200)]
Remove the CharExt trait, now that libcore has inherent methods for char

6 years agoMove the rest of core::unicode::char to core::unicode
Simon Sapin [Thu, 5 Apr 2018 16:36:02 +0000 (18:36 +0200)]
Move the rest of core::unicode::char to core::unicode

6 years agoMove char conversions into a separate private module.
Simon Sapin [Thu, 5 Apr 2018 16:26:58 +0000 (18:26 +0200)]
Move char conversions into a separate private module.

6 years agoMove char decoding iterators into a separate private module.
Simon Sapin [Thu, 5 Apr 2018 16:02:52 +0000 (18:02 +0200)]
Move char decoding iterators into a separate private module.

6 years agoReexport from core::unicode::char in core::char rather than vice versa
Simon Sapin [Thu, 5 Apr 2018 15:56:46 +0000 (17:56 +0200)]
Reexport from core::unicode::char in core::char rather than vice versa

6 years agoMove the core::char module to its own directory
Simon Sapin [Thu, 5 Apr 2018 15:35:13 +0000 (17:35 +0200)]
Move the core::char module to its own directory

6 years agoDeprecate the std_unicode crate
Simon Sapin [Thu, 5 Apr 2018 15:20:08 +0000 (17:20 +0200)]
Deprecate the std_unicode crate

6 years agoMove contents of libstd_unicode into libcore
Simon Sapin [Thu, 5 Apr 2018 15:09:28 +0000 (17:09 +0200)]
Move contents of libstd_unicode into libcore

6 years agoMove Utf8Lossy decoder to libcore
Simon Sapin [Thu, 5 Apr 2018 13:55:28 +0000 (15:55 +0200)]
Move Utf8Lossy decoder to libcore

6 years agoMove char::REPLACEMENT_CHARACTER to libcore
Simon Sapin [Thu, 5 Apr 2018 13:45:33 +0000 (15:45 +0200)]
Move char::REPLACEMENT_CHARACTER to libcore

6 years agoAuto merge of #49875 - kennytm:rollup, r=kennytm
bors [Wed, 11 Apr 2018 21:42:32 +0000 (21:42 +0000)]
Auto merge of #49875 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

Successful merges:

 - #49525 (Use sort_by_cached_key where appropriate)
 - #49575 (Stabilize `Option::filter`.)
 - #49614 (in which the non-shorthand patterns lint keeps its own counsel in macros)
 - #49665 (Small nits to make couple of tests pass on mips targets.)
 - #49781 (add regression test for #16223 (NLL): use of collaterally moved value)
 - #49795 (Properly look for uninhabitedness of variants in niche-filling check)
 - #49809 (Stop emitting color codes on TERM=dumb)
 - #49856 (Do not uppercase-lint #[no_mangle] statics)
 - #49863 (fixed typo)
 - #49857 (Fix "fp" target feature for AArch64)
 - #49849 (Add --enable-debug flag to musl CI build script)
 - #49734 (proc_macro: Generalize `FromIterator` impl)
 - #49730 (Fix ICE with impl Trait)
 - #48270 (Replace `structurally_resolved_type` in casts check.)

Failed merges:

6 years agoRollup merge of #48270 - leodasvacas:refactor-casts, r=nikomatsakis
kennytm [Wed, 11 Apr 2018 19:41:36 +0000 (03:41 +0800)]
Rollup merge of #48270 - leodasvacas:refactor-casts, r=nikomatsakis

Replace `structurally_resolved_type` in casts check.

The behaviour of `resolve_type_vars_if_possible` is simpler and infallible. Other minor refactorings.

I'm not sure if this is backwards compatible, in theory resolving obligations between two cast checks could solve a dependency between them, but I don't know if that's actually possible and it doesn't sound like something we'd want to support.

6 years agoRollup merge of #49730 - sinkuu:fix_ice_49556, r=cramertj
kennytm [Wed, 11 Apr 2018 19:38:16 +0000 (03:38 +0800)]
Rollup merge of #49730 - sinkuu:fix_ice_49556, r=cramertj

Fix ICE with impl Trait

Fixes https://github.com/rust-lang/rust/issues/49556#issuecomment-379154713. May or may not fix 49556 itself. Closures like `|x: &'a _| x` has `ClosureSubsts` of `fn(&'a _) -> &'(ReScope) _`, so `tcx.note_and_explain_free_region` (called [here](https://github.com/rust-lang/rust/blob/a143462783cec88b7b733e8aa09990bfeb59f754/src/librustc/infer/anon_types/mod.rs#L572)) panics.

6 years agoRollup merge of #49734 - alexcrichton:generalize-token-stream, r=nikomatsakis
kennytm [Wed, 11 Apr 2018 19:37:12 +0000 (03:37 +0800)]
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

6 years agoRollup merge of #49849 - alecmocatta:master, r=alexcrichton
kennytm [Wed, 11 Apr 2018 19:25:11 +0000 (03:25 +0800)]
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.

6 years agoRollup merge of #49857 - Amanieu:aarch64_fp, r=alexcrichton
kennytm [Wed, 11 Apr 2018 17:00:56 +0000 (01:00 +0800)]
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

6 years agoRollup merge of #49863 - memoryleak47:andorid, r=oli-obk
kennytm [Wed, 11 Apr 2018 11:56:54 +0000 (19:56 +0800)]
Rollup merge of #49863 - memoryleak47:andorid, r=oli-obk

fixed typo

6 years agoRollup merge of #49856 - varkor:no_mangle-statics-unlinted, r=michaelwoerister
kennytm [Wed, 11 Apr 2018 11:56:53 +0000 (19:56 +0800)]
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.

6 years agoAuto merge of #49872 - oli-obk:clippy, r=Manishearth
bors [Wed, 11 Apr 2018 18:58:17 +0000 (18:58 +0000)]
Auto merge of #49872 - oli-obk:clippy, r=Manishearth

Update clippy and rls

r? @Manishearth

6 years agoAuto merge of #49861 - pnkfelix:compare-mode-nll-followup-2, r=nikomatsakis
bors [Wed, 11 Apr 2018 14:37:39 +0000 (14:37 +0000)]
Auto merge of #49861 - pnkfelix:compare-mode-nll-followup-2, r=nikomatsakis

Blindly checkpoint status of NLL mode ui tests

This takes the next (and potentially final?) step with #48879.

Namely, this PR got things to the point where I can successfully run `compiletest` on `src/test/ui` with `--compile-mode=nll`.

Here are the main pieces of it:

 1. To figure out how to even run `compiletest` normally on the ui directory, I ran `x.py test -vv`, and then looked for the `compiletest` invocation that mentioned `src/test/ui`.
 2. I took the aforementioned `compiletest` invocation and used it, adding `--compile-mode=nll` to the end. It had 170 failing cases.
 3. Due to #49855, I had to edit some of the tests so that they fail even under NLL, via `#[rustc_error]`. That's the first commit. (Then goto 2 to double-check no such tests remain.)
 4. I took the generated `build/target/test/foo.stderr` file for every case that failed, and blindly copied it to `src/test/foo.nll.stderr`. That's the second commit.
 5. Goto 2 until there were no failing cases.
 6. Remove any stamp files, and re-run `x.py test` to make sure that the edits and new `.nll.stderr` files haven't broken the pre-existing test suite.

6 years agoImplementation of `#[repr(packed(n))]` RFC 1399.
Cameron Hart [Sun, 4 Feb 2018 11:10:28 +0000 (22:10 +1100)]
Implementation of `#[repr(packed(n))]` RFC 1399.

6 years agoRollup merge of #49809 - Mark-Simulacrum:no-color-for-dumb, r=alexcrichton
kennytm [Wed, 11 Apr 2018 11:56:48 +0000 (19:56 +0800)]
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

6 years agoRollup merge of #49795 - nox:niche-with-uninhabited-fields, r=eddyb
kennytm [Wed, 11 Apr 2018 11:56:47 +0000 (19:56 +0800)]
Rollup merge of #49795 - nox:niche-with-uninhabited-fields, r=eddyb

Properly look for uninhabitedness of variants in niche-filling check

6 years agoRollup merge of #49781 - Robbepop:master, r=nikomatsakis
kennytm [Wed, 11 Apr 2018 11:56:46 +0000 (19:56 +0800)]
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)]`.

6 years agoRollup merge of #49665 - draganmladjenovic:mips_tests, r=nikomatsakis
kennytm [Wed, 11 Apr 2018 11:56:44 +0000 (19:56 +0800)]
Rollup merge of #49665 - draganmladjenovic:mips_tests, r=nikomatsakis

Small nits to make couple of tests pass on mips targets.

6 years agoRollup merge of #49614 - zackmdavis:the_phantom_menace, r=petrochenkov
kennytm [Wed, 11 Apr 2018 11:56:43 +0000 (19:56 +0800)]
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.

6 years agoRollup merge of #49575 - tmccombs:option-filter-stabilize, r=withoutboats
kennytm [Wed, 11 Apr 2018 11:56:42 +0000 (19:56 +0800)]
Rollup merge of #49575 - tmccombs:option-filter-stabilize, r=withoutboats

Stabilize `Option::filter`.

Fixes #45860

6 years agoRollup merge of #49525 - varkor:sort_by_cached_key-conversion, r=scottmcm
kennytm [Wed, 11 Apr 2018 11:56:41 +0000 (19:56 +0800)]
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.

6 years agoUpdate clippy and rls
Oliver Schneider [Wed, 11 Apr 2018 11:36:31 +0000 (13:36 +0200)]
Update clippy and rls

6 years agoAuto merge of #49681 - tmccombs:take-set-limit-stable, r=sfackler
bors [Wed, 11 Apr 2018 06:03:46 +0000 (06:03 +0000)]
Auto merge of #49681 - tmccombs:take-set-limit-stable, r=sfackler

Stabilize take_set_limit

Fixes #42781

6 years agoAuto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichton
bors [Wed, 11 Apr 2018 03:30:04 +0000 (03:30 +0000)]
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

6 years agoTweak span for ok-wrapping in no-tail block
Scott McMurray [Tue, 10 Apr 2018 07:45:57 +0000 (00:45 -0700)]
Tweak span for ok-wrapping in no-tail block

6 years agoFix the unstable book to account for ok-wrapping
Scott McMurray [Tue, 3 Apr 2018 16:20:24 +0000 (09:20 -0700)]
Fix the unstable book to account for ok-wrapping

6 years agoAdd a UI test that the span for the catch type error is in the right place
Scott McMurray [Tue, 3 Apr 2018 07:04:23 +0000 (00:04 -0700)]
Add a UI test that the span for the catch type error is in the right place

6 years agoAdd ok-wrapping to catch blocks, per RFC
Scott McMurray [Sun, 25 Mar 2018 07:16:16 +0000 (00:16 -0700)]
Add ok-wrapping to catch blocks, per RFC

6 years agoAllow incorrectly reported unused attribute warning
Mark Simulacrum [Mon, 9 Apr 2018 17:21:43 +0000 (11:21 -0600)]
Allow incorrectly reported unused attribute warning

6 years agoAuto merge of #49695 - michaelwoerister:unhygienic-ty-min, r=nikomatsakis
bors [Wed, 11 Apr 2018 00:51:38 +0000 (00:51 +0000)]
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.

6 years agofixed typo
memoryleak47 [Tue, 10 Apr 2018 23:34:10 +0000 (01:34 +0200)]
fixed typo

6 years agoCheckpoint the current status of NLL on `ui` tests via compare-mode=nll.
Felix S. Klock II [Tue, 10 Apr 2018 22:38:35 +0000 (00:38 +0200)]
Checkpoint the current status of NLL on `ui` tests via compare-mode=nll.

6 years agoWorkaround rust-lang/rust#49855 by forcing rustc_error in any mode, including NLL.
Felix S. Klock II [Tue, 10 Apr 2018 22:20:05 +0000 (00:20 +0200)]
Workaround rust-lang/rust#49855 by forcing rustc_error in any mode, including NLL.

NOTE: I was careful to make each change in a manner that preserves the
existing diagnostic output (usually by ensuring that no lines were
added or removed). This means that the resulting source files are not
as nice to read as they were at the start. But we will have to review
these cases by hand anyway as follow-up work, so cleanup could
reasonably happen then (or not at all).

6 years agoFix "fp" feature for AArch64
Amanieu d'Antras [Tue, 10 Apr 2018 21:34:15 +0000 (22:34 +0100)]
Fix "fp" feature for AArch64

6 years agoDo not uppercase-lint no_mangle statics
varkor [Tue, 10 Apr 2018 21:30:23 +0000 (22:30 +0100)]
Do not uppercase-lint no_mangle statics

6 years agoAuto merge of #48914 - gaurikholkar:e0389, r=nikomatsakis
bors [Tue, 10 Apr 2018 19:00:19 +0000 (19:00 +0000)]
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.

6 years agoAdd --enable-debug flag to musl CI build script
Alec Mocatta [Tue, 10 Apr 2018 17:44:47 +0000 (18:44 +0100)]
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.

6 years agoAuto merge of #49386 - GuillaumeGomez:fix-path-attribute, r=eddyb
bors [Tue, 10 Apr 2018 12:58:27 +0000 (12:58 +0000)]
Auto merge of #49386 - GuillaumeGomez:fix-path-attribute, r=eddyb

Add tcx in item_body_nested_bodies

Fixes #47391.

r? @eddyb

6 years agoAdd ignores for powerpc and s390x to target-feature-wrong.rs and update references.
dragan.mladjenovic [Tue, 10 Apr 2018 08:19:58 +0000 (10:19 +0200)]
Add ignores for powerpc and s390x to target-feature-wrong.rs and update references.

6 years agoAuto merge of #49390 - Zoxc:sync-syntax, r=michaelwoerister
bors [Tue, 10 Apr 2018 09:00:27 +0000 (09:00 +0000)]
Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoerister

More thread-safety changes

r? @michaelwoerister

6 years agoUpdate ui test references.
dragan.mladjenovic [Thu, 5 Apr 2018 13:30:41 +0000 (15:30 +0200)]
Update ui test references.

6 years agoSmall nits to make couple of tests pass on mips targets.
dragan.mladjenovic [Tue, 3 Apr 2018 14:40:05 +0000 (16:40 +0200)]
Small nits to make couple of tests pass on mips targets.

6 years agoAuto merge of #49504 - GuillaumeGomez:doc-all-types, r=QuietMisdreavus
bors [Tue, 10 Apr 2018 06:23:52 +0000 (06:23 +0000)]
Auto merge of #49504 - GuillaumeGomez:doc-all-types, r=QuietMisdreavus

Add page to list all crate's items

r? @QuietMisdreavus

6 years agoAuto merge of #49258 - zackmdavis:not_going_to_recover, r=petrochenkov
bors [Tue, 10 Apr 2018 03:27:43 +0000 (03:27 +0000)]
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

6 years agoAuto merge of #49435 - tmandry:rule-implied-bound-from-trait, r=nikomatsakis
bors [Tue, 10 Apr 2018 00:32:54 +0000 (00:32 +0000)]
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

6 years agoAuto merge of #49811 - alexcrichton:fix-android, r=SimonSapin
bors [Mon, 9 Apr 2018 21:41:10 +0000 (21:41 +0000)]
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

6 years agostd: Be sure to modify atomics in tests
Alex Crichton [Mon, 9 Apr 2018 18:40:53 +0000 (11:40 -0700)]
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

6 years agoadd regression test for issue #16223: fixed by NLL
Hero [Mon, 9 Apr 2018 18:34:09 +0000 (20:34 +0200)]
add regression test for issue #16223: fixed by NLL

6 years agotidy fixes
gaurikholkar [Mon, 9 Apr 2018 17:42:13 +0000 (23:12 +0530)]
tidy fixes

6 years agoStop emitting color codes on TERM=dumb
Mark Simulacrum [Mon, 9 Apr 2018 17:39:18 +0000 (11:39 -0600)]
Stop emitting color codes on TERM=dumb

These terminals generally don't support color.

Fixes #49191

6 years agoin which the non-shorthand patterns lint keeps its own counsel in macros
Zack M. Davis [Tue, 3 Apr 2018 02:34:52 +0000 (19:34 -0700)]
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.

6 years agoMake tidy treat "test/ui/foo.nll.stderr" just like "foo.stderr".
Felix S. Klock II [Mon, 9 Apr 2018 15:52:10 +0000 (17:52 +0200)]
Make tidy treat "test/ui/foo.nll.stderr" just like "foo.stderr".

6 years agoUse sort_by_cached_key for partitioning
varkor [Sun, 1 Apr 2018 12:28:47 +0000 (13:28 +0100)]
Use sort_by_cached_key for partitioning

6 years agoUse cmp::Reverse instead of subtraction
varkor [Sat, 31 Mar 2018 20:42:35 +0000 (21:42 +0100)]
Use cmp::Reverse instead of subtraction

6 years agoin which `!` is suggested for erroneous identifier `not`
Zack M. Davis [Thu, 22 Mar 2018 05:38:24 +0000 (22:38 -0700)]
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.

6 years agodon't suggest placing code in block if next token is open-brace
Zack M. Davis [Thu, 22 Mar 2018 04:54:06 +0000 (21:54 -0700)]
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.

6 years agoAdd trivial early return for sort_by_cached_key
varkor [Sat, 31 Mar 2018 20:40:46 +0000 (21:40 +0100)]
Add trivial early return for sort_by_cached_key

6 years agoConvert sort_by to sort_by_cached_key
varkor [Fri, 30 Mar 2018 09:54:14 +0000 (10:54 +0100)]
Convert sort_by to sort_by_cached_key

6 years agoConvert sort_unstable_by to sort_by_cached_key
varkor [Fri, 30 Mar 2018 09:44:12 +0000 (10:44 +0100)]
Convert sort_unstable_by to sort_by_cached_key

6 years agoConvert sort_unstable_by_key to sort_by_cached_key
varkor [Fri, 30 Mar 2018 09:40:25 +0000 (10:40 +0100)]
Convert sort_unstable_by_key to sort_by_cached_key

6 years agoConvert sort_by_key to sort_by_cached_key
varkor [Fri, 30 Mar 2018 09:23:27 +0000 (10:23 +0100)]
Convert sort_by_key to sort_by_cached_key

6 years agoAuto merge of #49805 - nrc:update, r=kennytm
bors [Mon, 9 Apr 2018 11:04:15 +0000 (11:04 +0000)]
Auto merge of #49805 - nrc:update, r=kennytm

Update Rustfmt

r? @alexcrichton

Fixes broken rustfmt

6 years agoUpdate Rustfmt
Nick Cameron [Mon, 9 Apr 2018 08:26:46 +0000 (20:26 +1200)]
Update Rustfmt

6 years agoAuto merge of #49778 - tamird:install-relative-prefix, r=Mark-Simulacrum
bors [Mon, 9 Apr 2018 06:05:49 +0000 (06:05 +0000)]
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

6 years agoAuto merge of #49673 - ollie27:stab, r=sfackler
bors [Mon, 9 Apr 2018 03:32:32 +0000 (03:32 +0000)]
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

6 years agoAuto merge of #49770 - tamird:csv-dumper-comment, r=nrc
bors [Mon, 9 Apr 2018 00:50:39 +0000 (00:50 +0000)]
Auto merge of #49770 - tamird:csv-dumper-comment, r=nrc

Remove mention of CsvDumper

...it was removed in 9a47160.

Updates #18582.

r? @nrc

6 years agoMove deny(warnings) into rustbuild
Mark Simulacrum [Sun, 1 Apr 2018 15:35:53 +0000 (09:35 -0600)]
Move deny(warnings) into rustbuild

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

Fixes #49517

6 years agoProperly look for uninhabitedness of variants in niche-filling check
Anthony Ramine [Sun, 1 Apr 2018 22:43:43 +0000 (00:43 +0200)]
Properly look for uninhabitedness of variants in niche-filling check

6 years agorustbuild: canonicalize prefix `install_sh`
Tamir Duberstein [Sun, 8 Apr 2018 02:50:19 +0000 (22:50 -0400)]
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.

6 years agoAuto merge of #49774 - danc86:configure.py-tools, r=alexcrichton
bors [Sun, 8 Apr 2018 21:40:44 +0000 (21:40 +0000)]
Auto merge of #49774 - danc86:configure.py-tools, r=alexcrichton

configure.py --tools should set a list instead of a string

Currently the --tools option does not work because it is setting a string value
for 'build.tools'. It should be a list of strings instead.

6 years agoAuto merge of #49771 - tamird:incremental-no-stage-1, r=Mark-Simulacrum
bors [Sun, 8 Apr 2018 19:11:47 +0000 (19:11 +0000)]
Auto merge of #49771 - tamird:incremental-no-stage-1, r=Mark-Simulacrum

Don't default to stage 1 with incremental

Closes #43177.

r? @Mark-Simulacrum

6 years agotidy fixes
gaurikholkar [Sun, 8 Apr 2018 17:27:48 +0000 (22:57 +0530)]
tidy fixes

6 years agoAuto merge of #49759 - ollie27:rustbuild_cargo, r=Mark-Simulacrum
bors [Sun, 8 Apr 2018 16:44:22 +0000 (16:44 +0000)]
Auto merge of #49759 - ollie27:rustbuild_cargo, r=Mark-Simulacrum

rustbuild: Fix setting initial cargo

Fixes #49741

r? @Mark-Simulacrum

6 years agoAuto merge of #49758 - bjorn3:miri_public_write_discriminant_value, r=oli-obk
bors [Sun, 8 Apr 2018 14:12:13 +0000 (14:12 +0000)]
Auto merge of #49758 - bjorn3:miri_public_write_discriminant_value, r=oli-obk

miri: Make write_discriminant_value public

6 years agoAuto merge of #49752 - sinkuu:fix_incrcmp_str_lit, r=oli-obk
bors [Sun, 8 Apr 2018 10:01:59 +0000 (10:01 +0000)]
Auto merge of #49752 - sinkuu:fix_incrcmp_str_lit, r=oli-obk

[incremental] Hash `Allocation`s

`HashSet::insert` returns `true` if the value did not exist, which is the timing we want to hash the `Allocation`.

Fixes #49595

cc @oli-obk

6 years agoconfigure.py --tools should set a list instead of a string
Dan Callaghan [Sun, 8 Apr 2018 04:59:15 +0000 (14:59 +1000)]
configure.py --tools should set a list instead of a string

Currently the --tools option does not work because it is setting a string value
for 'build.tools'. It should be a list of strings instead.

6 years agoAuto merge of #49714 - nikomatsakis:issue-49631, r=eddyb
bors [Sun, 8 Apr 2018 03:03:25 +0000 (03:03 +0000)]
Auto merge of #49714 - nikomatsakis:issue-49631, r=eddyb

mem-categorization, coherence fix

make mem-categorization use adjusted type for patterns: Fixes #49631

do not propagate `Err` when determing causal info: Fixes #48728

r? @eddyb

6 years agoDon't default to stage 1 with incremental
Tamir Duberstein [Sun, 8 Apr 2018 02:32:21 +0000 (22:32 -0400)]
Don't default to stage 1 with incremental

Closes #43177.

6 years agoRemove mention of CsvDumper
Tamir Duberstein [Sun, 8 Apr 2018 02:21:50 +0000 (22:21 -0400)]
Remove mention of CsvDumper

...it was removed in 9a47160.

Updates #18582.

6 years agoPrint region in case of ICE
Shotaro Yamada [Sun, 8 Apr 2018 01:34:39 +0000 (10:34 +0900)]
Print region in case of ICE

6 years agoAuto merge of #49704 - leodasvacas:fix-#49344, r=nikomatsakis
bors [Sun, 8 Apr 2018 00:28:24 +0000 (00:28 +0000)]
Auto merge of #49704 - leodasvacas:fix-#49344, r=nikomatsakis

Fix regression in defaults #49344

Fixes #49344 by not checking the well-formedness wrt defaults of predicates that contain lifetimes, which is consistent with not checking generic predicates.

r? @nikomatsakis

6 years agoAuto merge of #49678 - bobtwinkles:fix_multiple_activations, r=nikomatsakis
bors [Sat, 7 Apr 2018 19:49:39 +0000 (19:49 +0000)]
Auto merge of #49678 - bobtwinkles:fix_multiple_activations, r=nikomatsakis

two-phase borrows: support multiple activations in one statement

The need for this has arisen since the introduction of two-phase borrows on
method autorefs in #49348. r'ing @pnkfelix to keep things off Niko's plate so he can make this redundant, and @pnkfelix is familiar with the code.

Fixes #49635
Fixes #49662

r? @pnkfelix

6 years agoAuto merge of #49672 - alexcrichton:fix-another-std-core-cycle, r=michaelwoerister
bors [Sat, 7 Apr 2018 17:14:46 +0000 (17:14 +0000)]
Auto merge of #49672 - alexcrichton:fix-another-std-core-cycle, r=michaelwoerister

Fix another circular deps link args issue

It turns out that the support in #49316 wasn't enough to handle all cases
notably the example in #48661. The underlying bug was connected to panic=abort
where lang items were listed in the `missing_lang_items` sets but didn't
actually exist anywhere.

This caused the linker backend to deduce that start-group/end-group wasn't
needed because not all items were defined. Instead the missing lang items that
don't actually need to have a definition are filtered out and not considered for
the start-group/end-group arguments

Closes #48661

6 years agoAuto merge of #49692 - sinkuu:main_fix, r=arielb1
bors [Sat, 7 Apr 2018 14:33:48 +0000 (14:33 +0000)]
Auto merge of #49692 - sinkuu:main_fix, r=arielb1

Fix ICE with `main`'s return type containing lifetimes

Fixes #48890