]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoUse real type names rather than Self::
Denis Merigoux [Thu, 23 Aug 2018 13:23:48 +0000 (15:23 +0200)]
Use real type names rather than Self::

5 years agoRemoved parasite yaml file and put explicit lifetimes
Denis Merigoux [Thu, 23 Aug 2018 08:10:53 +0000 (10:10 +0200)]
Removed parasite yaml file and put explicit lifetimes

5 years agoUse associated types instead of type parameters inside the BuilderMethods trait
Denis Merigoux [Wed, 22 Aug 2018 16:57:31 +0000 (18:57 +0200)]
Use associated types instead of type parameters inside the BuilderMethods trait

5 years agoRemoved genericity over Value in various functions
Denis Merigoux [Wed, 22 Aug 2018 15:48:32 +0000 (17:48 +0200)]
Removed genericity over Value in various functions
Prelude to using associated types in traits rather than type parameters

5 years agoGeneralized AsmDialect for BuilderMethods
Denis Merigoux [Tue, 21 Aug 2018 16:22:29 +0000 (18:22 +0200)]
Generalized AsmDialect for BuilderMethods

5 years agoGeneralized SynchronisationScope for BuilderMethods
Denis Merigoux [Tue, 21 Aug 2018 16:15:29 +0000 (18:15 +0200)]
Generalized SynchronisationScope for BuilderMethods

5 years agoGeneralized AtomicOrdering for BuilderMethods
Denis Merigoux [Tue, 21 Aug 2018 16:08:20 +0000 (18:08 +0200)]
Generalized AtomicOrdering for BuilderMethods

5 years agoGeneralized AtomicRmwBinOp for BuilderMethods
Denis Merigoux [Tue, 21 Aug 2018 15:54:12 +0000 (17:54 +0200)]
Generalized AtomicRmwBinOp for BuilderMethods

5 years agoGeneralized OperandBundleDef in BuilderMethods
Denis Merigoux [Tue, 21 Aug 2018 15:39:43 +0000 (17:39 +0200)]
Generalized OperandBundleDef in BuilderMethods

5 years agoRemoved useless traits for IntPredicate and RealPredicate
Denis Merigoux [Tue, 21 Aug 2018 14:31:36 +0000 (16:31 +0200)]
Removed useless traits for IntPredicate and RealPredicate

5 years agoGeneralized RealPredicate
Denis Merigoux [Tue, 21 Aug 2018 11:54:41 +0000 (13:54 +0200)]
Generalized RealPredicate

5 years agoGeneralized IntPredicate in the BuilderMethods trait
Denis Merigoux [Mon, 20 Aug 2018 16:16:51 +0000 (18:16 +0200)]
Generalized IntPredicate in the BuilderMethods trait

5 years agoGeneralized BasicBlocks in BuilderMethods trait
Denis Merigoux [Mon, 20 Aug 2018 15:44:18 +0000 (17:44 +0200)]
Generalized BasicBlocks in BuilderMethods trait

5 years agoGeneralized base.rs#call_memcpy and everything that it uses
Denis Merigoux [Tue, 7 Aug 2018 15:14:40 +0000 (17:14 +0200)]
Generalized base.rs#call_memcpy and everything that it uses

Generalized operand.rs#nontemporal_store and fixed tidy issues

Generalized operand.rs#nontemporal_store's implem even more
With a BuilderMethod trait implemented by Builder for LLVM

Cleaned builder.rs : no more code duplication, no more ValueTrait

Full traitification of builder.rs

5 years agoReduced line length to pass tidy
Denis Merigoux [Fri, 3 Aug 2018 12:20:10 +0000 (14:20 +0200)]
Reduced line length to pass tidy

Generalized FunctionCx

Added ValueTrait and first change

Generalize CondegenCx

Generalized the Builder struct defined in librustc_codegen_llvm/builder.rs

5 years agoWork around to fix issue https://github.com/rust-lang/rust/issues/53912
Denis Merigoux [Thu, 6 Sep 2018 17:23:42 +0000 (10:23 -0700)]
Work around to fix issue https://github.com/rust-lang/rust/issues/53912

5 years agorustc_codegen_llvm: begin generalizing over backend values.
Irina Popa [Thu, 2 Aug 2018 14:48:44 +0000 (17:48 +0300)]
rustc_codegen_llvm: begin generalizing over backend values.

5 years agoAuto merge of #55948 - matthiaskrgr:clippy, r=oli-obk
bors [Thu, 15 Nov 2018 18:35:38 +0000 (18:35 +0000)]
Auto merge of #55948 - matthiaskrgr:clippy, r=oli-obk

submodules: update clippy from d8b42690 to 7e0ddef4

Fixes clippy toolstate.

Changes:
````
rustup https://github.com/rust-lang/rust/pull/55852/
Fix "too" -> "foo" typo in format.rs
Fix `use_self` violation
Fix wrong suggestion for `redundant_closure_call`
Check for common metadata
Fix `use_self` false positive on `use` statements
Fix `use_self` false positive
Remove `+` from `has_unary_equivalent`
Fix dogfood
Update println! formatting
Fix false positive in check mode caused by `gen_deprecated`
RIIR update lints: Add check mode (update_lints.py rewrite complete)
changed into_iter to iter and fixed a lint check
Fix `collapsible_if` error
Fix `possible_missing_comma` false positives
format code
fix comment spacing
change single char str to char
add lint to lintarray macro
Revert "small fix"
small fix
added float support for mistyped literal lints
tmp progress
````

5 years agosubmodules: update clippy from d8b42690 to f5d868c9
Matthias Krüger [Wed, 14 Nov 2018 13:49:40 +0000 (14:49 +0100)]
submodules: update clippy from d8b42690 to f5d868c9

Fixes clippy toolstate.

Changes:
````
rustup https://github.com/rust-lang/rust/pull/55852/
Fix "too" -> "foo" typo in format.rs
Fix `use_self` violation
Fix wrong suggestion for `redundant_closure_call`
Check for common metadata
Fix `use_self` false positive on `use` statements
Fix `use_self` false positive
Remove `+` from `has_unary_equivalent`
Fix dogfood
Update println! formatting
Fix false positive in check mode caused by `gen_deprecated`
RIIR update lints: Add check mode (update_lints.py rewrite complete)
changed into_iter to iter and fixed a lint check
Fix `collapsible_if` error
Fix `possible_missing_comma` false positives
format code
fix comment spacing
change single char str to char
add lint to lintarray macro
Revert "small fix"
small fix
added float support for mistyped literal lints
tmp progress
````

5 years agoAuto merge of #55974 - pietroalbini:rollup, r=pietroalbini
bors [Thu, 15 Nov 2018 12:43:01 +0000 (12:43 +0000)]
Auto merge of #55974 - pietroalbini:rollup, r=pietroalbini

Rollup of 17 pull requests

Successful merges:

 - #55182 (Redox: Update to new changes)
 - #55211 (Add BufWriter::buffer method)
 - #55507 (Add link to std::mem::size_of to size_of intrinsic documentation)
 - #55530 (Speed up String::from_utf16)
 - #55556 (Use `Mmap` to open the rmeta file.)
 - #55622 (NetBSD: link libstd with librt in addition to libpthread)
 - #55750 (Make `NodeId` and `HirLocalId` `newtype_index`)
 - #55778 (Wrap some query results in `Lrc`.)
 - #55781 (More precise spans for temps and their drops)
 - #55785 (Add mem::forget_unsized() for forgetting unsized values)
 - #55852 (Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint)
 - #55865 (Unix RwLock: avoid racy access to write_locked)
 - #55901 (fix various typos in doc comments)
 - #55926 (Change sidebar selector to fix compatibility with docs.rs)
 - #55930 (A handful of hir tweaks)
 - #55932 (core/char: Speed up `to_digit()` for `radix <= 10`)
 - #55956 (add tests for some fixed ICEs)

Failed merges:

r? @ghost

5 years agoRollup merge of #55956 - euclio:issue-55587, r=estebank
Pietro Albini [Thu, 15 Nov 2018 10:04:47 +0000 (11:04 +0100)]
Rollup merge of #55956 - euclio:issue-55587, r=estebank

add tests for some fixed ICEs

Fixes #55587.
Fixes #54348.

Looks like these ICEs are already fixed in nightly, so this PR just adds tests.

r? @estebank

5 years agoRollup merge of #55932 - Turbo87:to_digit, r=alexcrichton
Pietro Albini [Thu, 15 Nov 2018 10:04:46 +0000 (11:04 +0100)]
Rollup merge of #55932 - Turbo87:to_digit, r=alexcrichton

core/char: Speed up `to_digit()` for `radix <= 10`

I noticed that `char::to_digit()` seemed to do a bit of extra work for handling `[a-zA-Z]` characters. Since `to_digit(10)` seems to be the most common case (at least in the `rust` codebase) I thought it might be valuable to create a fast path for that case, and according to the benchmarks that I added in one of the commits it seems to pay off. I also created another fast path for the `radix < 10` case, which also seems to have a positive effect.

It is very well possible that I'm measuring something entirely unrelated though, so please verify these numbers and let me know if I missed something!

### Before

```
# Run 1
test char::methods::bench_to_digit_radix_10      ... bench:      16,265 ns/iter (+/- 1,774)
test char::methods::bench_to_digit_radix_16      ... bench:      13,938 ns/iter (+/- 2,479)
test char::methods::bench_to_digit_radix_2       ... bench:      13,090 ns/iter (+/- 524)
test char::methods::bench_to_digit_radix_36      ... bench:      14,236 ns/iter (+/- 1,949)

# Run 2
test char::methods::bench_to_digit_radix_10      ... bench:      16,176 ns/iter (+/- 1,589)
test char::methods::bench_to_digit_radix_16      ... bench:      13,896 ns/iter (+/- 3,140)
test char::methods::bench_to_digit_radix_2       ... bench:      13,158 ns/iter (+/- 1,112)
test char::methods::bench_to_digit_radix_36      ... bench:      14,206 ns/iter (+/- 1,312)

# Run 3
test char::methods::bench_to_digit_radix_10      ... bench:      16,221 ns/iter (+/- 2,423)
test char::methods::bench_to_digit_radix_16      ... bench:      14,361 ns/iter (+/- 3,926)
test char::methods::bench_to_digit_radix_2       ... bench:      13,097 ns/iter (+/- 671)
test char::methods::bench_to_digit_radix_36      ... bench:      14,388 ns/iter (+/- 1,068)
```

### After

```
# Run 1
test char::methods::bench_to_digit_radix_10      ... bench:      11,521 ns/iter (+/- 552)
test char::methods::bench_to_digit_radix_16      ... bench:      12,926 ns/iter (+/- 684)
test char::methods::bench_to_digit_radix_2       ... bench:      11,266 ns/iter (+/- 1,085)
test char::methods::bench_to_digit_radix_36      ... bench:      14,213 ns/iter (+/- 614)

# Run 2
test char::methods::bench_to_digit_radix_10      ... bench:      11,424 ns/iter (+/- 1,042)
test char::methods::bench_to_digit_radix_16      ... bench:      12,854 ns/iter (+/- 1,193)
test char::methods::bench_to_digit_radix_2       ... bench:      11,193 ns/iter (+/- 716)
test char::methods::bench_to_digit_radix_36      ... bench:      14,249 ns/iter (+/- 3,514)

# Run 3
test char::methods::bench_to_digit_radix_10      ... bench:      11,469 ns/iter (+/- 685)
test char::methods::bench_to_digit_radix_16      ... bench:      12,852 ns/iter (+/- 568)
test char::methods::bench_to_digit_radix_2       ... bench:      11,275 ns/iter (+/- 1,356)
test char::methods::bench_to_digit_radix_36      ... bench:      14,188 ns/iter (+/- 1,501)
```

I ran the benchmark using:

```sh
python x.py bench src/libcore --stage 1 --keep-stage 0 --test-args "bench_to_digit"
```

5 years agoRollup merge of #55930 - ljedrz:hir_bonuses, r=cramertj
Pietro Albini [Thu, 15 Nov 2018 10:04:45 +0000 (11:04 +0100)]
Rollup merge of #55930 - ljedrz:hir_bonuses, r=cramertj

A handful of hir tweaks

- remove an unused `hir_vec` macro pattern
- simplify `fmt::Debug` for `hir::Path` (take advantage of the `Display` implementation)
- remove an unused type alias (`CrateConfig`)
- simplify a `match` expression (join common patterns)

5 years agoRollup merge of #55926 - cynecx:fix-rustdoc-mobile-css, r=GuillaumeGomez
Pietro Albini [Thu, 15 Nov 2018 10:04:43 +0000 (11:04 +0100)]
Rollup merge of #55926 - cynecx:fix-rustdoc-mobile-css, r=GuillaumeGomez

Change sidebar selector to fix compatibility with docs.rs

Fix for #55883.

5 years agoRollup merge of #55901 - euclio:speling, r=petrochenkov
Pietro Albini [Thu, 15 Nov 2018 10:04:42 +0000 (11:04 +0100)]
Rollup merge of #55901 - euclio:speling, r=petrochenkov

fix various typos in doc comments

5 years agoRollup merge of #55865 - RalfJung:unix-rwlock, r=alexcrichton
Pietro Albini [Thu, 15 Nov 2018 10:04:41 +0000 (11:04 +0100)]
Rollup merge of #55865 - RalfJung:unix-rwlock, r=alexcrichton

Unix RwLock: avoid racy access to write_locked

We should only access `write_locked` if we really got the lock.

5 years agoRollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis
Pietro Albini [Thu, 15 Nov 2018 10:04:40 +0000 (11:04 +0100)]
Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis

Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint

Fixes https://github.com/rust-lang/rust/issues/51043.

5 years agoRollup merge of #55785 - stjepang:unsized-drop-forget, r=alexcrichton
Pietro Albini [Thu, 15 Nov 2018 10:04:38 +0000 (11:04 +0100)]
Rollup merge of #55785 - stjepang:unsized-drop-forget, r=alexcrichton

Add mem::forget_unsized() for forgetting unsized values

~~Allows passing values of `T: ?Sized` types to `mem::drop` and `mem::forget`.~~

Adds `mem::forget_unsized()` that accepts `T: ?Sized`.

I had to revert the PR that removed the `forget` intrinsic and replaced it with `ManuallyDrop`: https://github.com/rust-lang/rust/pull/40559
We can't use `ManuallyDrop::new()` here because it needs `T: Sized` and we don't have support for unsized return values yet (will we ever?).

r? @eddyb

5 years agoRollup merge of #55781 - pnkfelix:issue-54382-more-precise-spans-for-temps-and-their...
Pietro Albini [Thu, 15 Nov 2018 10:04:37 +0000 (11:04 +0100)]
Rollup merge of #55781 - pnkfelix:issue-54382-more-precise-spans-for-temps-and-their-drops, r=davidtwco

More precise spans for temps and their drops

This PR has two main enhancements:

 1. when possible during code generation for a statement (like `expr();`), pass along the span of a statement, and then attribute the drops of temporaries from that statement to the statement's end-point (which will be the semicolon if it is a statement that is terminating by a semicolon).
 2. when evaluating a block expression into a MIR temp, use the span of the block's tail expression (rather than the span of whole block including its statements and curly-braces) for the span of the temp.

Each of these individually increases the precision of our diagnostic output; together they combine to make a much clearer picture about the control flow through the spans.

Fix #54382

5 years agoRollup merge of #55778 - nnethercote:LrcPreds, r=eddyb
Pietro Albini [Thu, 15 Nov 2018 10:04:36 +0000 (11:04 +0100)]
Rollup merge of #55778 - nnethercote:LrcPreds, r=eddyb

Wrap some query results in `Lrc`.

So that the frequent clones in `try_get` are cheaper.

5 years agoRollup merge of #55750 - oli-obk:node_id_x, r=michaelwoerister
Pietro Albini [Thu, 15 Nov 2018 10:04:35 +0000 (11:04 +0100)]
Rollup merge of #55750 - oli-obk:node_id_x, r=michaelwoerister

Make `NodeId` and `HirLocalId` `newtype_index`

5 years agoRollup merge of #55622 - jakllsch:netbsd-librt, r=alexcrichton
Pietro Albini [Thu, 15 Nov 2018 10:04:34 +0000 (11:04 +0100)]
Rollup merge of #55622 - jakllsch:netbsd-librt, r=alexcrichton

NetBSD: link libstd with librt in addition to libpthread

Some aio(3) and mq(3) functions in the libc crate actually come from NetBSD librt, not libc or libpthread.

5 years agoRollup merge of #55556 - nnethercote:MmapMeta, r=eddyb
Pietro Albini [Thu, 15 Nov 2018 10:04:32 +0000 (11:04 +0100)]
Rollup merge of #55556 - nnethercote:MmapMeta, r=eddyb

Use `Mmap` to open the rmeta file.

Because those files are quite large, contribute significantly to peak
memory usage, but only a small fraction of the data is ever read.

r? @eddyb

5 years agoRollup merge of #55530 - ljedrz:speed_up_String_from_utf16, r=SimonSapin
Pietro Albini [Thu, 15 Nov 2018 10:04:31 +0000 (11:04 +0100)]
Rollup merge of #55530 - ljedrz:speed_up_String_from_utf16, r=SimonSapin

Speed up String::from_utf16

Collecting into a `Result` is idiomatic, but not necessarily fast due to rustc not being able to preallocate for the resulting collection. This is fine in case of an error, but IMO we should optimize for the common case, i.e. a successful conversion.

This changes the behavior of `String::from_utf16` from collecting into a `Result` to pushing to a preallocated `String` in a loop.

According to [my simple benchmark](https://gist.github.com/ljedrz/953a3fb74058806519bd4d640d6f65ae) this change makes `String::from_utf16` around **twice** as fast.

5 years agoRollup merge of #55507 - fhartwig:size_of_intrinsic_docs, r=frewsxcv
Pietro Albini [Thu, 15 Nov 2018 10:04:30 +0000 (11:04 +0100)]
Rollup merge of #55507 - fhartwig:size_of_intrinsic_docs, r=frewsxcv

Add link to std::mem::size_of to size_of intrinsic documentation

The other intrinsics with safe/stable alternatives already have documentation to this effect.

5 years agoRollup merge of #55211 - fintelia:bufwriter-buffer, r=shepmaster
Pietro Albini [Thu, 15 Nov 2018 10:04:28 +0000 (11:04 +0100)]
Rollup merge of #55211 - fintelia:bufwriter-buffer, r=shepmaster

Add BufWriter::buffer method

CC #45323

5 years agoRollup merge of #55182 - jD91mZM2:rebased, r=alexcrichton
Pietro Albini [Thu, 15 Nov 2018 10:04:27 +0000 (11:04 +0100)]
Rollup merge of #55182 - jD91mZM2:rebased, r=alexcrichton

Redox: Update to new changes

These are all cherry-picked from our fork:

 - Remove the `env:` scheme
 - Update `execve` system call to `fexec`
 - Interpret shebangs: these are no longer handled by the kernel, which like usual tries to be as minimal as possible

5 years agoAuto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakis
bors [Thu, 15 Nov 2018 09:51:53 +0000 (09:51 +0000)]
Auto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakis

Reattach all grandchildren when constructing specialization graph.

Specialization graphs are constructed by incrementally adding impls in the order of declaration. If the impl being added has its specializations in the graph already, they should be reattached under the impl. However, the current implementation only reattaches the one found first. Therefore, in the following specialization graph,

```
  Tr1
   |
   I3
  /  \
 I1  I2
```

If `I1`, `I2`, and `I3` are declared in this order, the compiler mistakenly constructs the following graph:

```
  Tr1
  /  \
 I3  I2
  |
 I1
```

This patch fixes the reattach procedure to include all specializing grandchildren-to-be.

Fixes #50452.

5 years agoAuto merge of #55716 - RalfJung:escape-to-raw, r=oli-obk
bors [Thu, 15 Nov 2018 01:12:01 +0000 (01:12 +0000)]
Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obk

Add escape-to-raw MIR statement

Add a new MIR "ghost state statement": Escaping a ptr to permit raw accesses.

~~This includes #55549, [click here](https://github.com/RalfJung/rust/compare/miri-visitor...RalfJung:escape-to-raw) for just the new commits.~~

5 years agoAuto merge of #55939 - alexcrichton:path-regression-again, r=sfackler
bors [Wed, 14 Nov 2018 22:15:35 +0000 (22:15 +0000)]
Auto merge of #55939 - alexcrichton:path-regression-again, r=sfackler

std: Synchronize access to global env during `exec`

This commit, after reverting #55359, applies a different fix for #46775
while also fixing #55775. The basic idea was to go back to pre-#55359
libstd, and then fix #46775 in a way that doesn't expose #55775.

The issue described in #46775 boils down to two problems:

* First, the global environment is reset during `exec` but, but if the
  `exec` call fails then the global environment was a dangling pointer
  into free'd memory as the block of memory was deallocated when
  `Command` is dropped. This is fixed in this commit by installing a
  `Drop` stack object which ensures that the `environ` pointer is
  preserved on a failing `exec`.

* Second, the global environment was accessed in an unsynchronized
  fashion during `exec`. This was fixed by ensuring that the
  Rust-specific environment lock is acquired for these system-level
  operations.

Thanks to Alex Gaynor for pioneering the solution here!

Closes #55775

5 years agostd: Synchronize access to global env during `exec`
Alex Crichton [Tue, 13 Nov 2018 22:57:10 +0000 (14:57 -0800)]
std: Synchronize access to global env during `exec`

This commit, after reverting #55359, applies a different fix for #46775
while also fixing #55775. The basic idea was to go back to pre-#55359
libstd, and then fix #46775 in a way that doesn't expose #55775.

The issue described in #46775 boils down to two problems:

* First, the global environment is reset during `exec` but, but if the
  `exec` call fails then the global environment was a dangling pointer
  into free'd memory as the block of memory was deallocated when
  `Command` is dropped. This is fixed in this commit by installing a
  `Drop` stack object which ensures that the `environ` pointer is
  preserved on a failing `exec`.

* Second, the global environment was accessed in an unsynchronized
  fashion during `exec`. This was fixed by ensuring that the
  Rust-specific environment lock is acquired for these system-level
  operations.

Thanks to Alex Gaynor for pioneering the solution here!

Closes #55775

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
5 years agoAuto merge of #55947 - michaelwoerister:xlto-fix-lld-opt, r=Mark-Simulacrum
bors [Wed, 14 Nov 2018 19:25:54 +0000 (19:25 +0000)]
Auto merge of #55947 - michaelwoerister:xlto-fix-lld-opt, r=Mark-Simulacrum

xLTO: Don't pass --plugin-opt=thin to LLD. That's not supported anymore.

It seems that `-plugin-opt=thin` is not needed anymore when invoking LLD for ThinLTO. Unfortunately, still passing the option makes LLD crash instead of giving a deprecation warning or something.

5 years agoadd test for issue #54348
Andy Russell [Wed, 14 Nov 2018 17:54:32 +0000 (12:54 -0500)]
add test for issue #54348

5 years agoadd test for issue #55587
Andy Russell [Wed, 14 Nov 2018 17:41:39 +0000 (12:41 -0500)]
add test for issue #55587

5 years agoRevert "Fixes #46775 -- don't mutate the process's environment in Command::exec"
Alex Crichton [Tue, 13 Nov 2018 22:50:50 +0000 (14:50 -0800)]
Revert "Fixes #46775 -- don't mutate the process's environment in Command::exec"

This reverts commit 36fe3b605a7a7143a14565272140ba1b43c1b041.

5 years agoxLTO: Don't pass --plugin-opt=thin to LLD. That's not supported anymore.
Michael Woerister [Wed, 14 Nov 2018 13:42:49 +0000 (14:42 +0100)]
xLTO: Don't pass --plugin-opt=thin to LLD. That's not supported anymore.

5 years agoAuto merge of #55934 - alexcrichton:appveyor-gce, r=Mark-Simulacrum
bors [Wed, 14 Nov 2018 11:54:14 +0000 (11:54 +0000)]
Auto merge of #55934 - alexcrichton:appveyor-gce, r=Mark-Simulacrum

Switch AppVeyor builds to the GCE cloud

[Recommended by AppVeyor][1] this isn't done by default for all builds
due to the high startup overhead (3-4 minutes for a VM), but that's
paltry compared to our overall build times so should be more than
applicable!

[1]: https://help.appveyor.com/discussions/questions/29832-did-recent-changes-apply-to-possibly-slow-down-builds#comment_46494058

5 years agocore/char: Add comment to `to_digit()`
Tobias Bieniek [Wed, 14 Nov 2018 10:26:00 +0000 (11:26 +0100)]
core/char: Add comment to `to_digit()`

5 years agocore/char: Drop `radix == 10` special case
Tobias Bieniek [Wed, 14 Nov 2018 07:55:53 +0000 (08:55 +0100)]
core/char: Drop `radix == 10` special case

This seems to perform equally well

5 years agoUse `Mmap` to open the rmeta file.
Nicholas Nethercote [Wed, 31 Oct 2018 21:59:32 +0000 (08:59 +1100)]
Use `Mmap` to open the rmeta file.

Because those files are quite large, contribute significantly to peak
memory usage, but only a small fraction of the data is ever read.

5 years agoAuto merge of #52153 - csmoe:projeq_normal, r=scalexm
bors [Wed, 14 Nov 2018 02:46:24 +0000 (02:46 +0000)]
Auto merge of #52153 - csmoe:projeq_normal, r=scalexm

chalk lowering rule: ProjectionEq-Normalize

cc #49177
r? @scalexm

5 years agoRemove unneeded newline.
Corey Farwell [Wed, 14 Nov 2018 02:34:44 +0000 (21:34 -0500)]
Remove unneeded newline.

5 years agoWrap some query results in `Lrc`.
Nicholas Nethercote [Thu, 8 Nov 2018 06:14:13 +0000 (17:14 +1100)]
Wrap some query results in `Lrc`.

So that the frequent clones in `try_get` are cheaper.

Fixes #54274.

5 years agoAuto merge of #55912 - kennytm:rollup, r=kennytm
bors [Tue, 13 Nov 2018 22:17:46 +0000 (22:17 +0000)]
Auto merge of #55912 - kennytm:rollup, r=kennytm

Rollup of 20 pull requests

Successful merges:

 - #55136 (Remove short doc where it starts with a codeblock)
 - #55711 (Format BtreeMap::range_mut example)
 - #55722 (impl_stable_hash_for: support enums and tuple structs with generic parameters)
 - #55754 (Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err)
 - #55804 (rustdoc: don't inline `pub use some_crate` unless directly asked to)
 - #55805 (Move `static_assert!` into librustc_data_structures)
 - #55837 (Make PhantomData #[structural_match])
 - #55840 (Fix TLS errors when downloading stage0)
 - #55843 (add FromIterator<A> to Box<[A]>)
 - #55858 (Small fixes on code blocks in rustdoc)
 - #55863 (Fix a typo in std::panic)
 - #55870 (Fix typos.)
 - #55874 (string: Add documentation for `From` impls)
 - #55879 (save-analysis: Don't panic for macro-generated use globs)
 - #55882 (Reference count `crate_inherent_impls`s return value.)
 - #55888 (miri: for uniformity, also move memory_deallocated to AllocationExtra)
 - #55889 (global allocators: add a few comments)
 - #55896 (Document optimizations enabled by FusedIterator)
 - #55905 (Change `Lit::short_name` to `Lit::literal_name`.)
 - #55908 (Fix their/there grammar nit)

5 years agoSwitch AppVeyor builds to the GCE cloud
Alex Crichton [Tue, 13 Nov 2018 21:38:04 +0000 (13:38 -0800)]
Switch AppVeyor builds to the GCE cloud

[Recommended by AppVeyor][1] this isn't done by default for all builds
due to the high startup overhead (3-4 minutes for a VM), but that's
paltry compared to our overall build times so should be more than
applicable!

[1]: https://help.appveyor.com/discussions/questions/29832-did-recent-changes-apply-to-possibly-slow-down-builds#comment_46494058

5 years agocore/char: Speed up `to_digit()` for `radix <= 10`
Tobias Bieniek [Tue, 13 Nov 2018 17:05:46 +0000 (18:05 +0100)]
core/char: Speed up `to_digit()` for `radix <= 10`

### Before

```
# Run 1
test char::methods::bench_to_digit_radix_10                ... bench:      16,265 ns/iter (+/- 1,774)
test char::methods::bench_to_digit_radix_16                ... bench:      13,938 ns/iter (+/- 2,479)
test char::methods::bench_to_digit_radix_2                 ... bench:      13,090 ns/iter (+/- 524)
test char::methods::bench_to_digit_radix_36                ... bench:      14,236 ns/iter (+/- 1,949)

# Run 2
test char::methods::bench_to_digit_radix_10                ... bench:      16,176 ns/iter (+/- 1,589)
test char::methods::bench_to_digit_radix_16                ... bench:      13,896 ns/iter (+/- 3,140)
test char::methods::bench_to_digit_radix_2                 ... bench:      13,158 ns/iter (+/- 1,112)
test char::methods::bench_to_digit_radix_36                ... bench:      14,206 ns/iter (+/- 1,312)

# Run 3
test char::methods::bench_to_digit_radix_10                ... bench:      16,221 ns/iter (+/- 2,423)
test char::methods::bench_to_digit_radix_16                ... bench:      14,361 ns/iter (+/- 3,926)
test char::methods::bench_to_digit_radix_2                 ... bench:      13,097 ns/iter (+/- 671)
test char::methods::bench_to_digit_radix_36                ... bench:      14,388 ns/iter (+/- 1,068)
```

### After

```
# Run 1
test char::methods::bench_to_digit_radix_10      ... bench:      11,521 ns/iter (+/- 552)
test char::methods::bench_to_digit_radix_16      ... bench:      12,926 ns/iter (+/- 684)
test char::methods::bench_to_digit_radix_2       ... bench:      11,266 ns/iter (+/- 1,085)
test char::methods::bench_to_digit_radix_36      ... bench:      14,213 ns/iter (+/- 614)

# Run 2
test char::methods::bench_to_digit_radix_10      ... bench:      11,424 ns/iter (+/- 1,042)
test char::methods::bench_to_digit_radix_16      ... bench:      12,854 ns/iter (+/- 1,193)
test char::methods::bench_to_digit_radix_2       ... bench:      11,193 ns/iter (+/- 716)
test char::methods::bench_to_digit_radix_36      ... bench:      14,249 ns/iter (+/- 3,514)

# Run 3
test char::methods::bench_to_digit_radix_10      ... bench:      11,469 ns/iter (+/- 685)
test char::methods::bench_to_digit_radix_16      ... bench:      12,852 ns/iter (+/- 568)
test char::methods::bench_to_digit_radix_2       ... bench:      11,275 ns/iter (+/- 1,356)
test char::methods::bench_to_digit_radix_36      ... bench:      14,188 ns/iter (+/- 1,501)
```

5 years agocore/char: Replace condition + `panic!()` with `assert!()`
Tobias Bieniek [Tue, 13 Nov 2018 16:49:38 +0000 (17:49 +0100)]
core/char: Replace condition + `panic!()` with `assert!()`

5 years agocore/benches: Add `char::to_digit()` benchmarks
Tobias Bieniek [Tue, 13 Nov 2018 17:03:06 +0000 (18:03 +0100)]
core/benches: Add `char::to_digit()` benchmarks

5 years agofix various typos in doc comments
Andy Russell [Mon, 12 Nov 2018 18:05:20 +0000 (13:05 -0500)]
fix various typos in doc comments

5 years agoImplement `ProjectionEq-Normalize`
csmoe [Sun, 8 Jul 2018 14:28:24 +0000 (22:28 +0800)]
Implement `ProjectionEq-Normalize`

5 years agoAuto merge of #55356 - Aaron1011:fix/rustdoc-negative-auto, r=nikomatsakis
bors [Tue, 13 Nov 2018 19:16:18 +0000 (19:16 +0000)]
Auto merge of #55356 - Aaron1011:fix/rustdoc-negative-auto, r=nikomatsakis

Check for negative impls when finding auto traits

Fixes #55321

When AutoTraitFinder begins examining a type, it checks for an explicit
negative impl. However, it wasn't checking for negative impls found when
calling 'select' on predicates found from nested obligations.

This commit makes AutoTraitFinder check for negative impls whenever it
makes a call to 'select'. If a negative impl is found, it immediately
bails out.

Normal users of SelectioContext don't need to worry about this, since
they stop as soon as an Unimplemented error is encountered. However, we
add predicates to our ParamEnv when we encounter this error, so we need
to handle negative impls specially (so that we don't try adding them to
our ParamEnv).

5 years agohir: simplify a match expression
ljedrz [Tue, 13 Nov 2018 16:23:18 +0000 (17:23 +0100)]
hir: simplify a match expression

5 years agohir: remove an unused type alias
ljedrz [Tue, 13 Nov 2018 15:24:14 +0000 (16:24 +0100)]
hir: remove an unused type alias

5 years agohir: simplify fmt::Debug for hir::Path
ljedrz [Tue, 13 Nov 2018 15:15:16 +0000 (16:15 +0100)]
hir: simplify fmt::Debug for hir::Path

5 years agohir: remove an unused hir_vec macro pattern
ljedrz [Tue, 13 Nov 2018 14:50:31 +0000 (15:50 +0100)]
hir: remove an unused hir_vec macro pattern

5 years agoChange sidebar selector to fix compatibility with docs.rs
cynecx [Tue, 13 Nov 2018 16:23:30 +0000 (17:23 +0100)]
Change sidebar selector to fix compatibility with docs.rs

5 years agoAuto merge of #55649 - scalexm:chalk-bound-ty, r=nikomatsakis
bors [Tue, 13 Nov 2018 12:22:30 +0000 (12:22 +0000)]
Auto merge of #55649 - scalexm:chalk-bound-ty, r=nikomatsakis

Use bound types in `librustc_traits`

r? @nikomatsakis
see the tests which now move the higher-ranked binders to the left in implied bound rules!

5 years agoFix ui tests
scalexm [Sat, 3 Nov 2018 18:34:28 +0000 (19:34 +0100)]
Fix ui tests

5 years agoInstantiate all bound vars existentially
scalexm [Thu, 1 Nov 2018 14:30:37 +0000 (15:30 +0100)]
Instantiate all bound vars existentially

5 years agoUse a dummy outlives requirement for `where Type:,` (see #53696)
scalexm [Thu, 1 Nov 2018 14:09:02 +0000 (15:09 +0100)]
Use a dummy outlives requirement for `where Type:,` (see #53696)
A `WF(Type)` predicate was used previously, which did not play
well with implied bounds in chalk.

5 years agoReorder code in `rustc::traits::structural_impls`
scalexm [Thu, 1 Nov 2018 13:39:03 +0000 (14:39 +0100)]
Reorder code in `rustc::traits::structural_impls`

5 years agoBypass ppaux for `Outlives` predicates
scalexm [Thu, 1 Nov 2018 13:32:32 +0000 (14:32 +0100)]
Bypass ppaux for `Outlives` predicates

5 years agoProvide program clauses for builtin types
scalexm [Wed, 31 Oct 2018 21:07:54 +0000 (22:07 +0100)]
Provide program clauses for builtin types

5 years agoAdjust documentation
scalexm [Wed, 31 Oct 2018 18:03:23 +0000 (19:03 +0100)]
Adjust documentation

5 years agoPretty print quantified goals and clauses
scalexm [Wed, 31 Oct 2018 17:55:40 +0000 (18:55 +0100)]
Pretty print quantified goals and clauses

5 years agoReplace type params with bound vars in `rustc_traits::lowering`
scalexm [Wed, 31 Oct 2018 14:16:46 +0000 (15:16 +0100)]
Replace type params with bound vars in `rustc_traits::lowering`

5 years agoRollup merge of #55722 - RalfJung:impl-stable-hash, r=varkor
kennytm [Tue, 13 Nov 2018 11:22:53 +0000 (19:22 +0800)]
Rollup merge of #55722 - RalfJung:impl-stable-hash, r=varkor

impl_stable_hash_for: support enums and tuple structs with generic parameters

Port a bunch of implementations over to the macro, now that that is possible.

5 years agoRollup merge of #55136 - GuillaumeGomez:short-doc, r=QuietMisdreavus
kennytm [Tue, 13 Nov 2018 07:09:40 +0000 (15:09 +0800)]
Rollup merge of #55136 - GuillaumeGomez:short-doc, r=QuietMisdreavus

Remove short doc where it starts with a codeblock

Fixes #54975.

5 years agoRollup merge of #55908 - KWierso:patch-1, r=wesleywiser
kennytm [Tue, 13 Nov 2018 05:03:26 +0000 (13:03 +0800)]
Rollup merge of #55908 - KWierso:patch-1, r=wesleywiser

Fix their/there grammar nit

5 years agoRollup merge of #55905 - nnethercote:short_name-to-literal_name, r=Mark-Simulacrum
kennytm [Tue, 13 Nov 2018 05:03:25 +0000 (13:03 +0800)]
Rollup merge of #55905 - nnethercote:short_name-to-literal_name, r=Mark-Simulacrum

Change `Lit::short_name` to `Lit::literal_name`.

This avoids a moderately hot allocation in `parse_lit_token`.

r? @Mark-Simulacrum

5 years agoRollup merge of #55896 - rust-lang:opt-fuse, r=shepmaster
kennytm [Tue, 13 Nov 2018 05:03:24 +0000 (13:03 +0800)]
Rollup merge of #55896 - rust-lang:opt-fuse, r=shepmaster

Document optimizations enabled by FusedIterator

When reading this I wondered what “some significant optimizations” referred to. As far as I can tell from reading code, the specialization of `.fuse()` is the only case where `FusedIterator` has any impact at all. Is this accurate @Stebalien?

5 years agoRollup merge of #55889 - RalfJung:global-alloc, r=alexcrichton
kennytm [Tue, 13 Nov 2018 05:03:22 +0000 (13:03 +0800)]
Rollup merge of #55889 - RalfJung:global-alloc, r=alexcrichton

global allocators: add a few comments

These comments answer some questions that came up when I tried to understand how the control flow works for the global allocator, `Global` and `System`.

r? @alexcrichton

5 years agoRollup merge of #55888 - RalfJung:alloc-extra, r=oli-obk
kennytm [Tue, 13 Nov 2018 05:03:21 +0000 (13:03 +0800)]
Rollup merge of #55888 - RalfJung:alloc-extra, r=oli-obk

miri: for uniformity, also move memory_deallocated to AllocationExtra

r? @oli-obk

5 years agoRollup merge of #55882 - hugwijst:rc_return_crate_inherent_impls, r=Mark-Simulacrum
kennytm [Tue, 13 Nov 2018 05:03:20 +0000 (13:03 +0800)]
Rollup merge of #55882 - hugwijst:rc_return_crate_inherent_impls, r=Mark-Simulacrum

Reference count `crate_inherent_impls`s return value.

The repeated cloning of the result in `inherent_impls` queries has quite
an impact on crates with many inherent trait implementations.

For instance on https://github.com/jmesmon/stm32f429, `cargo check` went from 75 seconds to 38 seconds on my machine.

5 years agoRollup merge of #55879 - Xanewok:dont-panic-with-globs, r=nrc
kennytm [Tue, 13 Nov 2018 05:03:18 +0000 (13:03 +0800)]
Rollup merge of #55879 - Xanewok:dont-panic-with-globs, r=nrc

save-analysis: Don't panic for macro-generated use globs

Follow-up to https://github.com/rust-lang/rust/commit/c2bb7cadf24e82b80f403c09e800fe5fad504caf - as before, ignore the use globs in macro expansions.

Fixes https://github.com/rust-lang-nursery/rls/issues/1117.
Closes #55480.

r? @nrc

5 years agoRollup merge of #55874 - denisvasilik:docs, r=alexcrichton
kennytm [Tue, 13 Nov 2018 05:03:17 +0000 (13:03 +0800)]
Rollup merge of #55874 - denisvasilik:docs, r=alexcrichton

string: Add documentation for `From` impls

Hi this is part of #51430. I'm a first time contributor, so I started with a small task adding a bit of documentation for From impls.

5 years agoRollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiser
kennytm [Tue, 13 Nov 2018 05:03:16 +0000 (13:03 +0800)]
Rollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiser

Fix typos.

5 years agoRollup merge of #55863 - dwijnand:patch-1, r=bluss
kennytm [Tue, 13 Nov 2018 05:03:15 +0000 (13:03 +0800)]
Rollup merge of #55863 - dwijnand:patch-1, r=bluss

Fix a typo in std::panic

5 years agoRollup merge of #55858 - GuillaumeGomez:fixes-rustdoc-codeblocks, r=QuietMisdreavus
kennytm [Tue, 13 Nov 2018 05:03:14 +0000 (13:03 +0800)]
Rollup merge of #55858 - GuillaumeGomez:fixes-rustdoc-codeblocks, r=QuietMisdreavus

Small fixes on code blocks in rustdoc

It currently has a little margin issue with the `i` and there were js errors.

r? @QuietMisdreavus

5 years agoRollup merge of #55843 - Axary:master, r=sfackler
kennytm [Tue, 13 Nov 2018 05:03:12 +0000 (13:03 +0800)]
Rollup merge of #55843 - Axary:master, r=sfackler

add FromIterator<A> to Box<[A]>

5 years agoRollup merge of #55840 - dlrobertson:fix_stage0_download, r=alexcrichton
kennytm [Tue, 13 Nov 2018 05:03:11 +0000 (13:03 +0800)]
Rollup merge of #55840 - dlrobertson:fix_stage0_download, r=alexcrichton

Fix TLS errors when downloading stage0

While attempting to test #49878 on Windows I hit the following error when attempting to download stage0.

```
The request was aborted: Could not create SSL/TLS secure channel
```

Instead of using the shell, we can just use `urllib`, which seems to fix the issue.

5 years agoRollup merge of #55837 - Centril:spökdata-skall-vara-strukturellt-matchbar, r=eddyb
kennytm [Tue, 13 Nov 2018 05:03:10 +0000 (13:03 +0800)]
Rollup merge of #55837 - Centril:spökdata-skall-vara-strukturellt-matchbar, r=eddyb

Make PhantomData #[structural_match]

fixes https://github.com/rust-lang/rust/issues/55028

This makes `PhantomData<T>` structurally matchable, irrespective of whether `T` is, per the discussion on this week's language team meeting (the general consensus was that this was a bug-fix).

All types containing `PhantomData<T>` and which used `#[derive(PartialEq, Eq)]` and were previously not `#[structural_match]` only because of `PhantomData<T>` will now be `#[structural_match]`.

r? @nikomatsakis

5 years agoRollup merge of #55805 - nnethercote:mv-static_assert, r=Mark-Simulacrum
kennytm [Tue, 13 Nov 2018 05:03:09 +0000 (13:03 +0800)]
Rollup merge of #55805 - nnethercote:mv-static_assert, r=Mark-Simulacrum

Move `static_assert!` into librustc_data_structures

5 years agoRollup merge of #55804 - QuietMisdreavus:eager-crate-inline, r=pnkfelix
kennytm [Tue, 13 Nov 2018 05:03:08 +0000 (13:03 +0800)]
Rollup merge of #55804 - QuietMisdreavus:eager-crate-inline, r=pnkfelix

rustdoc: don't inline `pub use some_crate` unless directly asked to

cc https://github.com/rust-lang/rust/issues/52509 (fixes it? i'm not sure about my comment summoning the docs team)

When rustdoc encounters a `pub use` statement for an item from another crate, it will eagerly inline its contents into your crate. This somewhat clashes with the new paths behavior in Rust 2018, in which crates are implicitly linked and re-exported with `pub use` instead of `pub extern crate`. In rust 2015, `pub extern crate` would only create a single line for its re-export in the docs, so i'm making it do the same with `pub use some_crate;`.

The exact new behavior is like this: *If rustdoc sees a `pub use` statement, and the item being imported is the root of another crate, it will only inline it if `#[doc(inline)]` is provided.* I made it only avoid crate roots because otherwise it would stop inlining any module, which may or may not be what people want.

5 years agoRollup merge of #55754 - spastorino:fix-process-output-docs, r=alexcrichton
kennytm [Tue, 13 Nov 2018 05:03:05 +0000 (13:03 +0800)]
Rollup merge of #55754 - spastorino:fix-process-output-docs, r=alexcrichton

Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err

r? @nikomatsakis

5 years agoRollup merge of #55711 - kngwyu:btreemap-rangemut-doc, r=Mark-Simulacrum
kennytm [Tue, 13 Nov 2018 05:03:04 +0000 (13:03 +0800)]
Rollup merge of #55711 - kngwyu:btreemap-rangemut-doc, r=Mark-Simulacrum

Format BtreeMap::range_mut example

Before:
![image](https://user-images.githubusercontent.com/16046705/48049184-36517780-e1e1-11e8-8da2-a3ae858d5a76.png)
After:
![image](https://user-images.githubusercontent.com/16046705/48049210-45382a00-e1e1-11e8-87b3-84ae60ef798e.png)

5 years agoAuto merge of #55589 - oli-obk:min_length_💣, r=pnkfelix
bors [Tue, 13 Nov 2018 07:04:14 +0000 (07:04 +0000)]
Auto merge of #55589 - oli-obk:min_length_💣, r=pnkfelix

Add `VariantIdx` type and use instead of `usize`

5 years agoFix their/there grammar nit
KWierso [Tue, 13 Nov 2018 02:21:52 +0000 (18:21 -0800)]
Fix their/there grammar nit

5 years agoAuto merge of #55052 - newpavlov:patch-2, r=alexcrichton
bors [Tue, 13 Nov 2018 01:08:13 +0000 (01:08 +0000)]
Auto merge of #55052 - newpavlov:patch-2, r=alexcrichton

Use read_unaligned instead of read in transmute_copy

Closes: #55044
This change could result in performance regression on non-x86 platforms. (but it also can fix some of UB which lurks in existing programs) An alternative would be to update `transmute_copy` documentation with alignment requirements.

5 years agoMove two `static_assert!`s to better spots.
Nicholas Nethercote [Mon, 12 Nov 2018 19:34:11 +0000 (06:34 +1100)]
Move two `static_assert!`s to better spots.

And make them x86_64-only so they can use `==` instead of `<=`.