Commit Graph

108135 Commits

Author SHA1 Message Date
Bastian Kauschke
22f2385a73 prevent potential promotion in const_discriminant 2020-03-08 15:12:46 +01:00
Bastian Kauschke
6d03bbd480 constify mem::discriminant 2020-03-08 14:24:32 +01:00
Ralf Jung
a95f00fe1b fix type size mismatch on 32bit 2020-03-08 12:41:59 +01:00
bors
1d5241c962 Auto merge of #69822 - Centril:rollup-360ca2j, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #69422 (Remove use of `unwrap()` from save-analysis)
 - #69548 (Turn trailing tokens in `assert!()` into hard errors)
 - #69561 (Clean up unstable book)
 - #69599 (check_binding_alt_eq_ty: improve precision wrt. `if let`)
 - #69641 (Update books)
 - #69776 (Fix & test leak of some BTreeMap nodes on panic during `into_iter`)
 - #69805 (resolve: Modernize some naming)
 - #69810 (test(bindings_after_at): add dynamic drop tests for bindings_after_at)

Failed merges:

r? @ghost
2020-03-08 10:51:46 +00:00
Mazdak Farrokhzad
49c82d1170
Rollup merge of #69810 - thekuom:test/67523-dynamic-semantics-bindings-after-at, r=Centril
test(bindings_after_at): add dynamic drop tests for bindings_after_at

Fixes https://github.com/rust-lang/rust/issues/67523.
Working towards https://github.com/rust-lang/rust/issues/65490.
2020-03-08 11:51:20 +01:00
Mazdak Farrokhzad
17b77913f9
Rollup merge of #69805 - petrochenkov:importname, r=Centril
resolve: Modernize some naming

`ImportDirective` -> `Import`
`ImportDirectiveSubclass` -> `ImportKind`
`ImportKind::SingleImport` -> `ImportKind::Single`
`ImportKind::GlobImport` -> `ImportKind::Glob`
2020-03-08 11:51:18 +01:00
Mazdak Farrokhzad
f497325b13
Rollup merge of #69776 - ssomers:fix69769, r=Mark-Simulacrum
Fix & test leak of some BTreeMap nodes on panic during `into_iter`

Fixes #69769
2020-03-08 11:51:17 +01:00
Mazdak Farrokhzad
5adfa4bd48
Rollup merge of #69641 - ehuss:update-books, r=ehuss
Update books

## nomicon

8 commits in 3e6e1001dc6e095dbd5c88005e80969f60e384e1..9f797e65e6bcc79419975b17aff8e21c9adc039f
2019-12-14 22:08:52 +0000 to 2020-03-04 03:45:13 +0100
- Rustup to latest rustc (rust-lang-nursery/nomicon#203)
- (minor) Add backticks around type names (rust-lang-nursery/nomicon#197)
- Add book.toml (rust-lang-nursery/nomicon#185)
- Rename `Alloc` to `AllocRef` (rust-lang-nursery/nomicon#188)
- Lifetimes: explain how to fix destructor example (rust-lang-nursery/nomicon#195)
- mention soundness (rust-lang-nursery/nomicon#194)
- Fix example in FFI section Calling Rust from C (rust-lang-nursery/nomicon#193)
- Removed repeated word (rust-lang-nursery/nomicon#191)

## reference

8 commits in 64239df6d173562b9deb4f012e4c3e6e960c4754..559e09caa9661043744cf7af7bd88432d966f743
2020-02-10 19:05:13 +0100 to 2020-03-02 01:17:14 +0100
- Syntax error fix (rust-lang-nursery/reference#769)
- Fix incorrect pseudocode for #[repr(C)] struct alignment (rust-lang-nursery/reference#766)
- Replace "Field-Less" with "Fieldless" (rust-lang-nursery/reference#768)
- Removed repeated word (rust-lang-nursery/reference#767)
- Update for change in const lint name. (rust-lang-nursery/reference#764)
- semantic type -> resolved type (rust-lang-nursery/reference#761)
- add behavior change of relative paths without `self` in 2018 edition (rust-lang-nursery/reference#757)
- assignment operator expressions -> compound assignment expressions (rust-lang-nursery/reference#759)

## rust-by-example

3 commits in 32facd5522ddbbf37baf01e4e4b6562bc55c071a..db57f899ea2a56a544c8d280cbf033438666273d
2020-02-11 09:25:06 -0300 to 2020-02-18 17:46:46 -0300
- Minor typo fix in src/mod/visibility (rust-lang/rust-by-example#1309)
- Don't suggest Into implements a reverse conversion (rust-lang/rust-by-example#1307)
- Improve grammar in example of 'in let' section (rust-lang/rust-by-example#1308)

## embedded-book

2 commits in b2e1092bf67bd4d7686c4553f186edbb7f5f92db..b81ffb7a6f4c5aaed92786e770e99db116aa4ebd
2020-01-30 08:45:46 +0000 to 2020-02-27 08:06:04 +0000
- Setting output to `high` needs a `true` argument  (rust-embedded/book#227)
- Add licence notes to index.md  (rust-embedded/book#226)
2020-03-08 11:51:15 +01:00
Mazdak Farrokhzad
c717721c1b
Rollup merge of #69599 - Centril:typeck-tweak-wording, r=davidtwco
check_binding_alt_eq_ty: improve precision wrt. `if let`

Follow up to https://github.com/rust-lang/rust/pull/69452 -- this tweaks the `check_binding_alt_eq_ty` logic wrt. wording so that `if let` doesn't include "in this arm" (because there can only ever be one arm).

r? @estebank
2020-03-08 11:51:14 +01:00
Mazdak Farrokhzad
d4860fcff3
Rollup merge of #69561 - JohnTitor:clean-up-unstable-book, r=Mark-Simulacrum
Clean up unstable book

- #58402's feature was renamed to `tidy_test_never_used_anywhere_else` and it is now used for tidy only
- `read_initializer` link is wrong and the doc should be auto-generated so removed
- Add dummy doc for `link_cfg`
- Stop generating `compiler_builtins_lib` doc in favor of b8ccc0f8a6
- Make `rustc_attrs` tracking issue "None"
2020-03-08 11:51:12 +01:00
Mazdak Farrokhzad
24757a82f1
Rollup merge of #69548 - LeSeulArtichaut:assert-errors, r=petrochenkov
Turn trailing tokens in `assert!()` into hard errors

I didn't have time to build the compiler and thus edited the tests manually, I hope it will still pass.

Closes #69531
r? @Centril do you want to queue the Crater experiment?
2020-03-08 11:51:09 +01:00
Mazdak Farrokhzad
f459d2ed99
Rollup merge of #69422 - JohnTitor:remove-unwrap, r=Xanewok
Remove use of `unwrap()` from save-analysis

Fix #69409, fix #69416
2020-03-08 11:51:04 +01:00
Tim Diekmann
f77afc8f9c Allow ZSTs in AllocRef 2020-03-08 11:01:12 +01:00
Guillaume Gomez
2676afeca4 clean up E0392 explanation 2020-03-08 10:44:23 +01:00
Guillaume Gomez
4db15d89a0 Cleanup E0391 explanation 2020-03-08 10:41:14 +01:00
bors
f943349eaf Auto merge of #69804 - Centril:rollup-u86dc1g, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #69667 (Remove the `no_debug` feature)
 - #69687 (resolve, inconsistent binding mode: tweak wording)
 - #69708 (On mismatched delimiters, only point at empty blocks that are in the same line)
 - #69765 (reduce test size for Miri)
 - #69773 (fix various typos)
 - #69787 (mir::Local is Copy we can pass it by value in these cases)
 - #69794 (Add `Layout::dangling()` to return a well-aligned `NonNull<u8>`)
 - #69797 (Correct version that relaxed orphan rules)

Failed merges:

r? @ghost
2020-03-08 05:27:21 +00:00
Markus Westerlind
6095fa146c refactor: Move a borrow_mut and unwrap out of a loop 2020-03-07 22:35:37 +01:00
Markus Westerlind
b1b558f1f0 refactor: Exhaustive matching in method/probe.rs 2020-03-07 22:35:37 +01:00
Matthias Krüger
8351138370 reduce references on match patterns (clippy::match_ref_pats) 2020-03-07 21:48:17 +01:00
Matthias Krüger
3f87f8cfee Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline) 2020-03-07 21:48:17 +01:00
Matthias Krüger
f326f0f70f libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string) 2020-03-07 21:48:17 +01:00
Matthias Krüger
77af19eb71 remove unneeded mutable references (cippy::unnecessary_mut_passed) 2020-03-07 21:48:17 +01:00
Matthias Krüger
cca3d52160 libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast) 2020-03-07 21:48:17 +01:00
Matthias Krüger
0d7faaf6bd rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes) 2020-03-07 21:48:17 +01:00
Matthias Krüger
254ceae30a call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) 2020-03-07 21:48:17 +01:00
Matthias Krüger
1351db31fb iterate over a maps values directly. (clippy::for_kv_map) 2020-03-07 21:48:15 +01:00
Matthias Krüger
45108b195f rustdoc: simplify boolean condition (clippy::nonminimal_bool) 2020-03-07 21:46:47 +01:00
Matthias Krüger
7aad89a900 Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) 2020-03-07 21:46:47 +01:00
Matthias Krüger
6bfff8a303 rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some) 2020-03-07 21:46:47 +01:00
Matthias Krüger
9fa79813f9 rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion) 2020-03-07 21:46:47 +01:00
Matthew Kuo
2e88bec619 test(bindings_after_at): add dynamic drop tests for bindings_after_at 2020-03-07 14:18:22 -06:00
Vadim Petrochenkov
66d7a88c41 resolve: directive -> import 2020-03-07 19:30:57 +03:00
Mazdak Farrokhzad
8ee7278fca
Rollup merge of #69797 - jongiddy:convert-version, r=Mark-Simulacrum
Correct version that relaxed orphan rules

Docs say
> Prior to Rust 1.40, if the destination type was not part of the current crate then you couldn't implement From directly

Version 1.41 of Rust introduced the change to the orphan rules - https://blog.rust-lang.org/2020/01/30/Rust-1.41.0.html#relaxed-restrictions-when-implementing-traits - so this should say
> Prior to Rust 1.41...
2020-03-07 17:27:37 +01:00
Mazdak Farrokhzad
963b0aa541
Rollup merge of #69794 - TimDiekmann:dangling, r=Amanieu
Add `Layout::dangling()` to return a well-aligned `NonNull<u8>`

Adds a convenient function to `Layout` to create a `NonNull<u8>` out of a layout to be returned on ZST allocations.

This is the first item on the roadmap to support ZSTs in `AllocRef`: https://github.com/rust-lang/wg-allocators/issues/38#issuecomment-595861542

r? @Amanieu
2020-03-07 17:27:35 +01:00
Mazdak Farrokhzad
f1f4864de3
Rollup merge of #69787 - spastorino:use-local-directly-its-copy, r=oli-obk
mir::Local is Copy we can pass it by value in these cases

r? @oli-obk
2020-03-07 17:27:34 +01:00
Mazdak Farrokhzad
10f999b72d
Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkov
fix various typos
2020-03-07 17:27:32 +01:00
Mazdak Farrokhzad
e6d4996a43
Rollup merge of #69765 - RalfJung:miri-test, r=LukasKalbertodt
reduce test size for Miri

The larger sizes take quite a while, and there is probably little point in repeating this quite so often.
2020-03-07 17:27:30 +01:00
Mazdak Farrokhzad
1a1f948deb
Rollup merge of #69708 - estebank:tiny, r=petrochenkov
On mismatched delimiters, only point at empty blocks that are in the same line

We point at empty blocks when we have mismatched braces to detect cases where editors auto insert `}` after writing `{`. Gate this to only the case where the entire span is in the same line so we never point at explicitly empty blocks.
2020-03-07 17:27:29 +01:00
Mazdak Farrokhzad
289c3a5f6e
Rollup merge of #69687 - Centril:bm-inconsistent-wording, r=estebank
resolve, inconsistent binding mode: tweak wording

Now that we can have e.g. `let Ok(x) | Err(x) = res;`, it's no longer appropriate to refer to "the same *match arm*", so let's tweak the wording.

r? @estebank
2020-03-07 17:27:27 +01:00
Mazdak Farrokhzad
614cd8dc47
Rollup merge of #69667 - JohnTitor:no-debug, r=nikomatsakis
Remove the `no_debug` feature

Context: https://github.com/rust-lang/rust/issues/29721#issuecomment-367642779

r? @nikomatsakis
2020-03-07 17:27:26 +01:00
Vadim Petrochenkov
1915bf122e resolve: ImportDirective -> Import
`ImportDirectiveSubclass` -> `ImportKind`
`ImportKind::SingleImport` -> `ImportKind::Single`
`ImportKind::GlobImport` -> `ImportKind::Glob`
2020-03-07 18:59:56 +03:00
bors
823ff8cf13 Auto merge of #69676 - ecstatic-morse:fix-enum-discr-effect, r=oli-obk
Pass correct place to `discriminant_switch_effect`

PR #69562, which fixed a bug that was causing clippy to ICE, mistakenly passed the place holding the *result* of `Rvalue::Discriminant` instead of the place holding its *operand* to `apply_discriminant_switch_effect` as the enum place. As a result, no effect was applied at all, and we lost the perf benefits from marking inactive enum variants as uninitialized.

**edit:** The regression test has been split into #69744.

r? @oli-obk
2020-03-07 13:47:46 +00:00
Tomasz Miąsko
adc422f3d5 Compile address sanitizer test with debuginfo
This makes error-pattern to match regardless of current
configuration of `rust.debuginfo-level-tests` in `config.toml`.
2020-03-07 13:33:40 +01:00
Jonathan Giddy
dffd18fafc Correct version that relaxed orphan rules 2020-03-07 08:21:27 +00:00
bors
a03921701c Auto merge of #69796 - Centril:rollup-xg85jmx, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #67741 (When encountering an Item in a pat context, point at the item def)
 - #68985 (Parse & reject postfix operators after casts)
 - #69656 (Use .next() instead of .nth(0) on iterators.)
 - #69680 (rustc_expand: Factor out `Annotatable::into_tokens` to a separate method)
 - #69690 (test(pattern): add tests for combinations of pattern features)
 - #69706 (Use subslice patterns in slice methods)
 - #69727 (Avoid using `unwrap()` in suggestions)
 - #69754 (Update deprecation version to 1.42 for Error::description)
 - #69782 (Don't redundantly repeat field names (clippy::redundant_field_names))

Failed merges:

r? @ghost
2020-03-07 08:07:10 +00:00
Mazdak Farrokhzad
709325af67
Rollup merge of #69782 - matthiaskrgr:redundant_field_name_rep, r=cramertj
Don't redundantly repeat field names (clippy::redundant_field_names)
2020-03-07 08:15:33 +01:00
Mazdak Farrokhzad
ca90c3d0a7
Rollup merge of #69754 - Dylnuge:dylnuge/dep-version, r=Mark-Simulacrum
Update deprecation version to 1.42 for Error::description

Error::description is deprecated as of version 1.42, as the commit was
not in the release for 1.41.

Fixes #69751
2020-03-07 08:15:32 +01:00
Mazdak Farrokhzad
93a57cf3a8
Rollup merge of #69727 - JohnTitor:sugg-unwrap, r=estebank
Avoid using `unwrap()` in suggestions

Fixes #69725

r? @estebank
2020-03-07 08:15:30 +01:00
Mazdak Farrokhzad
b25fb9e79b
Rollup merge of #69706 - cuviper:subslice-methods, r=Centril
Use subslice patterns in slice methods

For all of the methods that pick off the first or last element, we can
use subslice patterns to implement them directly, rather than relying on
deeper indexing function calls. At a minimum, this means the generated
code will rely less on inlining for performance, but in some cases it
also optimizes better.
2020-03-07 08:15:29 +01:00
Mazdak Farrokhzad
ba1f6cbb00
Rollup merge of #69690 - thekuom:test/67311-extend-bindings-after-at-tests, r=Centril
test(pattern): add tests for combinations of pattern features

Reference issue #67311

Tests combinations of the following pattern features:
- bindings_after_at
- or_patterns
- slice_patterns
- box_patterns

r? @Centril
2020-03-07 08:15:28 +01:00