Commit Graph

81870 Commits

Author SHA1 Message Date
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
varkor
c157ec87ed Fix 2018 edition tests 2018-08-05 15:54:49 +01:00
varkor
5815a84280 Remove references to unknown feature io 2018-08-05 15:54:49 +01:00
varkor
60ad63640f Add an error when declaring features that are stable in the current Rust edition 2018-08-05 15:54:49 +01:00
varkor
d19832105e Remove bad features after rebase 2018-08-05 15:54:49 +01:00
varkor
bd90137b94 Improve query efficiency 2018-08-05 15:54:49 +01:00
varkor
e5d5e6a560 Fix outdated handling of GetLangItems 2018-08-05 15:54:49 +01:00
varkor
319b052357 Fix stage 2 tests 2018-08-05 15:54:49 +01:00
varkor
8cee487eb3 Fix rustdoc test 2018-08-05 15:54:49 +01:00
varkor
f22ccbe315 Fix run-pass-fulldeps tests 2018-08-05 15:54:49 +01:00
varkor
f2fd00005e Fix incremental tests 2018-08-05 15:54:49 +01:00
varkor
f91d7baaa4 Add special support for libc 2018-08-05 15:54:49 +01:00
varkor
53add5d7d3 Add support for feature attributes on macros 2018-08-05 15:54:49 +01:00
varkor
120989195f Convert unknown_features lint into an error 2018-08-05 15:54:49 +01:00
varkor
47619c0dc7 Turn the duplicate feature lint into an error 2018-08-05 15:54:49 +01:00
varkor
c81b95f305 Remove unnecessary feature attributes that sneaked in 2018-08-05 15:54:49 +01:00
varkor
bd66cbb806 Remove obsolete tests in tidy
These have been replaced by more reliable checks in the compiler itself.
2018-08-05 15:54:49 +01:00
varkor
af77c42e38 Remove panic-runtime opt-out 2018-08-05 15:54:49 +01:00
varkor
1511df2521 Add a test for feature attribute consistency
Note that this doesn't test consistency of some properties, like `reason`.
2018-08-05 15:54:49 +01:00
varkor
372e128476 Add test for duplicate features 2018-08-05 15:54:49 +01:00
varkor
c717ccba17 Add a test for unknown features 2018-08-05 15:54:49 +01:00
varkor
671a81738d Fix test/ui 2018-08-05 15:54:49 +01:00
varkor
895fcec3b4 Fix test/compile-fail 2018-08-05 15:54:49 +01:00
varkor
279fbaa29c Fix test/run-pass 2018-08-05 15:54:49 +01:00
varkor
61b9d87c28 Fix test/run-fail 2018-08-05 15:54:49 +01:00
varkor
99db9d63eb Fix test/debuginfo 2018-08-05 15:54:49 +01:00
varkor
82a98ac03d Get around tidy bug 2018-08-05 15:54:49 +01:00
varkor
a92d3a3606 Add duplicity lint for lang features 2018-08-05 15:54:49 +01:00
varkor
fc99ea7ffa Add a lint for duplicate feature attributes 2018-08-05 15:54:49 +01:00