]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAdded default impl for DerivedTypeMethods + empty impl for Cranelift BaseTypeMethods
Denis Merigoux [Tue, 9 Oct 2018 14:01:02 +0000 (16:01 +0200)]
Added default impl for DerivedTypeMethods + empty impl for Cranelift BaseTypeMethods

5 years agoAll Builder methods now take &mut self instead of &self
Denis Merigoux [Fri, 5 Oct 2018 13:08:49 +0000 (15:08 +0200)]
All Builder methods now take &mut self instead of &self

5 years agoAdded some docs + start to &mut self builder methods
Denis Merigoux [Thu, 4 Oct 2018 13:23:10 +0000 (15:23 +0200)]
Added some docs + start to &mut self builder methods

5 years agoFinished moving backend-agnostic code to rustc_codegen_ssa
Denis Merigoux [Wed, 3 Oct 2018 14:56:24 +0000 (16:56 +0200)]
Finished moving backend-agnostic code to rustc_codegen_ssa

5 years agoGreat separation of librustc_codegen_llvm: librustc_codegen_ssa compiles
Denis Merigoux [Wed, 3 Oct 2018 11:49:57 +0000 (13:49 +0200)]
Great separation of librustc_codegen_llvm: librustc_codegen_ssa compiles

5 years agoMoved DeclareMethods, MiscMethods and StaticMethods
Denis Merigoux [Tue, 2 Oct 2018 08:49:54 +0000 (10:49 +0200)]
Moved DeclareMethods, MiscMethods and StaticMethods

5 years agoBeginning of moving all backend-agnostic code to rustc_codegen_ssa
Denis Merigoux [Mon, 1 Oct 2018 16:07:04 +0000 (18:07 +0200)]
Beginning of moving all backend-agnostic code to rustc_codegen_ssa

5 years agoMoved Backend interface into rustc_codegen_utils
Denis Merigoux [Mon, 1 Oct 2018 08:32:09 +0000 (10:32 +0200)]
Moved Backend interface into rustc_codegen_utils

5 years ago[eddyb/rebase cleanup] move type_{needs_drop,is_sized,is_freeze} to rustc_codegen_utils
Eduard-Mihai Burtescu [Tue, 13 Nov 2018 10:53:29 +0000 (12:53 +0200)]
[eddyb/rebase cleanup] move type_{needs_drop,is_sized,is_freeze} to rustc_codegen_utils

5 years ago[eddyb/rebase cleanup] abstracted Funclet
Eduard-Mihai Burtescu [Tue, 13 Nov 2018 10:51:42 +0000 (12:51 +0200)]
[eddyb/rebase cleanup] abstracted Funclet

5 years agoMoved common.rs enums
Denis Merigoux [Fri, 28 Sep 2018 10:18:03 +0000 (12:18 +0200)]
Moved common.rs enums

5 years agoStarting to move backend-agnostic code into codegen_utils
Denis Merigoux [Fri, 28 Sep 2018 09:40:59 +0000 (11:40 +0200)]
Starting to move backend-agnostic code into codegen_utils
IntPredicate moved

5 years agoAdded compile codegen to backend trait
Denis Merigoux [Thu, 27 Sep 2018 13:31:20 +0000 (15:31 +0200)]
Added compile codegen to backend trait

5 years agoPreparing the generalization of base:compile_coodegen_unit
Denis Merigoux [Wed, 26 Sep 2018 15:00:01 +0000 (17:00 +0200)]
Preparing the generalization of base:compile_coodegen_unit

5 years agoRenamed lifetimes for better understanding
Denis Merigoux [Wed, 26 Sep 2018 14:01:43 +0000 (16:01 +0200)]
Renamed lifetimes for better understanding

5 years agoGeneralized base:codegen_crate
Denis Merigoux [Tue, 25 Sep 2018 15:52:03 +0000 (17:52 +0200)]
Generalized base:codegen_crate

5 years agoMove doc to trait declarations
Denis Merigoux [Mon, 24 Sep 2018 15:35:39 +0000 (17:35 +0200)]
Move doc to trait declarations

5 years agoGeneralized base:maybe_create_entry_wrapper
Denis Merigoux [Mon, 24 Sep 2018 13:26:39 +0000 (15:26 +0200)]
Generalized base:maybe_create_entry_wrapper

5 years agoAdapt code to latest rustc master changes
Denis Merigoux [Mon, 24 Sep 2018 08:51:13 +0000 (10:51 +0200)]
Adapt code to latest rustc master changes

5 years agoGeneralized mono_item.rs and base.rs:codegen_instance
Denis Merigoux [Fri, 21 Sep 2018 14:13:15 +0000 (16:13 +0200)]
Generalized mono_item.rs and base.rs:codegen_instance

5 years agoGeneralized mir::codegen_mir (and all subsequent functions)
Denis Merigoux [Thu, 20 Sep 2018 13:47:22 +0000 (15:47 +0200)]
Generalized mir::codegen_mir (and all subsequent functions)

5 years agoGeneralized base::coerce_unsized_into
Denis Merigoux [Fri, 14 Sep 2018 15:48:57 +0000 (17:48 +0200)]
Generalized base::coerce_unsized_into

5 years agoGeneralized base::unsize_thin_ptr
Denis Merigoux [Thu, 13 Sep 2018 15:41:40 +0000 (17:41 +0200)]
Generalized base::unsize_thin_ptr

5 years agoGeneralized base::unsized_info
Denis Merigoux [Thu, 13 Sep 2018 12:58:19 +0000 (14:58 +0200)]
Generalized base::unsized_info

5 years ago[eddyb/rebase cleanup] s/&self./self.
Eduard-Mihai Burtescu [Wed, 7 Nov 2018 10:08:41 +0000 (12:08 +0200)]
[eddyb/rebase cleanup] s/&self./self.

5 years agoTraitified IntrinsicCallMethods
Denis Merigoux [Tue, 11 Sep 2018 09:46:03 +0000 (11:46 +0200)]
Traitified IntrinsicCallMethods

5 years agoTransfered memcpy and memset to BuilderMethods
Denis Merigoux [Mon, 10 Sep 2018 15:59:20 +0000 (17:59 +0200)]
Transfered memcpy and memset to BuilderMethods

5 years agoAdded StaticMethods trait
Denis Merigoux [Mon, 10 Sep 2018 14:28:47 +0000 (16:28 +0200)]
Added StaticMethods trait

5 years agoGeneralized memset and memcpy
Denis Merigoux [Fri, 7 Sep 2018 22:39:39 +0000 (15:39 -0700)]
Generalized memset and memcpy

5 years agoGeneralized some base.rs methods
Denis Merigoux [Fri, 7 Sep 2018 20:25:50 +0000 (13:25 -0700)]
Generalized some base.rs methods

5 years agoAttempt at including CodegenCx within Builder with Associated types
Denis Merigoux [Fri, 7 Sep 2018 01:31:42 +0000 (18:31 -0700)]
Attempt at including CodegenCx within Builder with Associated types

5 years agoFixed typos
Denis Merigoux [Fri, 7 Sep 2018 00:27:04 +0000 (17:27 -0700)]
Fixed typos

5 years agoRemoved phantomdata no longer necessary
Denis Merigoux [Thu, 6 Sep 2018 23:04:20 +0000 (16:04 -0700)]
Removed phantomdata no longer necessary
Because CodegenContext doesn't implement Backend anymore

5 years agoRemoving LLVM content from CommonMethods -> ConstMethods
Denis Merigoux [Thu, 6 Sep 2018 21:44:51 +0000 (14:44 -0700)]
Removing LLVM content from CommonMethods -> ConstMethods

5 years agoPrefixed type methods & removed trait impl for write::CodegenContext
Denis Merigoux [Thu, 6 Sep 2018 20:52:15 +0000 (13:52 -0700)]
Prefixed type methods & removed trait impl for write::CodegenContext

5 years agoPrefixed const methods with "const" instead of "c"
Denis Merigoux [Thu, 6 Sep 2018 18:57:42 +0000 (11:57 -0700)]
Prefixed const methods with "const" instead of "c"

5 years agoTraitification of type_ methods
Denis Merigoux [Wed, 5 Sep 2018 21:14:03 +0000 (14:14 -0700)]
Traitification of type_ methods
The methods are now attached to CodegenCx instead of Type

5 years agoAdded definition of type trait
Denis Merigoux [Thu, 30 Aug 2018 15:50:28 +0000 (17:50 +0200)]
Added definition of type trait

5 years agoUse the method form for CodegenCx everywhere
Denis Merigoux [Thu, 30 Aug 2018 13:41:59 +0000 (15:41 +0200)]
Use the method form for CodegenCx everywhere

5 years agoAll CommonMethods now real methods (not static)
Denis Merigoux [Thu, 30 Aug 2018 12:58:15 +0000 (14:58 +0200)]
All CommonMethods now real methods (not static)

5 years agoRemoved code duplication for CommonWriteMethods
Denis Merigoux [Thu, 30 Aug 2018 12:24:41 +0000 (14:24 +0200)]
Removed code duplication for CommonWriteMethods

5 years agoCommonWriteMethods are not static any more
Denis Merigoux [Wed, 29 Aug 2018 16:42:25 +0000 (18:42 +0200)]
CommonWriteMethods are not static any more

5 years agoSplit CommonMethods to accomodate for use in back/write.rs
Denis Merigoux [Wed, 29 Aug 2018 14:40:47 +0000 (16:40 +0200)]
Split CommonMethods to accomodate for use in back/write.rs

5 years agoAdded self argument for Codegen CommonMethod trait methods
Denis Merigoux [Wed, 29 Aug 2018 13:56:30 +0000 (15:56 +0200)]
Added self argument for Codegen CommonMethod trait methods

5 years agoReplaced Codegen field access by trait method
Denis Merigoux [Tue, 28 Aug 2018 15:50:57 +0000 (17:50 +0200)]
Replaced Codegen field access by trait method

5 years agoTraitification of common.rs methods
Denis Merigoux [Tue, 28 Aug 2018 15:03:46 +0000 (17:03 +0200)]
Traitification of common.rs methods

5 years agoNew Backend trait containing associated types
Denis Merigoux [Tue, 28 Aug 2018 09:40:34 +0000 (11:40 +0200)]
New Backend trait containing associated types

5 years agoNew files and folders for traits
Denis Merigoux [Tue, 28 Aug 2018 09:11:01 +0000 (11:11 +0200)]
New files and folders for traits
Moved common enums to common

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.