]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #49389 - fanzier:euclidean-division, r=KodrAus
bors [Fri, 13 Apr 2018 07:34:37 +0000 (07:34 +0000)]
Auto merge of #49389 - fanzier:euclidean-division, r=KodrAus

Implement RFC #2169 (Euclidean modulo).

Tracking issue: #49048

6 years agoAuto merge of #49360 - topecongiro:run-rustfmt/build_helper, r=nrc
bors [Fri, 13 Apr 2018 04:42:10 +0000 (04:42 +0000)]
Auto merge of #49360 - topecongiro:run-rustfmt/build_helper, r=nrc

Run rustfmt on build_helper

Using rustfmt 0.4.1-nightly (e784712f 2018-04-09).

6 years agoAuto merge of #49718 - petrochenkov:fieldcmp, r=eddyb
bors [Fri, 13 Apr 2018 01:43:09 +0000 (01:43 +0000)]
Auto merge of #49718 - petrochenkov:fieldcmp, r=eddyb

Hygiene 2.0: Avoid comparing fields by name

There are two separate commits here (not counting tests):
- The first one unifies named (`obj.name`) and numeric (`obj.0`) field access expressions in AST and HIR. Before field references in these expressions are resolved it doesn't matter whether the field is named or numeric (it's just a symbol) and 99% of code is common. After field references are resolved we work with
them by index for all fields (see the second commit), so it's again not important whether the field was named or numeric (this includes MIR where all fields were already by index).
(This refactoring actually fixed some bugs in HIR-based borrow checker where borrows through names (`S {
0: ref x }`) and indices (`&s.0`) weren't considered overlapping.)
- The second commit removes all by-name field comparison and instead resolves field references to their indices  once, and then uses those resolutions. (There are still a few name comparisons in save-analysis, because save-analysis is weird, but they are made correctly hygienic).
Thus we are fixing a bunch of "secondary" field hygiene bugs (in borrow checker, lints).

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

6 years agoAuto merge of #45298 - toidiu:ak-44493-infer-predicate, r=nikomatsakis
bors [Thu, 12 Apr 2018 23:07:07 +0000 (23:07 +0000)]
Auto merge of #45298 - toidiu:ak-44493-infer-predicate, r=nikomatsakis

Ak 44493 infer predicate

 **WIP**  Implements #44493

Things to do:

- [x] add feature gate and appropriate tests (see [forge](https://forge.rust-lang.org/feature-guide.html) for some details)
- [x] add a unit testing system similar to `#[rustc_variance]`
  - [x] to see how, maybe `rg rustc_variance` and take some notes
- [ ] add more tests:
- [x] we need to decide how to handle `struct Foo<'a, T> { x: &'a T::Item }`
- [x] handle explicit predicates on types
- [ ] handle explicit predicates on `dyn Trait` (this could be put off to a follow-up PR)
- [ ] handle explicit predicates on projections (this could be put off to a follow-up PR)

6 years agoAddress more nits.
Fabian Zaiser [Thu, 12 Apr 2018 21:12:11 +0000 (23:12 +0200)]
Address more nits.

6 years agoAdd some new tests + Fix failing tests
Vadim Petrochenkov [Sat, 7 Apr 2018 16:18:44 +0000 (19:18 +0300)]
Add some new tests + Fix failing tests

6 years agoMove hygiene tests to UI
Vadim Petrochenkov [Sat, 7 Apr 2018 14:28:31 +0000 (17:28 +0300)]
Move hygiene tests to UI

6 years agoAvoid comparing fields by name when possible
Vadim Petrochenkov [Thu, 5 Apr 2018 00:20:21 +0000 (03:20 +0300)]
Avoid comparing fields by name when possible

Resolve them into field indices once and then use those resolutions

+ Fix rebase

6 years agoAST/HIR: Merge field access expressions for named and numeric fields
Vadim Petrochenkov [Sun, 1 Apr 2018 18:48:39 +0000 (21:48 +0300)]
AST/HIR: Merge field access expressions for named and numeric fields

6 years agoImplement inferring outlives requirements for references, structs, enum, union, and...
toidiu [Sun, 15 Oct 2017 05:13:56 +0000 (01:13 -0400)]
Implement inferring outlives requirements for references, structs, enum, union, and projection types. added a feature gate and tests for these scenarios.

6 years agoAuto merge of #49558 - Zoxc:sync-misc, r=michaelwoerister
bors [Thu, 12 Apr 2018 16:22:36 +0000 (16:22 +0000)]
Auto merge of #49558 - Zoxc:sync-misc, r=michaelwoerister

Even more thread-safety changes

r? @michaelwoerister

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 agoRun rustfmt on build_helper
Seiichi Uchida [Sun, 25 Mar 2018 14:20:56 +0000 (23:20 +0900)]
Run rustfmt on build_helper

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 agoMake Session.injected_panic_runtime thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:27:46 +0000 (08:27 +0200)]
Make Session.injected_panic_runtime thread-safe

6 years agoMake Session.injected_allocator and Session.allocator_kind thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:27:09 +0000 (08:27 +0200)]
Make Session.injected_allocator and Session.allocator_kind thread-safe

6 years agoMake Session.dependency_formats thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:26:22 +0000 (08:26 +0200)]
Make Session.dependency_formats thread-safe

6 years agoMake Session.crate_types thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:26:05 +0000 (08:26 +0200)]
Make Session.crate_types thread-safe

6 years agoMake sure Session.plugin_attributes is only used on one thread
John Kåre Alsaker [Sun, 1 Apr 2018 06:25:43 +0000 (08:25 +0200)]
Make sure Session.plugin_attributes is only used on one thread

6 years agoMake sure Session.plugin_llvm_passes is only used on one thread
John Kåre Alsaker [Sun, 1 Apr 2018 06:25:21 +0000 (08:25 +0200)]
Make sure Session.plugin_llvm_passes is only used on one thread

6 years agoMake Session.has_global_allocator thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:24:46 +0000 (08:24 +0200)]
Make Session.has_global_allocator thread-safe

6 years agoMake sure Session.imported_macro_spans is only used on one thread
John Kåre Alsaker [Sun, 1 Apr 2018 06:24:31 +0000 (08:24 +0200)]
Make sure Session.imported_macro_spans is only used on one thread

6 years agoMake Session.crate_disambiguator thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:23:38 +0000 (08:23 +0200)]
Make Session.crate_disambiguator thread-safe

6 years agoMake sure Session.next_node_id is only used on one thread
John Kåre Alsaker [Sun, 1 Apr 2018 06:21:49 +0000 (08:21 +0200)]
Make sure Session.next_node_id is only used on one thread

6 years agoMake Session.code_stats thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:21:34 +0000 (08:21 +0200)]
Make Session.code_stats thread-safe

6 years agoMake Session::features_untracked thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:21:21 +0000 (08:21 +0200)]
Make Session::features_untracked thread-safe

6 years agoDisable optimization fuel when using multiple threads
John Kåre Alsaker [Sun, 1 Apr 2018 06:20:39 +0000 (08:20 +0200)]
Disable optimization fuel when using multiple threads

6 years agoRemove Cell from const_eval_stack_frame_limit and const_eval_step_limit
John Kåre Alsaker [Sun, 1 Apr 2018 06:19:50 +0000 (08:19 +0200)]
Remove Cell from const_eval_stack_frame_limit and const_eval_step_limit

6 years agoMake sure Session.incr_comp_session is only used on one thread
John Kåre Alsaker [Sun, 1 Apr 2018 06:19:26 +0000 (08:19 +0200)]
Make sure Session.incr_comp_session is only used on one thread

6 years agoMake Session.plugin_registrar_fn and Session.derive_registrar_fn thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:18:10 +0000 (08:18 +0200)]
Make Session.plugin_registrar_fn and Session.derive_registrar_fn thread-safe

6 years agoCombine Session.entry_fn and Session.entry_type and make them thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:17:53 +0000 (08:17 +0200)]
Combine Session.entry_fn and Session.entry_type and make them thread-safe

6 years agoMake PerfStats thread-safe and remove unused fields
John Kåre Alsaker [Sun, 1 Apr 2018 06:17:25 +0000 (08:17 +0200)]
Make PerfStats thread-safe and remove unused fields

6 years agoRemove derive_macros
John Kåre Alsaker [Sun, 1 Apr 2018 06:16:36 +0000 (08:16 +0200)]
Remove derive_macros

6 years agoMake recursion_limit and type_length_limit thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:15:59 +0000 (08:15 +0200)]
Make recursion_limit and type_length_limit thread-safe

6 years agoQuerify all_traits
John Kåre Alsaker [Sun, 1 Apr 2018 06:15:25 +0000 (08:15 +0200)]
Querify all_traits

6 years agoMake sure the lint store is only used on one thread
John Kåre Alsaker [Sun, 1 Apr 2018 06:14:25 +0000 (08:14 +0200)]
Make sure the lint store is only used on one thread

6 years agoAdd a Once type for values which are only written once
John Kåre Alsaker [Sun, 1 Apr 2018 10:14:19 +0000 (12:14 +0200)]
Add a Once type for values which are only written once

6 years agoAdd insert_same extension to HashMap
John Kåre Alsaker [Sun, 1 Apr 2018 08:25:16 +0000 (10:25 +0200)]
Add insert_same extension to HashMap

6 years agoAdd OneThread which only allows its inner value to be used in one thread
John Kåre Alsaker [Sun, 1 Apr 2018 07:43:19 +0000 (09:43 +0200)]
Add OneThread which only allows its inner value to be used in one thread

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