]> git.lizzy.rs Git - rust.git/log
rust.git
5 years ago[nll] librustc_passes: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:09:07 +0000 (04:09 -0400)]
[nll] librustc_passes: enable feature(nll) for bootstrap

5 years ago[nll] librustc_errors: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:08:45 +0000 (04:08 -0400)]
[nll] librustc_errors: enable feature(nll) for bootstrap

5 years ago[nll] librustc_asan: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:08:17 +0000 (04:08 -0400)]
[nll] librustc_asan: enable feature(nll) for bootstrap

5 years ago[nll] libarena: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:07:59 +0000 (04:07 -0400)]
[nll] libarena: enable feature(nll) for bootstrap

5 years agoAuto merge of #53088 - matthewjasper:closure-region-spans, r=nikomatsakis
bors [Wed, 8 Aug 2018 12:48:32 +0000 (12:48 +0000)]
Auto merge of #53088 - matthewjasper:closure-region-spans, r=nikomatsakis

[NLL] Use span of the closure args in free region errors

Also adds a note when one of the free regions is BrEnv.
In a future PR I'll change these messages to say "return requires", which should improve them a bit more.

r? @nikomatsakis

5 years agoAuto merge of #52872 - faern:use-modern-alignment-libc, r=TimNN
bors [Wed, 8 Aug 2018 10:42:04 +0000 (10:42 +0000)]
Auto merge of #52872 - faern:use-modern-alignment-libc, r=TimNN

Make IpvXAddr::new const fns and the well known addresses associated constants

Implements/fixes https://github.com/rust-lang/rust/issues/44582

I just got a PR towards libc (https://github.com/rust-lang/libc/pull/1044) merged. With the new feature added in that PR it is now possible to create `in6_addr` instances as consts. This enables us to finally make the constructors of the IP structs const fns and to make the localhost/unspecified addresses associated constants, as agreed in the above mentioned tracking issue.

I also added a BROADCAST constant. Personally this is the well known address I tend to need the most often.

5 years agoUse repr(align(x)) for redox in6_addr
Linus Färnstrand [Wed, 8 Aug 2018 07:57:40 +0000 (09:57 +0200)]
Use repr(align(x)) for redox in6_addr

5 years agoUpdate libc to 0.2.43 in Cargo.lock
Linus Färnstrand [Tue, 7 Aug 2018 20:33:22 +0000 (22:33 +0200)]
Update libc to 0.2.43 in Cargo.lock

5 years agoSimplify Ipv6Addr::from(octets) to not use unsafe
Linus Färnstrand [Mon, 6 Aug 2018 13:51:11 +0000 (15:51 +0200)]
Simplify Ipv6Addr::from(octets) to not use unsafe

5 years agoSimplify is_broadcast
Linus Färnstrand [Sun, 29 Jul 2018 20:35:31 +0000 (22:35 +0200)]
Simplify is_broadcast

5 years agoAdd Ipv4Addr BROADCAST assoc const
Linus Färnstrand [Sun, 29 Jul 2018 20:24:19 +0000 (22:24 +0200)]
Add Ipv4Addr BROADCAST assoc const

5 years agoMove IPs to assoc consts
Linus Färnstrand [Fri, 20 Jul 2018 07:09:48 +0000 (09:09 +0200)]
Move IPs to assoc consts

5 years agoMake Ipv{4,6}Addr::new const fns
Linus Färnstrand [Thu, 19 Jul 2018 23:14:56 +0000 (01:14 +0200)]
Make Ipv{4,6}Addr::new const fns

5 years agoUpdate libc and activate align feature
Linus Färnstrand [Tue, 17 Jul 2018 18:15:58 +0000 (20:15 +0200)]
Update libc and activate align feature

5 years agoAuto merge of #53053 - petrochenkov:custattr, r=alexcrichton
bors [Wed, 8 Aug 2018 08:37:56 +0000 (08:37 +0000)]
Auto merge of #53053 - petrochenkov:custattr, r=alexcrichton

resolve:  Support custom attributes when macro modularization is enabled

Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute.

Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`).
Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it).

The first two commits are preliminary cleanups/refactorings.

5 years agoAuto merge of #53141 - nrc:update, r=nrc
bors [Wed, 8 Aug 2018 06:38:13 +0000 (06:38 +0000)]
Auto merge of #53141 - nrc:update, r=nrc

Update RLS, Rustfmt, and Clippy

Fixes bustage due to https://github.com/rust-lang/rust/pull/52332

r? @kennytm

5 years agoPrevent duplication of rust-ap-syntax
Nick Cameron [Wed, 8 Aug 2018 06:09:36 +0000 (18:09 +1200)]
Prevent duplication of rust-ap-syntax

author: alexcrichton

5 years agoUpdate RLS and Rustfmt
Nick Cameron [Mon, 6 Aug 2018 23:47:58 +0000 (11:47 +1200)]
Update RLS and Rustfmt

5 years agoAuto merge of #52993 - alexcrichton:fix-some-vis, r=michaelwoerister
bors [Wed, 8 Aug 2018 01:24:15 +0000 (01:24 +0000)]
Auto merge of #52993 - alexcrichton:fix-some-vis, r=michaelwoerister

rustc: Tweak visibility of some lang items

This commit tweaks the linker-level visibility of some lang items that rustc
uses and defines. Notably this means that `#[panic_implementation]` and
`#[alloc_error_handler]` functions are never marked as `internal`. It's up to
the linker to eliminate these, not rustc.

Additionally `#[global_allocator]` generated symbols are no longer forced to
`Default` visibility (fully exported), but rather they're relaxed to `Hidden`
visibility). This symbols are *not* needed across DLL boundaries, only as a
local implementation detail of the compiler-injected allocator symbols, so
`Hidden` should suffice.

Closes #51342
Closes #52795

5 years agoAuto merge of #52397 - estebank:println-comma, r=oli-obk
bors [Tue, 7 Aug 2018 22:15:25 +0000 (22:15 +0000)]
Auto merge of #52397 - estebank:println-comma, r=oli-obk

Suggest comma when writing `println!("{}" a);`

Fix #49370.

5 years agoAuto merge of #52911 - Mark-Simulacrum:visibility-hirid, r=oli-obk
bors [Tue, 7 Aug 2018 19:10:17 +0000 (19:10 +0000)]
Auto merge of #52911 - Mark-Simulacrum:visibility-hirid, r=oli-obk

Add HirId to VisibilityKind::Restricted

I'm not confident that these changes are correct -- mostly just tried to copy previous PRs.

Specifically, it's unclear to me if/how to remove the NodeId now that we have HirIds in more structs; is that a all-at-once change that'll happen later?

5 years agoAdd HirId to VisibilityKind::Restricted
Mark Rousskov [Tue, 31 Jul 2018 16:43:51 +0000 (10:43 -0600)]
Add HirId to VisibilityKind::Restricted

5 years agoAuto merge of #53109 - nikomatsakis:nll-escaping-into-return-revert, r=nikomatsakis
bors [Tue, 7 Aug 2018 16:01:27 +0000 (16:01 +0000)]
Auto merge of #53109 - nikomatsakis:nll-escaping-into-return-revert, r=nikomatsakis

revert #52991

Reverts https://github.com/rust-lang/rust/pull/52991 which is flawed. I have an idea how to fix it but might as well revert first since it is so wildly flawed. That's what I get for opening PRs while on PTO =)

r? @pnkfelix

5 years agorustc: Tweak visibility of some lang items
Alex Crichton [Thu, 2 Aug 2018 19:30:43 +0000 (12:30 -0700)]
rustc: Tweak visibility of some lang items

This commit tweaks the linker-level visibility of some lang items that rustc
uses and defines. Notably this means that `#[panic_implementation]` and
`#[alloc_error_handler]` functions are never marked as `internal`. It's up to
the linker to eliminate these, not rustc.

Additionally `#[global_allocator]` generated symbols are no longer forced to
`Default` visibility (fully exported), but rather they're relaxed to `Hidden`
visibility). This symbols are *not* needed across DLL boundaries, only as a
local implementation detail of the compiler-injected allocator symbols, so
`Hidden` should suffice.

Closes #51342
Closes #52795

5 years agorustc: Refactor MonoItem linkage/visibility calculation
Alex Crichton [Thu, 2 Aug 2018 19:06:57 +0000 (12:06 -0700)]
rustc: Refactor MonoItem linkage/visibility calculation

The previous iteration was a large `match` which was quite heavily indented,
making it slightly difficult to read and see what was going on. This iteration
is a refactoring (no functional change intended) to make it a bit easier on the
eyes and a bit easier to modify over time.

5 years agoAuto merge of #51990 - oli-obk:unstable_union, r=nikomatsakis
bors [Tue, 7 Aug 2018 13:14:37 +0000 (13:14 +0000)]
Auto merge of #51990 - oli-obk:unstable_union, r=nikomatsakis

Place unions, pointer casts and pointer derefs behind extra feature gates

To ensure we don't stabilize these things together with const fn stabilization (or any other stabilization)

This PR moves union field accesses inside `const fn` behind a feature gate. It was possible without a feature gate before, but since `const fn` was behind a feature gate we can do this change.

While "dereferencing raw pointers" and "casting raw pointers to usize" were hard errors before this PR, one could work around them by abusing unions:

```rust
// deref
union Foo<T> {
    x: &'static T,
    y: *const T,
}
const FOO: u32 = unsafe { *Foo { y: 42 as *const T }.x };

// as usize cast
union Bar<T> {
    x: usize,
    y: *const T,
}
const BAR: usize = unsafe { Bar { y: &1u8 }.x };
```

r? @eddyb

cc @nikomatsakis

5 years agoFix tidy
Oliver Schneider [Fri, 3 Aug 2018 12:22:22 +0000 (14:22 +0200)]
Fix tidy

5 years agoMake sure the feature gate actually works and never allows promoting these operations
Oliver Schneider [Fri, 3 Aug 2018 11:27:35 +0000 (13:27 +0200)]
Make sure the feature gate actually works and never allows promoting these operations

5 years agoAdd feature gate test
Oliver Schneider [Fri, 3 Aug 2018 10:33:47 +0000 (12:33 +0200)]
Add feature gate test

5 years agoAlso put comparing raw pointers behind a feature gate
Oliver Schneider [Fri, 3 Aug 2018 09:12:10 +0000 (11:12 +0200)]
Also put comparing raw pointers behind a feature gate

5 years agoRebase fallout: new tests need updated ui output
Oliver Schneider [Tue, 17 Jul 2018 11:46:48 +0000 (13:46 +0200)]
Rebase fallout: new tests need updated ui output

5 years agoDon't accidentally promote union access in MIR
Oliver Schneider [Fri, 13 Jul 2018 14:55:15 +0000 (16:55 +0200)]
Don't accidentally promote union access in MIR

5 years agoUse the correct feature gate name
Oliver Schneider [Fri, 13 Jul 2018 08:53:46 +0000 (10:53 +0200)]
Use the correct feature gate name

5 years agoAdd feature gate checks
Oliver Schneider [Mon, 2 Jul 2018 17:59:39 +0000 (19:59 +0200)]
Add feature gate checks

5 years agoPlace unions, pointer casts and pointer derefs behind extra feature gates
Oliver Schneider [Mon, 2 Jul 2018 17:00:07 +0000 (19:00 +0200)]
Place unions, pointer casts and pointer derefs behind extra feature gates

5 years agoAuto merge of #53150 - kennytm:rollup, r=kennytm
bors [Tue, 7 Aug 2018 11:00:07 +0000 (11:00 +0000)]
Auto merge of #53150 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

Successful merges:

 - #52885 (Remove some unused method arguments from typeck)
 - #52886 (cleanup: Remove `Def::GlobalAsm`)
 - #53028 (Building librustc_codegen_llvm in a separate directory)
 - #53052 (fixed broken links to char)
 - #53060 (Change rustdoc style so fully qualified name does not overlap src link)
 - #53068 (Rename Executor trait to Spawn)
 - #53093 (Enable macros to pass $:literal to another macro)
 - #53107 (Remove references to `StaticMutex` which got removed a while ago)
 - #53135 (Rust 2018: Disable catch_expr, not targeted for 2018 edition)
 - #53139 (set emit_debug_gdb_scripts: false for riscv32imac-unknown-none target)

5 years agoRollup merge of #53139 - danc86:riscv-no-gdb-scripts, r=petrochenkov
kennytm [Tue, 7 Aug 2018 10:52:20 +0000 (18:52 +0800)]
Rollup merge of #53139 - danc86:riscv-no-gdb-scripts, r=petrochenkov

set emit_debug_gdb_scripts: false for riscv32imac-unknown-none target

Same as the other embedded targets, see:
https://github.com/rust-lang/rust/pull/49728

This is a temporary workaround for #44993.

5 years agoRollup merge of #53135 - joshtriplett:remove-catch-from-2018-preview, r=Mark-Simulacrum
kennytm [Tue, 7 Aug 2018 10:51:51 +0000 (18:51 +0800)]
Rollup merge of #53135 - joshtriplett:remove-catch-from-2018-preview, r=Mark-Simulacrum

Rust 2018: Disable catch_expr, not targeted for 2018 edition

Fixes #52604

5 years agoRollup merge of #53107 - RalfJung:static-mutex, r=alexcrichton
kennytm [Tue, 7 Aug 2018 08:55:44 +0000 (16:55 +0800)]
Rollup merge of #53107 - RalfJung:static-mutex, r=alexcrichton

Remove references to `StaticMutex` which got removed a while ago

`StaticMutex` got removed two years ago with https://github.com/rust-lang/rust/pull/34705, but still got referenced in some comments and even an error explanation.

5 years agoRollup merge of #53093 - 0e4ef622:issue-52169-fix, r=petrochenkov
kennytm [Tue, 7 Aug 2018 08:55:43 +0000 (16:55 +0800)]
Rollup merge of #53093 - 0e4ef622:issue-52169-fix, r=petrochenkov

Enable macros to pass $:literal to another macro

Fixes #52169.

5 years agoRollup merge of #53068 - MajorBreakfast:spawn, r=cramertj
kennytm [Tue, 7 Aug 2018 08:55:42 +0000 (16:55 +0800)]
Rollup merge of #53068 - MajorBreakfast:spawn, r=cramertj

Rename Executor trait to Spawn

Renames the `Executor` trait to `Spawn` and the method on `Context` to `spawner`.

Note: Best only merge this after we've the alpha 3 announcement post ready.

r? @cramertj

5 years agoRollup merge of #53060 - iliekturtles:rustdoc-style, r=GuillaumeGomez
kennytm [Tue, 7 Aug 2018 08:55:41 +0000 (16:55 +0800)]
Rollup merge of #53060 - iliekturtles:rustdoc-style, r=GuillaumeGomez

Change rustdoc style so fully qualified name does not overlap src link

A type's fully qualified name will now wrap once it gets to the
`[-][src]` link aligned against the right edge of the content area.
Previously the two would overlap and the name would only wrap when
hitting the edge of the content area.

Before:
![image](https://user-images.githubusercontent.com/5081378/43676506-cf548758-97c0-11e8-80a0-a812d8ea0eef.png)

After:
![image](https://user-images.githubusercontent.com/5081378/43676509-e78810a6-97c0-11e8-8cd4-b90bd5858a5f.png)

5 years agoRollup merge of #53052 - redroc:master, r=QuietMisdreavus
kennytm [Tue, 7 Aug 2018 08:55:40 +0000 (16:55 +0800)]
Rollup merge of #53052 - redroc:master, r=QuietMisdreavus

fixed broken links to char

fixes https://github.com/rust-lang/rust/issues/32129

5 years agoRollup merge of #53028 - Mark-Simulacrum:split-out-codegen, r=alexcrichton
kennytm [Tue, 7 Aug 2018 08:55:38 +0000 (16:55 +0800)]
Rollup merge of #53028 - Mark-Simulacrum:split-out-codegen, r=alexcrichton

Building librustc_codegen_llvm in a separate directory

This allows clearing it out and building it separately from the
compiler. Since it's essentially a different and separate crate this
makes sense to do, each cargo invocation should generally happen in its
own directory.

r? @alexcrichton

5 years agoRollup merge of #52886 - petrochenkov:noga, r=alexcrichton
kennytm [Tue, 7 Aug 2018 08:55:37 +0000 (16:55 +0800)]
Rollup merge of #52886 - petrochenkov:noga, r=alexcrichton

cleanup: Remove `Def::GlobalAsm`

Global asm is not something that needs to have a `Def` or `DefId`.

5 years agoRollup merge of #52885 - Mark-Simulacrum:cleanup-typeck, r=nikomatsakis
kennytm [Tue, 7 Aug 2018 08:55:36 +0000 (16:55 +0800)]
Rollup merge of #52885 - Mark-Simulacrum:cleanup-typeck, r=nikomatsakis

Remove some unused method arguments from typeck

None

5 years agoAuto merge of #52450 - PramodBisht:issue/52413, r=estebank
bors [Tue, 7 Aug 2018 08:50:12 +0000 (08:50 +0000)]
Auto merge of #52450 - PramodBisht:issue/52413, r=estebank

Closes #52413: Provide structured suggestion instead of label

Provide structured suggestion instead of label
r? @estebank

5 years agofix typo
Esteban Küber [Tue, 7 Aug 2018 06:46:28 +0000 (23:46 -0700)]
fix typo

5 years agoPoint at correct span when missing comma in `println`
Esteban Küber [Tue, 7 Aug 2018 03:54:51 +0000 (20:54 -0700)]
Point at correct span when missing comma in `println`

5 years agoSuggest comma when writing `println!("{}" a);`
Esteban Küber [Sun, 15 Jul 2018 06:50:08 +0000 (23:50 -0700)]
Suggest comma when writing `println!("{}" a);`

5 years agoAuto merge of #51007 - AstralSorcerer:master, r=nagisa
bors [Tue, 7 Aug 2018 02:12:35 +0000 (02:12 +0000)]
Auto merge of #51007 - AstralSorcerer:master, r=nagisa

Make globals with private linkage unnamed. Fixes #50862.

cc @oli-obk @nagisa

5 years agoset emit_debug_gdb_scripts: false for riscv32imac-unknown-none target
Dan Callaghan [Mon, 6 Aug 2018 23:18:23 +0000 (09:18 +1000)]
set emit_debug_gdb_scripts: false for riscv32imac-unknown-none target

Same as the other embedded targets, see:
https://github.com/rust-lang/rust/pull/49728

This is a temporary workaround for #44993.

5 years agoAuto merge of #53134 - alexcrichton:tweak-travis, r=Mark-Simulacrum
bors [Tue, 7 Aug 2018 00:07:56 +0000 (00:07 +0000)]
Auto merge of #53134 - alexcrichton:tweak-travis, r=Mark-Simulacrum

More debugging for travis shutting down

Requested by Travis!

5 years agoAuto merge of #53016 - scottmcm:impl-header-lifetime-elision, r=nikomatsakis
bors [Mon, 6 Aug 2018 21:45:32 +0000 (21:45 +0000)]
Auto merge of #53016 - scottmcm:impl-header-lifetime-elision, r=nikomatsakis

Extract impl_header_lifetime_elision out of in_band_lifetimes

This way we can experiment with `impl Debug for &MyType` separately from `impl Debug for &'a MyType`.

I can't say I know what the code in here is doing, so please let me know if there's a better way :slightly_smiling_face:

I marked this as enabled in 2018 so that edition code continues to work without another flag.

Actual feature PR https://github.com/rust-lang/rust/pull/49251; Tracking Issue https://github.com/rust-lang/rust/issues/15872; In-band lifetimes tracking issue https://github.com/rust-lang/rust/issues/44524.

cc @aturon, per discussion on discord earlier
cc @cramertj & @nikomatsakis, who actually wrote these features

5 years agoRust 2018: Disable catch_expr, not targeted for 2018 edition
Josh Triplett [Mon, 6 Aug 2018 21:45:19 +0000 (14:45 -0700)]
Rust 2018: Disable catch_expr, not targeted for 2018 edition

Fixes #52604

5 years agoMore debugging for travis shutting down
Alex Crichton [Mon, 6 Aug 2018 21:23:13 +0000 (14:23 -0700)]
More debugging for travis shutting down

Requested by Travis!

5 years agoAddress review comments
Vadim Petrochenkov [Sat, 4 Aug 2018 02:17:51 +0000 (05:17 +0300)]
Address review comments

Adjust a few fulldeps and pretty-printing tests
Fix rebase

5 years agoName return type in free region messages
Matthew Jasper [Mon, 6 Aug 2018 20:42:26 +0000 (21:42 +0100)]
Name return type in free region messages

5 years agoEnable macro modularization implicitly if one of "advanced" macro features is enabled
Vadim Petrochenkov [Sat, 4 Aug 2018 00:37:14 +0000 (03:37 +0300)]
Enable macro modularization implicitly if one of "advanced" macro features is enabled

Do not mark all builtin attributes as used when macro modularization is enabled

5 years agoSupport custom attributes when macro modularization is enabled
Vadim Petrochenkov [Fri, 3 Aug 2018 21:25:45 +0000 (00:25 +0300)]
Support custom attributes when macro modularization is enabled

5 years agoAvoid modifying invocations in place for derive helper attributes
Vadim Petrochenkov [Thu, 2 Aug 2018 23:30:03 +0000 (02:30 +0300)]
Avoid modifying invocations in place for derive helper attributes

5 years agoDiscern between various kinds of non-macro attributes
Vadim Petrochenkov [Thu, 2 Aug 2018 23:05:00 +0000 (02:05 +0300)]
Discern between various kinds of non-macro attributes

5 years agoAuto merge of #53115 - davidtwco:issue-52739, r=nikomatsakis
bors [Mon, 6 Aug 2018 19:15:05 +0000 (19:15 +0000)]
Auto merge of #53115 - davidtwco:issue-52739, r=nikomatsakis

Disable some nice region errors in NLL mode.

Fixes #52739. cc #52742.

r? @nikomatsakis

5 years agoDisable some nice region errors in NLL mode.
David Wood [Mon, 6 Aug 2018 16:33:05 +0000 (18:33 +0200)]
Disable some nice region errors in NLL mode.

5 years ago#52413: addressed @estebank's Nit
Pramod Bisht [Mon, 6 Aug 2018 17:56:24 +0000 (17:56 +0000)]
#52413: addressed @estebank's Nit

5 years agoAuto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
bors [Mon, 6 Aug 2018 16:58:27 +0000 (16:58 +0000)]
Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats

Add errors for unknown, stable and duplicate feature attributes

- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.

```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`

#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0

#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```

Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).

There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.

5 years agoSpecial-case "test" feature
varkor [Mon, 6 Aug 2018 15:46:08 +0000 (16:46 +0100)]
Special-case "test" feature

5 years agoAuto merge of #52990 - Aaron1011:fix/rustdoc-auto-trait-static, r=eddyb
bors [Mon, 6 Aug 2018 14:07:22 +0000 (14:07 +0000)]
Auto merge of #52990 - Aaron1011:fix/rustdoc-auto-trait-static, r=eddyb

Fix ICE when rustdoc encounters certain usages of HRTBs

Fixes #51236

Under certain circumstances, `AutoTraitFinder` could end up computing a `ParamEnv` involving two trait predicates that differed only in the region parameters involved. One of these parameters would be a HRTB, while the other would be a normal region parameter.

When this `ParamEnv` was later passed to `SelectionContext`, an `Ambiguity` error would occur, since the erased versions of these predicates would be identical. To solve the issue, we de-duplicate our list of predicates as we build it up. Whenever we encounter two predicates that differ only in their assignment of region parameters (a HRTB vs a normal lifetime parameter), we pick the HRTB. This corresponds to selecting a 'stricter' bound to display in the generated documentation: we're requiring that a particular type works for all possible lifetime parameters if it's going to implement a particular auto trait.

5 years agoadd test case showing how previous attempt was unsound
Niko Matsakis [Mon, 6 Aug 2018 10:17:39 +0000 (12:17 +0200)]
add test case showing how previous attempt was unsound

5 years agoBuilding librustc_codegen_llvm in a separate directory
Mark Rousskov [Fri, 3 Aug 2018 13:22:42 +0000 (07:22 -0600)]
Building librustc_codegen_llvm in a separate directory

This allows clearing it out and building it separately from the
compiler. Since it's essentially a different and separate crate this
makes sense to do, each cargo invocation should generally happen in its
own directory.

5 years agorevert #52991
Niko Matsakis [Mon, 6 Aug 2018 10:14:47 +0000 (12:14 +0200)]
revert #52991

5 years agoAuto merge of #53045 - pnkfelix:issue-53026-migrate-never-looser-than-ast-borrowck...
bors [Mon, 6 Aug 2018 12:00:12 +0000 (12:00 +0000)]
Auto merge of #53045 - pnkfelix:issue-53026-migrate-never-looser-than-ast-borrowck, r=estebank

Fix NLL migration mode so that reports region errors when necessary.

The code here was trying to be clever, and say "lets not report diagnostics when we 'know' NLL will report an error about them in the future."

The problem is that in migration mode, when no error was reported here, the NLL error that we "knew" was coming was downgraded to a warning (!).

Thus causing #53026

(I hope it is the only instance of such a scenario, but we will see.)

Anyway, this PR fixes that by only doing the "clever" skipping of region error reporting when we are not in migration mode. As noted in the FIXME, I'm not really thrilled with this band-aid, but it is small enough to be back-ported easily if that is necessary.

Rather than make a separate test for issue 53026, I just took the test that uncovered this in a first place, and extended it (via our revisions system) to explicitly show all three modes in action: AST-borrowck, NLL, and NLL migration mode.

(To be honest I hope not to have to add such revisions to many tests. Instead I hope to adopt some sort of new `compare-mode` for either borrowck=migrate or for the 2018 edition as a whole.)

Fix #53026

5 years agoRemove references to `StaticMutex` which got removed a while ago
Ralf Jung [Mon, 6 Aug 2018 10:34:00 +0000 (12:34 +0200)]
Remove references to `StaticMutex` which got removed a while ago

5 years agoRename Executor trait to Spawn
Josef Reinhard Brandl [Mon, 6 Aug 2018 08:22:13 +0000 (10:22 +0200)]
Rename Executor trait to Spawn

5 years agoAuto merge of #52332 - zackmdavis:dead_code_lint_should_say_2_electric_boogaloo,...
bors [Mon, 6 Aug 2018 07:02:11 +0000 (07:02 +0000)]
Auto merge of #52332 - zackmdavis:dead_code_lint_should_say_2_electric_boogaloo, r=pnkfelix

dead-code lint: say "constructed" for structs

Respectively.

This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been
reported (more than once—at least #19140, #44083, and #44565) that the
"never used" language was confusing for enum variants that were "used"
as match patterns, so the wording was changed to say never "constructed"
specifically for enum variants. More recently, the same issue was raised
for structs (#52325). It seems consistent to say "constructed" here,
too, for the same reasons.

~~While we're here, we can also use more specific word "called" for unused
functions and methods. (We declined to do this in #46103, but the
rationale given in the commit message doesn't actually make sense.)~~

This resolves #52325.

5 years agoAuto merge of #53002 - QuietMisdreavus:brother-may-i-have-some-loops, r=pnkfelix
bors [Mon, 6 Aug 2018 01:53:58 +0000 (01:53 +0000)]
Auto merge of #53002 - QuietMisdreavus:brother-may-i-have-some-loops, r=pnkfelix

make `everybody_loops` preserve item declarations

First half of https://github.com/rust-lang/rust/issues/52545.

`everybody_loops` is used by rustdoc to ensure we don't contain erroneous references to platform APIs if one of its uses is pulled in by `#[doc(cfg)]`. However, you can also implement traits for public types inside of functions. This is used by Diesel (probably others, but they were the example that was reported) to get around a recent macro hygiene fix, which has caused their crate to fail to document. While this won't make the traits show up in documentation (that step comes later), it will at least allow files to be generated.

5 years agoAuto merge of #52997 - llogiq:tiny-list-opt, r=varkor
bors [Sun, 5 Aug 2018 22:41:07 +0000 (22:41 +0000)]
Auto merge of #52997 - llogiq:tiny-list-opt, r=varkor

data_structures: make TinyList more readable and optimize remove(_)

also add benchmarks

Before:

```
test tiny_list::test::bench_insert_empty             ... bench:           1 ns/iter (+/- 0)
test tiny_list::test::bench_insert_one               ... bench:          16 ns/iter (+/- 0)
test tiny_list::test::bench_remove_empty             ... bench:           2 ns/iter (+/- 0)
test tiny_list::test::bench_remove_one               ... bench:           6 ns/iter (+/- 0)
test tiny_list::test::bench_remove_unknown           ... bench:           4 ns/iter (+/- 0)
```

After:

```
test tiny_list::test::bench_insert_empty             ... bench:           1 ns/iter (+/- 0)
test tiny_list::test::bench_insert_one               ... bench:          16 ns/iter (+/- 0)
test tiny_list::test::bench_remove_empty             ... bench:           0 ns/iter (+/- 0)
test tiny_list::test::bench_remove_one               ... bench:           3 ns/iter (+/- 0)
test tiny_list::test::bench_remove_unknown           ... bench:           2 ns/iter (+/- 0)
```

5 years agoFix WASM tests
varkor [Sun, 5 Aug 2018 21:48:49 +0000 (22:48 +0100)]
Fix WASM tests

5 years agoFix diagnostic_list error
varkor [Sun, 5 Aug 2018 16:43:30 +0000 (17:43 +0100)]
Fix diagnostic_list error

5 years agoAuto merge of #52800 - QuietMisdreavus:do-not-pass-go, r=GuillaumeGomez
bors [Sun, 5 Aug 2018 18:45:01 +0000 (18:45 +0000)]
Auto merge of #52800 - QuietMisdreavus:do-not-pass-go, r=GuillaumeGomez

rustdoc: refactor how passes are structured, and turn intra-doc-link collection into a pass

This builds on https://github.com/rust-lang/rust/pull/52751 and should not be merged until that finally finishes the bors queue

Part 2 of my passes refactor. This introduces the concept of an "early pass", which is run right before exiting the compiler context. This is important for passes that may want to ask the compiler about things. For example, i took out the intra-doc-link collection and turned it into a early pass. I also made the `strip-hidden`, `strip-private` and `strip-priv-imports` passes occur as early passes, so that intra-doc-link collection wouldn't run on docs that weren't getting printed.

Fixes https://github.com/rust-lang/rust/issues/51684, technically https://github.com/rust-lang/rust/issues/51468 too but that version of `h2` hits a legit intra-link error after that `>_>`

r? @rust-lang/rustdoc

5 years agoCloses #52413: Provide structured suggestion instead of label
Pramod Bisht [Sun, 5 Aug 2018 18:44:03 +0000 (18:44 +0000)]
Closes #52413: Provide structured suggestion instead of label

5 years agoFix failure on msvc
varkor [Sun, 5 Aug 2018 14:55:18 +0000 (15:55 +0100)]
Fix failure on msvc

5 years agoEnable macros to pass $:literal to another macro
Matthew Tran [Sun, 5 Aug 2018 15:37:48 +0000 (10:37 -0500)]
Enable macros to pass $:literal to another macro

5 years agoChange feature edition error into a warning
varkor [Fri, 3 Aug 2018 20:12:57 +0000 (21:12 +0100)]
Change feature edition error into a warning

5 years agoFix 2018 edition tests
varkor [Thu, 2 Aug 2018 18:33:24 +0000 (19:33 +0100)]
Fix 2018 edition tests

5 years agoRemove references to unknown feature `io`
varkor [Thu, 2 Aug 2018 16:36:08 +0000 (17:36 +0100)]
Remove references to unknown feature `io`

5 years agoAdd an error when declaring features that are stable in the current Rust edition
varkor [Thu, 2 Aug 2018 16:31:54 +0000 (17:31 +0100)]
Add an error when declaring features that are stable in the current Rust edition

5 years agoRemove bad features after rebase
varkor [Thu, 2 Aug 2018 14:53:18 +0000 (15:53 +0100)]
Remove bad features after rebase

5 years agoImprove query efficiency
varkor [Thu, 26 Jul 2018 23:06:57 +0000 (00:06 +0100)]
Improve query efficiency

5 years agoFix outdated handling of GetLangItems
varkor [Thu, 26 Jul 2018 22:44:36 +0000 (23:44 +0100)]
Fix outdated handling of GetLangItems

5 years agoFix stage 2 tests
varkor [Wed, 25 Jul 2018 13:27:27 +0000 (14:27 +0100)]
Fix stage 2 tests

5 years agoFix rustdoc test
varkor [Tue, 24 Jul 2018 22:32:20 +0000 (23:32 +0100)]
Fix rustdoc test

5 years agoFix run-pass-fulldeps tests
varkor [Tue, 24 Jul 2018 17:24:12 +0000 (18:24 +0100)]
Fix run-pass-fulldeps tests

5 years agoFix incremental tests
varkor [Tue, 24 Jul 2018 12:37:41 +0000 (13:37 +0100)]
Fix incremental tests

5 years agoAdd special support for libc
varkor [Mon, 23 Jul 2018 23:56:00 +0000 (00:56 +0100)]
Add special support for libc

5 years agoAdd support for feature attributes on macros
varkor [Mon, 23 Jul 2018 21:37:57 +0000 (22:37 +0100)]
Add support for feature attributes on macros

5 years agoConvert unknown_features lint into an error
varkor [Mon, 23 Jul 2018 20:05:39 +0000 (21:05 +0100)]
Convert unknown_features lint into an error

5 years agoTurn the duplicate feature lint into an error
varkor [Mon, 23 Jul 2018 16:34:04 +0000 (17:34 +0100)]
Turn the duplicate feature lint into an error

5 years agoRemove unnecessary feature attributes that sneaked in
varkor [Mon, 23 Jul 2018 13:53:39 +0000 (14:53 +0100)]
Remove unnecessary feature attributes that sneaked in

5 years agoRemove obsolete tests in tidy
varkor [Mon, 23 Jul 2018 13:12:35 +0000 (14:12 +0100)]
Remove obsolete tests in tidy

These have been replaced by more reliable checks in the compiler itself.