Commit Graph

109634 Commits

Author SHA1 Message Date
Matthias Krüger
eef8e4814a submodules: update clippy from 70b93aab to e170c849
Changes:
````
rustup  https://github.com/rust-lang/rust/pull/70536
Rustup to https://github.com/rust-lang/rust/pull/70449
readme: move "how to run single lint" instructions to "Allowing/denying lints" section.
git attribute macros not allowed in submodules
Deprecate REPLACE_CONSTS lint
Bump itertools
````

Fixes #70554
2020-03-30 17:58:14 +02:00
Nikhil Benesch
ac478f2f61
Optimize strip_prefix and strip_suffix with str patterns
Constructing a Searcher in strip_prefix and strip_suffix is
unnecessarily slow when the pattern is a fixed-length string. Add
strip_prefix and strip_suffix methods to the Pattern trait, and add
optimized implementations of these methods in the str implementation.
The old implementation is retained as the default for these methods.
2020-03-30 11:10:21 -04:00
bors
9a12971da5 Auto merge of #70568 - Dylan-DPC:rollup-em6vnpx, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #70479 (avoid creating unnecessary reference in Windows Env iterator)
 - #70546 (Polonius: update to 0.12.1, fix more move errors false positives, update test expectations)
 - #70559 (fix BTreeMap test compilation with Miri)
 - #70567 (Fix broken link in README)

Failed merges:

r? @ghost
2020-03-30 14:25:34 +00:00
Dylan DPC
aaa8aa3181
Rollup merge of #70567 - JOE1994:patch-3, r=Centril
Fix broken link in README

Fix broken link to `rustc-dev-guide` section for `codegen`
2020-03-30 16:24:52 +02:00
Dylan DPC
298a89bff3
Rollup merge of #70559 - RalfJung:btree-test-miri, r=Mark-Simulacrum
fix BTreeMap test compilation with Miri

This got broken by https://github.com/rust-lang/rust/pull/70506
2020-03-30 16:24:51 +02:00
Dylan DPC
b99db6ee10
Rollup merge of #70546 - lqd:polonius_update, r=nikomatsakis
Polonius: update to 0.12.1, fix more move errors false positives, update test expectations

This PR:
- updates `polonius-engine` to version 0.12.1 to fix some move errors false positives
- fixes a fact generation mistake creating the other move errors false positives
- updates the test expectations for the polonius compare-mode so that all (minus the 2 OOMs) ui tests pass again (matching the [analysis doc](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?view) starting at case 34)

In my opinion, this is safe to rollup.

r? @nikomatsakis
2020-03-30 16:24:49 +02:00
Dylan DPC
47ffca296a
Rollup merge of #70479 - RalfJung:win-env, r=Mark-Simulacrum
avoid creating unnecessary reference in Windows Env iterator

Discovered in https://github.com/rust-lang/miri/pull/1225: the Windows `Env` iterator violates Stacked Borrows by creating an `&u16`, turning it into a raw pointer, and then accessing memory outside the range of that type.

There is no need to create a reference here in the first place, so the fix is trivial.
Cc @JOE1994
Cc https://github.com/rust-lang/unsafe-code-guidelines/issues/134
2020-03-30 16:24:44 +02:00
Youngsuk Kim
60e7473bdf
Fix broken link in README 2020-03-30 10:09:51 -04:00
Tshepang Lekhonkhobe
d6f71f0c9a remove obsolete comment
Made obsolete by b5e35b128e
2020-03-30 13:38:17 +02:00
Mazdak Farrokhzad
9f86d28537 try_resolve_as_non_binding: span_bug -> delay_span_bug 2020-03-30 13:23:26 +02:00
Ralf Jung
032d3cd553 fix BTreeMap test compilation with Miri 2020-03-30 12:04:05 +02:00
bors
a80ec3b3b1 Auto merge of #70326 - matthiaskrgr:cl1ppy_single_match, r=Centril
Use if let instead of match when only matching a single variant (clippy::single_match)

Makes code more compact and reduces nesting.
2020-03-30 09:16:21 +00:00
Matthias Krüger
9bba047c2e Use if let instead of match when only matching a single variant (clippy::single_match)
Makes code more compact and reduces nestig.
2020-03-30 10:52:29 +02:00
Mazdak Farrokhzad
96d7353678 parse_and_disallow_postfix_after_cast: account for ExprKind::Err. 2020-03-30 09:55:57 +02:00
bors
8926bb497d Auto merge of #70536 - Centril:rustc-middle, r=eddyb
Rename `librustc` to `librustc_middle`

Here we rename `librustc` to `librustc_middle`.

This crate is not nearly as large or central as it was previously and so it doesn't make much sense to give it such a central name as `librustc` ("the entry point to the compiler"). Moreover, there is already a `rustc` crate which is has the actual `fn main` of `rustc`, so having `librustc` is confusing relative to that.

r? @eddyb
2020-03-30 05:26:27 +00:00
Mazdak Farrokhzad
2a92839147 rustc -> rustc_middle part 5 -- fix tests 2020-03-30 07:21:44 +02:00
Mazdak Farrokhzad
39f06255d2 rustc -> rustc_middle part 4 -- pacify tidy 2020-03-30 07:19:55 +02:00
Mazdak Farrokhzad
1ccb0b4a02 rustc -> rustc_middle part 3 (rustfmt) 2020-03-30 07:19:55 +02:00
Mazdak Farrokhzad
0cb9e36090 rustc -> rustc_middle part 2 2020-03-30 07:16:56 +02:00
Mazdak Farrokhzad
7710f2dd5c rustc -> rustc_middle part 1 2020-03-30 07:02:56 +02:00
bors
0afdf43dc1 Auto merge of #70449 - ecstatic-morse:visit-body, r=oli-obk
Make `Visitor::visit_body` take a plain `&Body`

`ReadOnlyBodyAndCache` has replaced `&Body` in many parts of the code base that don't care about basic block predecessors. This includes the MIR `Visitor` trait, which I suspect resulted in many unnecessary changes in #64736. This reverts part of that PR to reduce the number of places where we need to pass a `ReadOnlyBodyAndCache`.

In the long term, we should either give `ReadOnlyBodyAndCache` more ergonomic name and replace all uses of `&mir::Body` with it at the cost of carrying an extra pointer everywhere, or use it only in places that actually need access to the predecessor cache. Perhaps there is an even nicer alternative.

r? @Nashenas88
2020-03-30 02:04:00 +00:00
Julien Philippon
8f7eb6229c Add long error code for error E0226 2020-03-30 02:51:25 +02:00
Remy Rakic
5af11d261d bless output of ui test nll/user-annotations/closure-substs.rs
Trivial diagnostics grammar change
2020-03-30 01:30:26 +02:00
Remy Rakic
82424634a3 bless output of ui test impl-trait/multiple-lifetimes/error-handling.rs
Some impl Trait fixes lead to locating more accurately the cause of
a universal region error with a user annotation
2020-03-30 01:28:27 +02:00
Remy Rakic
fcd12bd2f4 bless output of ui test closures/closure-expected-type/expect-region-supply-region.rs
trivial diagnostics grammar change
2020-03-30 01:24:52 +02:00
Remy Rakic
c73d5db21f bless output of ui test nll/outlives-suggestion-simple.rs
trivial diagnostics wording change
2020-03-30 01:22:59 +02:00
Remy Rakic
2a7644746b bless output of ui test hrtb/hrtb-perfect-forwarding.rs
trivial formatting changes
2020-03-30 01:18:27 +02:00
Remy Rakic
860f71f141 Polonius fact generation: fix path access fact location
This will fix the other move errors false positives:
emitting the fact at the start point caused accesses to be at the
same point as an initialization fact of the return place of a call
on the following block, which emitted an error.
2020-03-30 01:13:03 +02:00
Remy Rakic
df1ac67913 update polonius-engine to 0.12.1
This will fix some move errors false positives
2020-03-30 01:11:44 +02:00
bors
4911572b2d Auto merge of #70009 - estebank:sugg-bound, r=Centril
Tweak `suggest_constraining_type_param`

Some of the bound restriction structured suggestions were incorrect while others had subpar output.

The only issue left is a suggestion for an already present bound when dealing with `const`s that should be handled independently.

Fix #69983.
2020-03-29 22:50:59 +00:00
Dylan MacKenzie
538cdef64b Use & to do deref coercion for ReadOnlyBodyAndCache 2020-03-29 13:30:26 -07:00
Esteban Küber
2c71894657 Tweak suggest_constraining_type_param
Some of the bound restriction structured suggestions were incorrect
while others had subpar output.
2020-03-29 13:13:17 -07:00
bors
699f83f525 Auto merge of #70544 - Dylan-DPC:rollup-pj86j17, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #69702 (Rename TyLayout to TyAndLayout.)
 - #70539 (add test for 62220)
 - #70540 (#[link]: mention wasm_import_module instead of cfg)
 - #70541 (prohibit_generics: update has_err for consts)

Failed merges:

r? @ghost
2020-03-29 19:43:24 +00:00
Dylan DPC
800ed0cd5d
Rollup merge of #70541 - lcnr:patch-1, r=varkor
prohibit_generics: update has_err for consts

r? @eddyb
2020-03-29 21:23:55 +02:00
Dylan DPC
1bf4873aac
Rollup merge of #70540 - jonas-schievink:link-attr-template, r=varkor
#[link]: mention wasm_import_module instead of cfg

`#[link(cfg)]` is perma-unstable and is not documented anywhere else. It makes more sense to mention `wasm_import_module` here since it's stable.

This makes it harder to hit https://github.com/rust-lang/rust/issues/70538 (if it weren't for this text, I wouldn't even know this feature existed).
2020-03-29 21:23:53 +02:00
Dylan DPC
5a7b377b6f
Rollup merge of #70539 - DutchGhost:test-62220, r=Dylan-DPC
add test for 62220

Closes #62220

Adds a test for https://github.com/rust-lang/rust/issues/62220.

Im not sure whether `check-pass` is sufficient here. I didn't put `run-pass` in, as I'm afraid that'll fail due to the `unimplemented!()` return in the code.
2020-03-29 21:23:52 +02:00
Dylan DPC
d009ce441f
Rollup merge of #69702 - anyska:tylayout-rename, r=oli-obk
Rename TyLayout to TyAndLayout.
2020-03-29 21:23:50 +02:00
Dylan MacKenzie
b641e9e358 Make Visitor::visit_body take a simple Body 2020-03-29 11:56:36 -07:00
Bastian Kauschke
8b762c5537
prohibit_generics: update has_err for consts 2020-03-29 18:34:42 +02:00
Dodo
61d419314f add a build-pass test for issue 62220 2020-03-29 18:27:54 +02:00
Russell Cohen
bceab25d6c Cleanup match expression 2020-03-29 12:02:28 -04:00
Jonas Schievink
042f4941e7 #[link]: mention wasm_import_module instead of cfg 2020-03-29 17:40:04 +02:00
Russell Cohen
82b2989ae0 More raw string tests 2020-03-29 11:34:15 -04:00
Russell Cohen
c15f86b4b3 Cleanup error messages, improve docstrings 2020-03-29 11:12:48 -04:00
bors
285519d412 Auto merge of #70534 - Centril:rollup-t59tcx2, r=Centril
Rollup of 3 pull requests

Successful merges:

 - #70140 (Add Result<Result<T, E>, E>::flatten -> Result<T, E>)
 - #70526 (reduce `rustc_attr` usage in places)
 - #70527 (Update LLVM submodule)

Failed merges:

r? @ghost
2020-03-29 14:48:58 +00:00
Mazdak Farrokhzad
b851591731
Rollup merge of #70527 - Amanieu:fix_fastisel, r=Mark-Simulacrum
Update LLVM submodule

Fixes #70148
2020-03-29 16:48:24 +02:00
Mazdak Farrokhzad
b4491e50d5
Rollup merge of #70526 - Centril:less-attr, r=eddyb
reduce `rustc_attr` usage in places

This cleans up some unused `rustc_attr` dependencies.
2020-03-29 16:48:23 +02:00
Mazdak Farrokhzad
8212a1c7dc
Rollup merge of #70140 - Nemo157:result-flatten, r=Amanieu
Add Result<Result<T, E>, E>::flatten -> Result<T, E>

This PR makes this possible (modulo type inference):

```rust
assert_eq!(Ok(6), Ok(Ok(6)).flatten());
```

Tracking issue: #70142

<sub>largely cribbed directly from <https://github.com/rust-lang/rust/pull/60256></sub>
2020-03-29 16:48:21 +02:00
Mark Rousskov
56147219a5 Stabilize float::to_int_unchecked
This renames and stabilizes unsafe floating point to integer casts, which are
intended to be the substitute for the currently unsound `as` behavior, once that
changes to safe-but-slower saturating casts.
2020-03-29 10:27:07 -04:00
Stein Somers
0405db3a34 BTreeMap/BTreeSet: implement and test drain_filter 2020-03-29 16:05:53 +02:00