Commit Graph

82312 Commits

Author SHA1 Message Date
bors
45a9d410f9 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 🙂

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
2018-08-06 21:45:32 +00:00
Josh Triplett
1fd8e57c5b Rust 2018: Disable catch_expr, not targeted for 2018 edition
Fixes #52604
2018-08-06 14:45:19 -07:00
Alex Crichton
43974b2b71 More debugging for travis shutting down
Requested by Travis!
2018-08-06 14:23:13 -07:00
Vadim Petrochenkov
50886115d7 Address review comments
Adjust a few fulldeps and pretty-printing tests
Fix rebase
2018-08-06 23:55:53 +03:00
Matthew Jasper
b13e3f8770 Name return type in free region messages 2018-08-06 21:42:26 +01:00
Vadim Petrochenkov
cb64672e0c 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
2018-08-06 23:22:31 +03:00
Vadim Petrochenkov
f60d96a477 Support custom attributes when macro modularization is enabled 2018-08-06 23:21:18 +03:00
Vadim Petrochenkov
c84562e019 Avoid modifying invocations in place for derive helper attributes 2018-08-06 23:20:05 +03:00
Vadim Petrochenkov
467a7ab2b1 Discern between various kinds of non-macro attributes 2018-08-06 23:20:04 +03:00
bors
cf84056149 Auto merge of #53115 - davidtwco:issue-52739, r=nikomatsakis
Disable some nice region errors in NLL mode.

Fixes #52739. cc #52742.

r? @nikomatsakis
2018-08-06 19:15:05 +00:00
David Wood
37ba9ca334
Disable some nice region errors in NLL mode. 2018-08-06 20:43:16 +02:00
Pramod Bisht
49b0a1e073 #52413: addressed @estebank's Nit 2018-08-06 17:56:24 +00:00
Jonathan A. Kollasch
b011b091cb NetBSD: fix signedess of char 2018-08-06 12:20:10 -05:00
Hideki Sekine
5af644c77b [CI] run-make/thumb: Add LD_LIBRARY_PATH experiment, etc. 2018-08-07 02:10:36 +09:00
bors
b239743753 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.
2018-08-06 16:58:27 +00:00
Ralf Jung
1001b2beee inore some codegen tests when debug assertions are enabled 2018-08-06 18:45:15 +02:00
Ralf Jung
f47d56a55b update ripgrep tested by cargotest 2018-08-06 18:27:58 +02:00
Hideki Sekine
9e2dc550b5 [CI] run-make/thumb: add log for cargo build 2018-08-07 01:20:50 +09:00
Hideki Sekine
320b240819 [CI] run-make/thumb: add -vv to cargo build for diag 2018-08-07 00:50:44 +09:00
varkor
4687476470 Special-case "test" feature 2018-08-06 16:46:08 +01:00
bors
4b8089daf8 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.
2018-08-06 14:07:22 +00:00
fukatani
b6d4d40321 pretty print BTreeSet 2018-08-06 23:00:19 +09:00
Ralf Jung
d865adcf1e unconfuse @eddyb 2018-08-06 15:52:36 +02:00
Ralf Jung
3dcdb8a83e remove unnecessary CoerceUnsized impl 2018-08-06 15:52:27 +02:00
Hideki Sekine
d71cc75b7c [CI] run-make: experimental thumb test 2018-08-06 22:19:00 +09:00
Niko Matsakis
3b4ed18d1c add test case showing how previous attempt was unsound 2018-08-06 09:00:35 -04:00
Mark Rousskov
d8e8a50cf2 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.
2018-08-06 07:00:34 -06:00
Niko Matsakis
67c96edce6 revert #52991 2018-08-06 09:00:08 -04:00
Ralf Jung
645388583c actually, reentrant uninitialized mutex acquisition is outright UB 2018-08-06 14:39:55 +02:00
Igor Matuszewski
e8bb7bf35a Account for --remap-path-prefix in save-analysis 2018-08-06 14:07:08 +02:00
bors
78ec12df02 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
2018-08-06 12:00:12 +00:00
Ralf Jung
ab3e4a2789 argue why at_exit_imp is fine 2018-08-06 13:53:38 +02:00
Ralf Jung
22457deef7 make Lazy::new unsafe and check reentrancy condition in the callers 2018-08-06 13:52:15 +02:00
Ralf Jung
819645bfc4 I think we have to strengthen Mutex::init UB 2018-08-06 13:39:47 +02:00
Ralf Jung
d3d31105e9 clarify partially initialized Mutex issues 2018-08-06 12:54:44 +02:00
Ralf Jung
a92b5cc916 Remove references to StaticMutex which got removed a while ago 2018-08-06 12:34:00 +02:00
Josef Reinhard Brandl
60aa11df4c Rename Executor trait to Spawn 2018-08-06 12:18:47 +02:00
Ralf Jung
621d06481d atomic ordering docs 2018-08-06 12:05:59 +02:00
bors
7c98d2e63f 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.
2018-08-06 07:02:11 +00:00
bors
aa1e6db709 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.
2018-08-06 01:53:58 +00:00
Vadim Pashkov
70cafecaba improper_ctypes lint for individual foreign items 2018-08-06 04:18:19 +03:00
bors
e9fa9f5a6a 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)
```
2018-08-05 22:41:07 +00:00
varkor
7e7622a714 Fix WASM tests 2018-08-05 22:48:49 +01:00
varkor
a8b5b95d65 Fix diagnostic_list error 2018-08-05 22:26:06 +01:00
bors
73c78734ba 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
2018-08-05 18:45:01 +00:00
Pramod Bisht
19401086df Closes #52413: Provide structured suggestion instead of label 2018-08-05 18:44:03 +00:00
Guillaume Gomez
c70eb4b6ea Automatically expand section if url id point to one of its component 2018-08-05 19:44:10 +02:00
varkor
8d7638fa69 Fix failure on msvc 2018-08-05 17:42:58 +01:00
Matthew Tran
3d44da65cd Enable macros to pass $:literal to another macro 2018-08-05 11:02:59 -05:00
varkor
d027cc8ee1 Change feature edition error into a warning 2018-08-05 15:54:49 +01:00