Commit Graph

91751 Commits

Author SHA1 Message Date
Esteban Küber
ee2a9d93e9 Suggest using anonymous lifetime in impl Trait return 2019-03-29 13:24:29 -07:00
Matt Brubeck
b6fb3e3411 In doc examples, don't ignore read/write results
Calling `Read::read` or `Write::write` without checking the returned
`usize` value is almost always an error.  Example code in the
documentation should demonstrate how to use the return value correctly.
Otherwise, people might copy the example code thinking that it is okay
to "fire and forget" these methods.
2019-03-29 11:50:41 -07:00
Laurenz
9e4ec7a568 Collapse blanket impls in the same way as normal impls 2019-03-29 19:47:19 +01:00
Esteban Küber
ddfa47f4b4 Fix incorrect code 2019-03-29 11:12:54 -07:00
bors
e782d790f1 Auto merge of #59522 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #59366 (Update books)
 - #59436 (Update jemalloc-sys to version 0.3.0)
 - #59454 (Update rustfmt to 1.2.0)
 - #59462 (Fix error in Rust 2018 + no_core environment)
 - #59467 (Better diagnostic for binary operation on BoxedValues)
 - #59473 (Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans)
 - #59480 (Update stdsimd)
 - #59486 (Visit `ImplItem` in `dead_code` lint)
 - #59510 (Rename `type_parameters` to `generics` and so on)

Failed merges:

 - #59516 (Update cargo)

r? @ghost
2019-03-29 18:09:51 +00:00
bjorn3
35705dee7e Use ExactSizeIterator + TrustedLen instead of num_cases arg for switch 2019-03-29 17:23:52 +01:00
bjorn3
56842b2154 Add a method for emiting a switch. 2019-03-29 17:17:14 +01:00
bjorn3
b2e61946fa Remove inline_asm_call from cg_ssa
`count_insn` is no longer called for inline asm, because it is private to builder.rs
2019-03-29 17:17:13 +01:00
bjorn3
b71c429007 Remove type_variadic_func and typ_array from cg_ssa 2019-03-29 17:17:13 +01:00
bjorn3
0e166bb217 Remove a lot of methods from *TypeMethods 2019-03-29 17:17:13 +01:00
bjorn3
b0ee1f7f99 Remove scalar_lltypes from cg_ssa 2019-03-29 17:17:13 +01:00
bjorn3
7de0b1de19 Move get_param and set_value_name 2019-03-29 17:17:13 +01:00
bjorn3
bcab49720e Remove a lot of methods from BuilderMethods 2019-03-29 17:17:12 +01:00
bjorn3
794ecd965a [WIP] Make some debug info methods take &mut FunctionDebugContext
declare_local still takes &FunctionDebugContext, because of borrowck errors
2019-03-29 17:17:12 +01:00
bjorn3
ab8f1527e4 Remove internal mutability from source_locations_enabled 2019-03-29 17:17:12 +01:00
bjorn3
f1fe9253e2 Remove param_substs from FunctionCx 2019-03-29 17:17:12 +01:00
bjorn3
7b94195c22 Remove const_{cstr,str_slice,get_elt,get_real} and is_const_real methods from cg_ssa
This introduces the static_panic_msg trait method to StaticBuilderMethods.
2019-03-29 17:17:12 +01:00
bjorn3
a3fa1161d2 Remove const_{fat_ptr,array,vector,bytes} from cg_ssa 2019-03-29 17:17:12 +01:00
bjorn3
a0056333f1 Misc 2019-03-29 17:17:12 +01:00
bjorn3
fe88440bd2 Add a comment 2019-03-29 17:17:12 +01:00
bjorn3
83e80a7443 Use Builder instead of CodegenCx for OperandRef and LocalRef 2019-03-29 17:17:12 +01:00
bjorn3
a0c2ca1b56 eval_mir_constant doesn't need a builder param 2019-03-29 17:17:11 +01:00
bjorn3
2b688a959d Don't use c_uint in cg_ssa 2019-03-29 17:06:27 +01:00
Mazdak Farrokhzad
8705de49e1
Update src/libstd/macros.rs
Removed duplicate line.

Co-Authored-By: DevQps <46896178+DevQps@users.noreply.github.com>
2019-03-29 16:25:38 +01:00
Mazdak Farrokhzad
fe210d0df1
Update src/libstd/macros.rs
Wrapped lines earlier such that it is more coherent with the rest of the text.

Co-Authored-By: DevQps <46896178+DevQps@users.noreply.github.com>
2019-03-29 16:24:13 +01:00
Christian
8fe108796d Added documentation on the remainder (Rem) operator for floating points. 2019-03-29 16:22:26 +01:00
Christian
9240092fe3 Adjusted the indentation. 2019-03-29 16:18:24 +01:00
Christian
f10e44420a Edited the dbg! docs stating that dbg! works the same way in release builds. 2019-03-29 15:56:22 +01:00
Felix S. Klock II
cbbd4d5f98 Regression test for incremental treatment of rustc_scalar_valid_range_{start,end}. 2019-03-29 15:05:03 +01:00
Felix S. Klock II
7642f108e2 Whitelist rustc_layout_scalar_valid_range_{start,end} so incr comp does not flag them as unused. 2019-03-29 15:04:09 +01:00
Felix S. Klock II
0b96697299 Regression test for incremental treatment of rustc_on_unimplemented. 2019-03-29 15:03:31 +01:00
Esteban Küber
3592079765 revert change to test file as per review request 2019-03-29 06:41:15 -07:00
Felix S. Klock II
ff33b2733a Whitelist rustc_on_unimplemented to avoid erroneous flagging as an unused attribute. 2019-03-29 14:24:14 +01:00
Mazdak Farrokhzad
99e886de43
Rollup merge of #59510 - varkor:rename-type_parameters, r=eddyb
Rename `type_parameters` to `generics` and so on

Some old variable names had fallen through the generics generalisation pull requests.
2019-03-29 12:32:32 +01:00
Mazdak Farrokhzad
4aacc49ece
Rollup merge of #59486 - varkor:dead-code-impl, r=sanxiyn
Visit `ImplItem` in `dead_code` lint

Fixes https://github.com/rust-lang/rust/issues/47131.
2019-03-29 12:32:30 +01:00
Mazdak Farrokhzad
ee172673c1
Rollup merge of #59480 - gnzlbg:us, r=alexcrichton
Update stdsimd

This PR fixes a regression introduced by ACLE support on thumbv4 targets, see: https://github.com/rust-lang-nursery/stdsimd/pull/704 .
2019-03-29 12:32:29 +01:00
Mazdak Farrokhzad
c105f34fcb
Rollup merge of #59473 - estebank:borrow-sugg-inside-macro, r=davidtwco
Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans

Fix #58298.
2019-03-29 12:32:28 +01:00
Mazdak Farrokhzad
fda206633d
Rollup merge of #59467 - hgallagher1993:local_branch, r=estebank
Better diagnostic for binary operation on BoxedValues

Fixes #59458
2019-03-29 12:32:26 +01:00
Mazdak Farrokhzad
647d09fced
Rollup merge of #59462 - taiki-e:no-core, r=petrochenkov
Fix error in Rust 2018 + no_core environment

Minimized reproduction: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5b9f6c3026ec9d856699fa6dbd4361f0

This is a fix for the error that occurred in #58702.

r? @Centril
2019-03-29 12:32:24 +01:00
Mazdak Farrokhzad
38af98ee5f
Rollup merge of #59454 - topecongiro:rustfmt-1.2.0, r=nrc
Update rustfmt to 1.2.0

This release includes bug fixes and performance improvements from 1.1.0. Also it adds a new rustfmt tool attribute `#[rustfmt::skip::macros]`, which lets you skip formatting macro calls of your choice.

cc @nrc @Centril @Xanewok
2019-03-29 12:32:23 +01:00
Mazdak Farrokhzad
8e0855b5b7
Rollup merge of #59436 - gnzlbg:update_jemalloc, r=alexcrichton
Update jemalloc-sys to version 0.3.0

This PR updates jemalloc-sys from 0.1.8 to 0.3.0.
2019-03-29 12:32:21 +01:00
Mazdak Farrokhzad
972a8ce2a9
Rollup merge of #59366 - ehuss:update-books, r=QuietMisdreavus
Update books

Update reference, book, rust-by-example, edition-guide, embedded-book

## reference

15 commits in 41493ffce5d0e17d54eaf5ec9a995054e2b9aece..27ad493a10364e907ec476e2ad61e8a1614b57e1
2019-03-05 12:32:22 +0100 to 2019-03-26 02:06:15 +0100
- Document wasm_import_module for #[link]. (rust-lang-nursery/reference#554)
- Fix tidy error. (rust-lang-nursery/reference#552)
- Some minor contributing updates. (rust-lang-nursery/reference#551)
- Document `type_length_limit`. (rust-lang-nursery/reference#546)
- Add some terms to the glossary. (rust-lang-nursery/reference#547)
- Document `target_feature` and `cfg_target_feature`. (rust-lang-nursery/reference#545)
- Remove undocumented page (rust-lang-nursery/reference#539)
- Reorg and update attributes (rust-lang-nursery/reference#537)
- Fix some minor link errors. (rust-lang-nursery/reference#538)
- Add linkchecker. (rust-lang-nursery/reference#521)
- Expand docs on Macros By Example. (rust-lang-nursery/reference#511)
- document #[panic_handler] (rust-lang-nursery/reference#362)
- document #[used] (rust-lang-nursery/reference#361)
- Note that UB is program-global (rust-lang-nursery/reference#490)
- Fix copy-paste error in procedural-macros.md (rust-lang-nursery/reference#533)

## book

16 commits in 9cffbeabec3bcec42d09432bfe7705125c848889..b93ec30bbc7b1b5c2f44223249ab359bed2ed5a6
2019-03-02 08:22:41 -0500 to 2019-03-26 16:54:10 -0400
- Unignore example that now compiles
- Fix code snippet (rust-lang/book#1863)
- Fix mdbook link text in readme (rust-lang/book#1881)
- Wrap to 80 cols
- Make sentence more complete (rust-lang/book#1885)
- consistenly use increment and decrement (rust-lang/book#1884)
- Fix link to Reference's conditional-compilation. (rust-lang/book#1878)
- Fix subject/verb agreement
- Remove nostarch snapshot files that have been incorporated and checked
- haha teach the dictionary steve's name
- Add authorship info to the front page
- fix accidental &lt;ol&gt;'s (rust-lang/book#1866)
- Edits to Macros (rust-lang/book#1848)
- Mention `lock` returns `MutexGuard` wrapped in a `LockResult`
- Add an example that illustrates NLL (rust-lang/book#1842)
- change the parameter name from `type` to `kind` (rust-lang/book#1845)

## rust-by-example

33 commits in 2ce92beabb912d417a7314d6da83ac9b50dc2afb..f68ef3d0f4959f6a7d92a08d9994b117f0f4d32d
2018-11-20 10:10:23 -0500 to 2019-03-12 15:32:12 -0300
- Fix some broken links. (rust-lang/rust-by-example#1161)
- Update links in README (rust-lang/rust-by-example#1167)
- Add score/lifetimes/trait.md (rust-lang/rust-by-example#1168)
- Fix rust-lang/rust-by-example#1147 - No more `open_mode` method (rust-lang/rust-by-example#1164)
- Fix for loop description in list print example (rust-lang/rust-by-example#1162)
- Add link to Cargo chapter in the index page (rust-lang/rust-by-example#1159)
- Fix grammar in sentence about integer notation (rust-lang/rust-by-example#1157)
- Do not use deprecated functions from `std::error::Error` trait (rust-lang/rust-by-example#1151)
- Update new_types.md to clarify conversion to base type (rust-lang/rust-by-example#1148)
- Fix compatibility with Rust 2018 (rust-lang/rust-by-example#1150)
- Hello: Fix hint link in `fmt` chapter. (rust-lang/rust-by-example#1146)
- Clarify pub(restricted) example a bit (rust-lang/rust-by-example#1133)
- Add "literal" to list of macro designators (rust-lang/rust-by-example#1153)
- Minor fixes for the macros chapter (rust-lang/rust-by-example#1113)
- Use new book links instead of the old second-edition ones (rust-lang/rust-by-example#1143)
- Recommend implementing Display over ToString (rust-lang/rust-by-example#1145)
- Remove unused import and format with `rustfmt` (rust-lang/rust-by-example#1144)
- fix typo (rust-lang/rust-by-example#1142)
- Update syntax for 2018 Edition (rust-lang/rust-by-example#1136)
- Added two missing full stops (rust-lang/rust-by-example#1138)
- Removed unnecessary spaces before macro designators in macros/dry (rust-lang/rust-by-example#1139)
- fix install mdbook command (rust-lang/rust-by-example#1128)
- Changed word `function` to `type` in comment of fn area (rust-lang/rust-by-example#1132)
- Added two missing backticks in generics/multi_bounds (rust-lang/rust-by-example#1129)
- Fixed small logic error in error/option_unwrap/and_then (rust-lang/rust-by-example#1127)
- Fix typo (rust-lang/rust-by-example#1125)
- The code of conduct link was dead. I fixed it. (rust-lang/rust-by-example#1122)
- I added a space in the Display fmt for Complex (rust-lang/rust-by-example#1123)
- Fix Rust install link in the index (rust-lang/rust-by-example#1124)
- Update cargo conventions section (rust-lang/rust-by-example#1121)
- Fixed curly braces in the `To and from Strings` chapter to be parentheses (rust-lang/rust-by-example#1120)
- Edit a typo (rust-lang/rust-by-example#1119)
- Fixes rust-lang/rust-by-example#1115 by correcting the typo from into_iterator to into_iter (rust-lang/rust-by-example#1118)

## edition-guide

1 commits in aa0022c875907886cae8f3ef8e9ebf6e2a5e728d..b56ddb11548450a6df4edd1ed571b2bc304eb9e6
2019-02-27 22:10:39 -0800 to 2019-03-10 10:23:16 +0100
- Links fixes (rust-lang-nursery/edition-guide#133)

## embedded-book

6 commits in 9e656ead82bfe869493dec82653a52e27fa6a05c..07fd3880ea0874d82b1d9ed30ad3427ec98b4e8a
2019-03-03 16:03:26 +0000 to 2019-03-27 15:40:52 +0000
- Fix test errors.  (rust-embedded/book#180)
- Update qemu.md  (rust-embedded/book#170)
- Update no-std.md to remove obsolete FAQ link  (rust-embedded/book#177)
- We've come a long way :)  (rust-embedded/book#176)
- Correct link to team  (rust-embedded/book#175)
- Update some book links to their new homes.  (rust-embedded/book#173)
2019-03-29 12:32:19 +01:00
bors
2002b4b39a Auto merge of #59303 - euclio:remove-rebuild-trigger, r=cuviper
replace llvm-rebuild-trigger with submodule commit hash

As mentioned in #59285.

This PR removes the need to update the `llvm-rebuild-trigger` file. Instead, the latest commit hash of the appropriate LLVM submodule will be stored in the stamp file and used to detect if a build is required.

Fixes #42405.
Fixes #54959.
Fixes #55537.
2019-03-29 11:20:55 +00:00
Stein Somers
f5fee8fd7d improve worst-case performance of BTreeSet difference and intersection 2019-03-29 12:18:20 +01:00
David Wood
49a6da2cda
Support non-exhaustive enum variants in rustdoc.
This commit adds support for non-exhaustive enum variants in rustdoc,
extending the existing support for non-exhaustive enums and structs.
2019-03-29 11:03:35 +01:00
David Wood
18938416e4
Update documentation.
This commit updates the unstable book and diagnostics to reflect that
the `#[non_exhaustive]` attribute is now available for enum variants.
2019-03-29 11:03:35 +01:00
bors
003382e415 Auto merge of #59513 - Centril:rollup, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #58019 (Combine all builtin late lints and make lint checking parallel)
 - #59358 (Use `track_errors` instead of hand rolling)
 - #59394 (warn -> deny duplicate match bindings)
 - #59401 (bootstrap: build crates under libtest with -Z emit-stack-sizes)
 - #59423 (Visit path in `walk_mac`)
 - #59468 (musl: build toolchain libs with -fPIC)
 - #59476 (Use `SmallVec` in `TokenStreamBuilder`.)
 - #59496 (Remove unnecessary with_globals calls)
 - #59498 (Use 'write_all' instead of 'write' in example code)
 - #59503 (Stablize {f32,f64}::copysign().)
 - #59511 (Fix missed fn rename in #59284)

Failed merges:

r? @ghost
2019-03-29 08:14:41 +00:00
Eduard-Mihai Burtescu
5b7f4e9e21 rustc_target: factor out common fields of non-Single Variants. 2019-03-29 09:33:48 +02:00
Eduard-Mihai Burtescu
03639a2bff rustc(codegen): uncache def_symbol_name prefix from symbol_name. 2019-03-29 07:45:38 +02:00
bors
4fec737f9a Auto merge of #58605 - nagisa:fix-the-metadata, r=michaelwoerister
Use informational target machine for metadata

Since there is nothing to optimise there...

Should fix #58323 but haven’t tested locally.

r? @michaelwoerister
2019-03-29 05:00:58 +00:00