]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoDocument panic in mpsc::Receiver::recv_timeout
Felix Rabe [Tue, 7 Aug 2018 14:35:03 +0000 (16:35 +0200)]
Document panic in mpsc::Receiver::recv_timeout

5 years agoDocument #39364 (WIP)
Felix Rabe [Wed, 1 Aug 2018 07:42:46 +0000 (09:42 +0200)]
Document #39364 (WIP)

5 years agoAuto merge of #52234 - petrochenkov:macuse2, r=Mark-Simulacrum
bors [Tue, 31 Jul 2018 20:52:14 +0000 (20:52 +0000)]
Auto merge of #52234 - petrochenkov:macuse2, r=Mark-Simulacrum

resolve: Modularize crate-local `#[macro_export] macro_rules`

Based on https://github.com/rust-lang/rust/pull/50911, cc https://github.com/rust-lang/rust/pull/50911#issuecomment-401151270

`#[macro_export] macro_rules` items are collected from the whole crate and are planted into the root module as items, so the external view of the crate is symmetric with its internal view and something like `$crate::my_macro` where `my_macro` is `#[macro_export] macro_rules` works both locally and from other crates.

Closes https://github.com/rust-lang/rust/issues/52726

5 years agoAuto merge of #52461 - irinagpopa:safe-llvm, r=nikomatsakis
bors [Tue, 31 Jul 2018 13:32:32 +0000 (13:32 +0000)]
Auto merge of #52461 - irinagpopa:safe-llvm, r=nikomatsakis

 rustc_codegen_llvm: use safe references for LLVM FFI types.

Part of #45274.

5 years agorustc_llvm: fix linking on mingw.
Irina Popa [Tue, 31 Jul 2018 12:36:38 +0000 (15:36 +0300)]
rustc_llvm: fix linking on mingw.

5 years agoAuto merge of #50267 - humanenginuity:master, r=alexcrichton
bors [Tue, 31 Jul 2018 11:20:16 +0000 (11:20 +0000)]
Auto merge of #50267 - humanenginuity:master, r=alexcrichton

Implement inner deref for Option and Result

tracking issue: #50264

5 years agoAuto merge of #52850 - SimonSapin:unstablize, r=alexcrichton
bors [Tue, 31 Jul 2018 09:08:33 +0000 (09:08 +0000)]
Auto merge of #52850 - SimonSapin:unstablize, r=alexcrichton

Revert "Stabilize to_bytes and from_bytes for integers."

This reverts commit c8f9b84b393915a48253e3edc862c15a9b7152a7 / PR https://github.com/rust-lang/rust/pull/51835, and reopens the tracking issue https://github.com/rust-lang/rust/issues/49792.

These methods were stabilized in Rust 1.29, which is still in Nightly as of this writing. So my understanding is that it is still time to change our minds. Given the ongoing discussion in https://github.com/rust-lang/rust/pull/51919 about possibly renaming these APIs and since 1.29 goes to beta soon, I’d like to revert this stabilization for now until a decision is made in that PR. It’s possible that a decision will be made in time for 1.29, but there is no urgency. At most I expect this functionality to make it into 1.30.

5 years agoAuto merge of #52630 - Mark-Simulacrum:rustdoc-cleanup-2, r=QuietMisdreavus
bors [Tue, 31 Jul 2018 07:02:10 +0000 (07:02 +0000)]
Auto merge of #52630 - Mark-Simulacrum:rustdoc-cleanup-2, r=QuietMisdreavus

Delete unused code in rustdoc

Also hid the unused crate exports of rustdoc. This is technically a breaking change but we don't even ship librustdoc in the sysroot so I don't expect breakage.

5 years agoAuto merge of #52863 - steveklabnik:update-books, r=Mark-Simulacrum
bors [Tue, 31 Jul 2018 03:30:47 +0000 (03:30 +0000)]
Auto merge of #52863 - steveklabnik:update-books, r=Mark-Simulacrum

update books for new release

r? @Mark-Simulacrum

5 years agoAuto merge of #52731 - nikomatsakis:issue-52057-inference-variable, r=pnkfelix
bors [Tue, 31 Jul 2018 01:25:49 +0000 (01:25 +0000)]
Auto merge of #52731 - nikomatsakis:issue-52057-inference-variable, r=pnkfelix

Issue 52057 — inference variable

Break out the computation of universal region relations and do it during the typeck, where we can handle the resulting constraints that arise.

r? @pnkfelix

5 years agoregion_infer: rustfmt, pacifying the mercilous tidy
Niko Matsakis [Thu, 26 Jul 2018 12:38:18 +0000 (15:38 +0300)]
region_infer: rustfmt, pacifying the mercilous tidy

5 years agoassert no region obligations on entering custom type op
Niko Matsakis [Thu, 26 Jul 2018 12:19:21 +0000 (15:19 +0300)]
assert no region obligations on entering custom type op

Fixes #51649

5 years agofree RegionBoundPairs earlier and avoid normalizing twice
Niko Matsakis [Thu, 26 Jul 2018 12:07:22 +0000 (15:07 +0300)]
free RegionBoundPairs earlier and avoid normalizing twice

Normalization results are memoized, so this may not be worth it, but it
seems easy enough to do.

5 years agoremove `region_bound_pairs` from FRR as they are not needed later
Niko Matsakis [Thu, 26 Jul 2018 11:52:56 +0000 (14:52 +0300)]
remove `region_bound_pairs` from FRR as they are not needed later

5 years agomake a free fn for creating the URR
Niko Matsakis [Thu, 26 Jul 2018 11:49:45 +0000 (14:49 +0300)]
make a free fn for creating the URR

5 years agoadd regression test for #52057
Niko Matsakis [Thu, 26 Jul 2018 11:38:40 +0000 (14:38 +0300)]
add regression test for #52057

Fixes #52057

5 years agoremove universal-region-relation computation from universal_regions
Niko Matsakis [Thu, 26 Jul 2018 11:30:22 +0000 (14:30 +0300)]
remove universal-region-relation computation from universal_regions

5 years agointroduce, but do not use, `free_region_relation` computation
Niko Matsakis [Thu, 26 Jul 2018 03:54:31 +0000 (06:54 +0300)]
introduce, but do not use, `free_region_relation` computation

This duplicates, effectively, existing code in the universal regions
computation.

5 years agoDelete unused code in rustdoc
Mark Rousskov [Sun, 22 Jul 2018 21:01:09 +0000 (15:01 -0600)]
Delete unused code in rustdoc

5 years agorustc_codegen_llvm: fix ownership of DIBuilder.
Irina Popa [Tue, 17 Jul 2018 15:45:33 +0000 (18:45 +0300)]
rustc_codegen_llvm: fix ownership of DIBuilder.

5 years agorustc_codegen_llvm: fix ownership of Builder.
Irina Popa [Tue, 17 Jul 2018 15:33:09 +0000 (18:33 +0300)]
rustc_codegen_llvm: fix ownership of Builder.

5 years agorustc_codegen_llvm: fix tidy errors.
Irina Popa [Tue, 17 Jul 2018 15:26:58 +0000 (18:26 +0300)]
rustc_codegen_llvm: fix tidy errors.

5 years agorustc_codegen_llvm: use safe references for ThinLTOData.
Irina Popa [Tue, 17 Jul 2018 13:43:49 +0000 (16:43 +0300)]
rustc_codegen_llvm: use safe references for ThinLTOData.

5 years agorustc_codegen_llvm: use safe references for ThinLTOBuffer.
Irina Popa [Tue, 17 Jul 2018 13:31:09 +0000 (16:31 +0300)]
rustc_codegen_llvm: use safe references for ThinLTOBuffer.

5 years agorustc_codegen_llvm: use safe references for ModuleBuffer.
Irina Popa [Tue, 17 Jul 2018 13:08:25 +0000 (16:08 +0300)]
rustc_codegen_llvm: use safe references for ModuleBuffer.

5 years agorustc_codegen_llvm: use safe references for RustArchiveMember.
Irina Popa [Tue, 17 Jul 2018 13:00:10 +0000 (16:00 +0300)]
rustc_codegen_llvm: use safe references for RustArchiveMember.

5 years agorustc_codegen_llvm: use safe references for ArchiveChild.
Irina Popa [Tue, 17 Jul 2018 12:02:11 +0000 (15:02 +0300)]
rustc_codegen_llvm: use safe references for ArchiveChild.

5 years agorustc_codegen_llvm: use safe references for ArchiveIterator.
Irina Popa [Tue, 17 Jul 2018 11:31:06 +0000 (14:31 +0300)]
rustc_codegen_llvm: use safe references for ArchiveIterator.

5 years agorustc_codegen_llvm: use safe references for Linker.
Irina Popa [Tue, 17 Jul 2018 11:26:22 +0000 (14:26 +0300)]
rustc_codegen_llvm: use safe references for Linker.

5 years agorustc_codegen_llvm: use safe references for SectionIterator.
Irina Popa [Tue, 17 Jul 2018 11:22:02 +0000 (14:22 +0300)]
rustc_codegen_llvm: use safe references for SectionIterator.

5 years agorustc_codegen_llvm: use safe references for PassManager.
Irina Popa [Tue, 17 Jul 2018 11:17:47 +0000 (14:17 +0300)]
rustc_codegen_llvm: use safe references for PassManager.

5 years agorustc_codegen_llvm: use safe references for OperandBundleDef.
Irina Popa [Mon, 16 Jul 2018 13:02:31 +0000 (16:02 +0300)]
rustc_codegen_llvm: use safe references for OperandBundleDef.

5 years agorustc_codegen_llvm: use safe mutable references for output parameters.
Irina Popa [Fri, 13 Jul 2018 12:27:55 +0000 (15:27 +0300)]
rustc_codegen_llvm: use safe mutable references for output parameters.

5 years agorustc_codegen_llvm: use safe references for RustString.
Irina Popa [Fri, 13 Jul 2018 11:43:12 +0000 (14:43 +0300)]
rustc_codegen_llvm: use safe references for RustString.

5 years agorustc_codegen_llvm: use safe references for Twine, DiagnosticInfo, SMDiagnostic.
Irina Popa [Fri, 13 Jul 2018 10:59:41 +0000 (13:59 +0300)]
rustc_codegen_llvm: use safe references for Twine, DiagnosticInfo, SMDiagnostic.

5 years agorustc_codegen_llvm: use safe references for Archive.
Irina Popa [Fri, 13 Jul 2018 10:06:06 +0000 (13:06 +0300)]
rustc_codegen_llvm: use safe references for Archive.

5 years agorustc_codegen_llvm: use safe references for TargetMachine.
Irina Popa [Thu, 12 Jul 2018 15:34:59 +0000 (18:34 +0300)]
rustc_codegen_llvm: use safe references for TargetMachine.

5 years agorustc_codegen_llvm: use safe references for Pass.
Irina Popa [Thu, 12 Jul 2018 15:00:49 +0000 (18:00 +0300)]
rustc_codegen_llvm: use safe references for Pass.

5 years agorustc_codegen_llvm: use safe references for PassManagerBuilder.
Irina Popa [Thu, 12 Jul 2018 13:24:09 +0000 (16:24 +0300)]
rustc_codegen_llvm: use safe references for PassManagerBuilder.

5 years agorustc_codegen_llvm: use safe references for MemoryBuffer and ObjectFile.
Irina Popa [Tue, 10 Jul 2018 16:19:17 +0000 (19:19 +0300)]
rustc_codegen_llvm: use safe references for MemoryBuffer and ObjectFile.

5 years agorustc_codegen_llvm: remove more unused functions.
Irina Popa [Tue, 10 Jul 2018 15:00:02 +0000 (18:00 +0300)]
rustc_codegen_llvm: remove more unused functions.

5 years agorustc_codegen_llvm: remove unused UseRef type.
Irina Popa [Tue, 10 Jul 2018 11:37:52 +0000 (14:37 +0300)]
rustc_codegen_llvm: remove unused UseRef type.

5 years agorustc_codegen_llvm: use safe references for BasicBlock.
Irina Popa [Tue, 10 Jul 2018 11:34:34 +0000 (14:34 +0300)]
rustc_codegen_llvm: use safe references for BasicBlock.

5 years agorustc_codegen_llvm: use safe references for Value.
Irina Popa [Tue, 10 Jul 2018 10:28:39 +0000 (13:28 +0300)]
rustc_codegen_llvm: use safe references for Value.

5 years agorustc_codegen_llvm: remove _opaque suffix.
Irina Popa [Thu, 5 Jul 2018 10:38:44 +0000 (13:38 +0300)]
rustc_codegen_llvm: remove _opaque suffix.

5 years agorustc_codegen_llvm: remove #![allow(dead_code)] from llvm.
Irina Popa [Wed, 4 Jul 2018 16:16:13 +0000 (19:16 +0300)]
rustc_codegen_llvm: remove #![allow(dead_code)] from llvm.

5 years agorustc_codegen_llvm: remove unused ExecutionEngineRef type.
Irina Popa [Wed, 4 Jul 2018 13:45:48 +0000 (16:45 +0300)]
rustc_codegen_llvm: remove unused ExecutionEngineRef type.

5 years agorustc_codegen_llvm: use safe references for Metadata and DI*.
Irina Popa [Wed, 4 Jul 2018 13:36:49 +0000 (16:36 +0300)]
rustc_codegen_llvm: use safe references for Metadata and DI*.

5 years agorustc_codegen_llvm: use safe references for DIBuilder.
Irina Popa [Tue, 3 Jul 2018 13:02:38 +0000 (16:02 +0300)]
rustc_codegen_llvm: use safe references for DIBuilder.

5 years agorustc_codegen_llvm: use safe references for Builder.
Irina Popa [Tue, 3 Jul 2018 12:49:43 +0000 (15:49 +0300)]
rustc_codegen_llvm: use safe references for Builder.

5 years agorustc_codegen_llvm: use safe references for Type.
Irina Popa [Mon, 2 Jul 2018 14:52:53 +0000 (17:52 +0300)]
rustc_codegen_llvm: use safe references for Type.

5 years agorustc_codegen_llvm: use safe references for Context and Module.
Irina Popa [Wed, 27 Jun 2018 14:57:25 +0000 (17:57 +0300)]
rustc_codegen_llvm: use safe references for Context and Module.

5 years agorustc_codegen_llvm: move from empty enums to extern types.
Irina Popa [Wed, 27 Jun 2018 10:12:47 +0000 (13:12 +0300)]
rustc_codegen_llvm: move from empty enums to extern types.

5 years agoupdate books for new release
steveklabnik [Mon, 30 Jul 2018 15:09:48 +0000 (11:09 -0400)]
update books for new release

5 years agorustc_llvm: move to rustc_codegen_llvm::llvm.
Irina Popa [Tue, 29 May 2018 17:41:36 +0000 (20:41 +0300)]
rustc_llvm: move to rustc_codegen_llvm::llvm.

5 years agoAuto merge of #52697 - ljedrz:misc_data_structures, r=Mark-Simulacrum
bors [Mon, 30 Jul 2018 12:20:58 +0000 (12:20 +0000)]
Auto merge of #52697 - ljedrz:misc_data_structures, r=Mark-Simulacrum

Simplify a few functions in rustc_data_structures

- drop `try!()` where it's superfluous
- change `try!()` to `?`
- squash a `push` with `push_str`
- refactor a push loop into an iterator

5 years agoAuto merge of #52830 - matthewjasper:bootstrap-prep, r=matthewjasper
bors [Mon, 30 Jul 2018 10:19:38 +0000 (10:19 +0000)]
Auto merge of #52830 - matthewjasper:bootstrap-prep, r=matthewjasper

[NLL] Fix some things for bootstrap

Some changes that are required when bootstrapping rustc with NLL enabled.

* Remove a bunch of unused `mut`s that aren't needed, but the existing lint doesn't catch.
* Rewrite a function call to satisfy NLL borrowck. Note that the borrow is two-phase, but gets activated immediately by an unsizing coercion.

cc #51823

5 years agoRevert "Stabilize to_bytes and from_bytes for integers."
Simon Sapin [Mon, 30 Jul 2018 09:55:20 +0000 (11:55 +0200)]
Revert "Stabilize to_bytes and from_bytes for integers."

This reverts commit c8f9b84b393915a48253e3edc862c15a9b7152a7.

5 years agoAuto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obk
bors [Mon, 30 Jul 2018 08:25:36 +0000 (08:25 +0000)]
Auto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obk

Tweak the raw_identifiers lints in 2018

* Enable the `raw_identifiers` feature automatically in the 2018 preview
* Only emit lint warnings if the `raw_identifiers` feature is activated

cc rust-lang/cargo#5783

5 years agoAuto merge of #52805 - ljedrz:format_str_literal, r=petrochenkov
bors [Mon, 30 Jul 2018 06:29:39 +0000 (06:29 +0000)]
Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkov

Don't format!() string literals

Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.

5 years agoresolved upstream merge conflicts
Brad Gibson [Mon, 30 Jul 2018 03:03:15 +0000 (20:03 -0700)]
resolved upstream merge conflicts

5 years agoAuto merge of #52823 - RalfJung:test, r=eddyb
bors [Mon, 30 Jul 2018 04:34:19 +0000 (04:34 +0000)]
Auto merge of #52823 - RalfJung:test, r=eddyb

invalid_const_promotion: check if we get the right signal

r? @eddyb

5 years agoAuto merge of #52828 - Mark-Simulacrum:clear-rustdoc-check, r=alexcrichton
bors [Mon, 30 Jul 2018 01:08:13 +0000 (01:08 +0000)]
Auto merge of #52828 - Mark-Simulacrum:clear-rustdoc-check, r=alexcrichton

Clear out rustdoc check builds if dependencies change

r? @alexcrichton

5 years agoAuto merge of #52738 - ljedrz:push_to_extend, r=eddyb
bors [Sun, 29 Jul 2018 21:37:47 +0000 (21:37 +0000)]
Auto merge of #52738 - ljedrz:push_to_extend, r=eddyb

Replace push loops with extend() where possible

Or set the vector capacity where I couldn't do it.

According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop:

10 elements (6.1 times faster):
```
test bench_extension ... bench:          75 ns/iter (+/- 23)
test bench_push_loop ... bench:         458 ns/iter (+/- 142)
```

100 elements (11.12 times faster):
```
test bench_extension ... bench:          87 ns/iter (+/- 26)
test bench_push_loop ... bench:         968 ns/iter (+/- 3,528)
```

1000 elements (11.04 times faster):
```
test bench_extension ... bench:         311 ns/iter (+/- 9)
test bench_push_loop ... bench:       3,436 ns/iter (+/- 233)
```

Seems like a good idea to use `extend` as much as possible.

5 years agoAuto merge of #51361 - oli-obk:sanity_check_consts, r=nikomatsakis
bors [Sun, 29 Jul 2018 19:37:28 +0000 (19:37 +0000)]
Auto merge of #51361 - oli-obk:sanity_check_consts, r=nikomatsakis

Do a basic sanity check for all constant values

## Motivation and high level overview

There has been some back and forth in this PR between @RalfJung and me in here about the motivation for this change and the stance it takes on unsafe coding guidelines.

The initial implementation ran its checks on every value read (so `*x`, `y = x`, ...). In unsafe code that isn't reasonable, because we might be invalidating invariants for a short time in order to build up a proper value.

The current implementation is a lint that runs its checks statics and constants. There is no need to check array lengths and enum variants, because it's a hard error to end up with anything but a number, and that one even has to have the required bits to be defined.

## What checks are done?

* Some type related checks
    * `char` needs to be a correct unicode character as defined by `char::from_u32`
    * A reference to a ZST must have the correct alignment (and be nonzero)
    * A reference to anything is dereferenced and its value is checked
* Layout checks use the information from `ty::Layout` to check
    * all fields of structs
    * all elements of arrays
    * enum discriminants
    * the fields of an enum variant (the variant is decided by the discriminant)
    * whether any union field succeeds in being checked (if none match the memory pattern, the check fails)
    * if the value is in the range described by the layout (e.g. for `NonZero*` types)

Changing the layout of a type will thus automatically cause the checks to check for the new layout.

fixes #51330
fixes #51471

cc @RalfJung

r? @eddyb

5 years agodont hardcode vtable size in codegen test
Ralf Jung [Sun, 29 Jul 2018 10:34:19 +0000 (12:34 +0200)]
dont hardcode vtable size in codegen test

5 years agoupdate codegen tests
Ralf Jung [Sun, 29 Jul 2018 10:14:51 +0000 (12:14 +0200)]
update codegen tests

5 years agoMove a test that depends on the arch bitwidth to compile-fail
Oliver Schneider [Thu, 26 Jul 2018 15:46:09 +0000 (17:46 +0200)]
Move a test that depends on the arch bitwidth to compile-fail

5 years agoUpdate miri submodule
Oliver Schneider [Thu, 26 Jul 2018 12:38:41 +0000 (14:38 +0200)]
Update miri submodule

5 years agoSanity-check all constants
Oliver Schneider [Mon, 4 Jun 2018 16:32:06 +0000 (18:32 +0200)]
Sanity-check all constants

5 years agoChange order of copy and borrow to avoid conflict
Matthew Jasper [Sun, 29 Jul 2018 17:02:13 +0000 (18:02 +0100)]
Change order of copy and borrow to avoid conflict

Note that the first argument is `self as &mut dyn Delegate`, so this
isn't allowed with two-phase borrows.

5 years agoRemove unused `mut`s
Matthew Jasper [Sun, 29 Jul 2018 16:40:36 +0000 (17:40 +0100)]
Remove unused `mut`s

5 years agoReplace push loops with collect() and extend() where possible
ljedrz [Thu, 26 Jul 2018 15:11:10 +0000 (17:11 +0200)]
Replace push loops with collect() and extend() where possible

5 years agoresolve: Modularize crate-local `#[macro_export] macro_rules`
Vadim Petrochenkov [Sun, 29 Jul 2018 11:51:17 +0000 (14:51 +0300)]
resolve: Modularize crate-local `#[macro_export] macro_rules`

5 years agoClear out rustdoc check builds if dependencies change
Mark Rousskov [Sun, 29 Jul 2018 15:03:37 +0000 (09:03 -0600)]
Clear out rustdoc check builds if dependencies change

5 years agoAuto merge of #52620 - mikhail-m1:51351, r=nikomatsakis
bors [Sun, 29 Jul 2018 13:23:01 +0000 (13:23 +0000)]
Auto merge of #52620 - mikhail-m1:51351, r=nikomatsakis

fix simple case of issue #51351 and #52133

r? @nikomatsakis

5 years agoAuto merge of #52755 - kennytm:update-rustfmt, r=nrc
bors [Sun, 29 Jul 2018 11:27:48 +0000 (11:27 +0000)]
Auto merge of #52755 - kennytm:update-rustfmt, r=nrc

Update rustfmt and RLS

5 years agoinvalid_const_promotion: check if we get the right signal
Ralf Jung [Sun, 29 Jul 2018 11:11:01 +0000 (13:11 +0200)]
invalid_const_promotion: check if we get the right signal

5 years agoUpdate RLS and rustfmt.
kennytm [Thu, 26 Jul 2018 21:58:55 +0000 (05:58 +0800)]
Update RLS and rustfmt.

5 years agoTest clippy first to workaround the derive-new conflict.
kennytm [Sun, 29 Jul 2018 11:05:29 +0000 (19:05 +0800)]
Test clippy first to workaround the derive-new conflict.

5 years agofix issues #51351 and #52133
Mikhail Modin [Fri, 27 Jul 2018 21:46:16 +0000 (22:46 +0100)]
fix issues #51351 and #52133

5 years agoAuto merge of #52767 - ljedrz:avoid_format, r=petrochenkov
bors [Sun, 29 Jul 2018 09:33:37 +0000 (09:33 +0000)]
Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkov

Prefer to_string() to format!()

Simple benchmarks suggest in some cases it can be faster by even 37%:
```
test converting_f64_long  ... bench:         339 ns/iter (+/- 199)
test converting_f64_short ... bench:         136 ns/iter (+/- 34)
test converting_i32_long  ... bench:          87 ns/iter (+/- 16)
test converting_i32_short ... bench:          87 ns/iter (+/- 49)
test converting_str       ... bench:          54 ns/iter (+/- 15)
test formatting_f64_long  ... bench:         349 ns/iter (+/- 176)
test formatting_f64_short ... bench:         145 ns/iter (+/- 14)
test formatting_i32_long  ... bench:          98 ns/iter (+/- 14)
test formatting_i32_short ... bench:          93 ns/iter (+/- 15)
test formatting_str       ... bench:          86 ns/iter (+/- 23)
```

5 years agoExempt cloudabi from license check.
kennytm [Sun, 29 Jul 2018 03:54:27 +0000 (11:54 +0800)]
Exempt cloudabi from license check.

5 years agoCopy the test_data/ RLS tests into a writable directory.
kennytm [Sat, 28 Jul 2018 19:36:18 +0000 (03:36 +0800)]
Copy the test_data/ RLS tests into a writable directory.

See rust-lang-nursery/rls#966 for details.

5 years agoAuto merge of #52764 - sinkuu:cleanup, r=nikomatsakis
bors [Sun, 29 Jul 2018 06:32:24 +0000 (06:32 +0000)]
Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakis

Misc cleanups

5 years agoAuto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomez
bors [Sun, 29 Jul 2018 03:20:54 +0000 (03:20 +0000)]
Auto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomez

rustdoc: rework how default passes are chosen

This is a refactor that changes how we select default passes, and changes the set of passes used for `--document-private-items`. It's groundwork for a bigger refactor i want to do.

The major changes:

* There are now two sets of "default passes": one set for "no flags given" and one for "document private items".
* These sets can be selected by a new `DefaultPassOption` enum, which is selected from based on the presence of `--no-defaults` or `--document-private-items` CLI flags, or their associated crate attributes.
* When printing the list of passes, we also print the list of passes for `--document-private-items` in addition to the "default defaults".
* I added `propagate-doc-cfg` and `strip-priv-imports` to the "document private items" set. The former is to ensure items are properly tagged with the full set of cfg flags even when "document private items" is active. The latter is based on feedback and personal experience navigating the `rustc` docs, which use that flag. `strip-priv-imports` only removes non-pub `use` statements, so it should be harmless from a documentation standpoint to remove those items from "private items" documentation.

5 years agoAuto merge of #52720 - alexcrichton:update-cargo-and-rustfix, r=nikomatsakis
bors [Sun, 29 Jul 2018 01:14:39 +0000 (01:14 +0000)]
Auto merge of #52720 - alexcrichton:update-cargo-and-rustfix, r=nikomatsakis

Update the Cargo submodule and rustfix

Should hopefully bring in a few more `cargo fix`-related fixes.

5 years agoAuto merge of #52355 - pietroalbini:zfeature, r=eddyb
bors [Sat, 28 Jul 2018 23:10:10 +0000 (23:10 +0000)]
Auto merge of #52355 - pietroalbini:zfeature, r=eddyb

Add the -Zcrate-attr=foo unstable rustc option

This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code.

The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable.

cc https://github.com/rust-lang-nursery/crater/issues/282 @Mark-Simulacrum

5 years agoAuto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus
bors [Sat, 28 Jul 2018 20:44:17 +0000 (20:44 +0000)]
Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus

[rustdoc] Generic impls

Fixes #33772.

r? @QuietMisdreavus

5 years agoAuto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelix
bors [Sat, 28 Jul 2018 18:41:40 +0000 (18:41 +0000)]
Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelix

do not overwrite child def-id in place but rather remove/insert

When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later.

Fixes #52050

r? @aturon -- do you still remember this code at all? :)

5 years agoMove blanket implementations generation into its own function
Guillaume Gomez [Sat, 28 Jul 2018 18:27:10 +0000 (20:27 +0200)]
Move blanket implementations generation into its own function

5 years agoRemove core exclusion condition
Guillaume Gomez [Sat, 28 Jul 2018 17:06:25 +0000 (19:06 +0200)]
Remove core exclusion condition

5 years agoUpdate the Cargo submodule and rustfix
Alex Crichton [Thu, 26 Jul 2018 00:25:12 +0000 (17:25 -0700)]
Update the Cargo submodule and rustfix

Should hopefully bring in a few more `cargo fix`-related fixes.

5 years agoAuto merge of #52744 - RalfJung:align_offset, r=Kimundi
bors [Sat, 28 Jul 2018 16:44:21 +0000 (16:44 +0000)]
Auto merge of #52744 - RalfJung:align_offset, r=Kimundi

make memrchr use align_offset

I hope I did not screw that up...

Cc @oli-obk who authored the original https://github.com/rust-lang/rust/pull/44537

Fixes #50567 (thanks @bjorn3)

5 years agoDon't format!() string literals
ljedrz [Sat, 28 Jul 2018 12:40:32 +0000 (14:40 +0200)]
Don't format!() string literals

5 years agoAuto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakis
bors [Sat, 28 Jul 2018 14:26:16 +0000 (14:26 +0000)]
Auto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakis

Change ManuallyDrop<T> to a lang item.

This PR implements the approach @RalfJung proposes in https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025 (lang item `struct` instead of `union`).

A followup PR can easily solve #47034 as well, by just adding a few `?Sized` to `libcore/mem.rs`.

r? @nikomatsakis

5 years agoDon't display full blanket implementation and put it into its own section
Guillaume Gomez [Fri, 27 Jul 2018 20:59:16 +0000 (22:59 +0200)]
Don't display full blanket implementation and put it into its own section

5 years agoAuto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakis
bors [Sat, 28 Jul 2018 11:37:41 +0000 (11:37 +0000)]
Auto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakis

static infer feature gate

https://github.com/rust-lang/rust/issues/44493

r? @nikomatsakis

5 years agoAuto merge of #52802 - kennytm:rollup, r=kennytm
bors [Sat, 28 Jul 2018 09:40:05 +0000 (09:40 +0000)]
Auto merge of #52802 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #52702 (Suggest fix when encountering different mutability from impl to trait)
 - #52703 (Improve a few vectors - calculate capacity or build from iterators)
 - #52740 (Suggest underscore when using dashes in crate namet push fork)
 - #52759 (Impl Send & Sync for JoinHandle)
 - #52760 (rustc_metadata: test loading atoi instead of cos)
 - #52763 (Omit the vendor component in Fuchsia triple)
 - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag)
 - #52769 (Incorporate a stray test)
 - #52777 (Fix doc comment for 'ptr::copy_to' method)
 - #52779 (revert accidental atty downgrade)
 - #52781 (Use a slice where a vector is not necessary)

Failed merges:

r? @ghost

5 years agoRollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
kennytm [Sat, 28 Jul 2018 08:25:07 +0000 (16:25 +0800)]
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis

Use a slice where a vector is not necessary