]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoIgnore non-semantic tokens for 'probably_eq' streams.
Sergio Benitez [Sat, 17 Nov 2018 07:37:23 +0000 (23:37 -0800)]
Ignore non-semantic tokens for 'probably_eq' streams.

5 years agoAuto merge of #55627 - sunfishcode:cg-llvm-gen, r=nikomatsakis
bors [Sat, 17 Nov 2018 04:10:52 +0000 (04:10 +0000)]
Auto merge of #55627 - sunfishcode:cg-llvm-gen, r=nikomatsakis

rustc_codegen_llvm: traitification of LLVM-specific CodegenCx and Builder methods

This PR is the continuation of #54012 and earlier PRs, in the grand plan of #45274 to allow for multiple codegen backends.

High-level summary: interpose a set of traits between Rust's codegen logic and the LLVM APIs, allowing another backend to implement the traits and share most of the codegen logic. These traits are currently somewhat LLVM-specific, but once this refactoring is in place, they can evolve to be more general.

See [this README](https://github.com/rust-lang/rust/blob/756f84d7cef90b7364ae88ca707e59670dde4c92/src/librustc_codegen_ssa/README.md) for a writeup on the current trait organization.

5 years agoavoid shared ref in UnsafeCell::get
Ralf Jung [Fri, 16 Nov 2018 21:17:26 +0000 (22:17 +0100)]
avoid shared ref in UnsafeCell::get

5 years agoAuto merge of #55936 - nrc:save-rename, r=eddyb
bors [Fri, 16 Nov 2018 21:11:24 +0000 (21:11 +0000)]
Auto merge of #55936 - nrc:save-rename, r=eddyb

save-analysis: be even more aggressive about ignorning macro-generated defs

r? @eddyb

5 years agoadjust remaining tests
Ralf Jung [Fri, 16 Nov 2018 17:38:28 +0000 (18:38 +0100)]
adjust remaining tests

5 years agoReplace data.clone() by Arc::clone(&data) in mutex doc.
Benoît C [Fri, 16 Nov 2018 20:34:12 +0000 (15:34 -0500)]
Replace data.clone() by Arc::clone(&data) in mutex doc.

Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.

5 years agoCTFE: dynamically make sure we do not call non-const-fn
Ralf Jung [Fri, 16 Nov 2018 17:05:08 +0000 (18:05 +0100)]
CTFE: dynamically make sure we do not call non-const-fn

5 years agohandle trait objects formed from traits with `Self::Foo: 'a` clauses
Niko Matsakis [Fri, 16 Nov 2018 13:58:55 +0000 (08:58 -0500)]
handle trait objects formed from traits with `Self::Foo: 'a` clauses

5 years agoimprove debug output related to bound calculation
Niko Matsakis [Fri, 16 Nov 2018 13:25:46 +0000 (08:25 -0500)]
improve debug output related to bound calculation

5 years ago[eddyb] rustc_codegen_llvm: remove unused parametrization of `CodegenCx` and `Builder...
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:48:26 +0000 (13:48 +0200)]
[eddyb] rustc_codegen_llvm: remove unused parametrization of `CodegenCx` and `Builder` over `Value`s.

5 years ago[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:45:28 +0000 (13:45 +0200)]
[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.

5 years ago[eddyb] rustc_codegen_ssa: avoid a `Clone` bound on `TargetMachine`.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:39:56 +0000 (13:39 +0200)]
[eddyb] rustc_codegen_ssa: avoid a `Clone` bound on `TargetMachine`.

5 years ago[eddyb] rustc_codegen_llvm: remove unnecessary `'a` from `LlvmCodegenBackend` impls.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:37:55 +0000 (13:37 +0200)]
[eddyb] rustc_codegen_llvm: remove unnecessary `'a` from `LlvmCodegenBackend` impls.

5 years ago[eddyb] rustc_codegen_utils: remove extraneous `#![allow(dead_code)]`.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:37:17 +0000 (13:37 +0200)]
[eddyb] rustc_codegen_utils: remove extraneous `#![allow(dead_code)]`.

5 years ago[eddyb] rustc_codegen_ssa: handle LLVM unsafety correctly.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:33:28 +0000 (13:33 +0200)]
[eddyb] rustc_codegen_ssa: handle LLVM unsafety correctly.

5 years agoAdded README explaining the refactoring
Denis Merigoux [Mon, 22 Oct 2018 16:35:28 +0000 (18:35 +0200)]
Added README explaining the refactoring

5 years agoSeparating the back folder between backend-agnostic and LLVM-specific code
Denis Merigoux [Tue, 23 Oct 2018 15:01:35 +0000 (17:01 +0200)]
Separating the back folder between backend-agnostic and LLVM-specific code

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 agoUpdate stderr file
Oliver Scherer [Fri, 16 Nov 2018 08:04:35 +0000 (09:04 +0100)]
Update stderr file

5 years agoremove unused dependency
Andreas Jonson [Sat, 10 Nov 2018 22:43:41 +0000 (23:43 +0100)]
remove unused dependency

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 agoFix stability hole with `static _`
Oliver Scherer [Thu, 15 Nov 2018 15:16:34 +0000 (16:16 +0100)]
Fix stability hole with `static _`

5 years agotest/linkage-visibility: Ignore on musl targets
Samuel Holland [Sun, 16 Sep 2018 16:35:41 +0000 (16:35 +0000)]
test/linkage-visibility: Ignore on musl targets

DynamicLibrary uses libc's dlsym() function internally to find symbols.
Some implementations of dlsym(), like musl's, only look at dynamically-
exported symbols, as found in shared libraries. To also export symbols
from the main executable, we would need to pass --export-dynamic to the
linker. Since this flag isn't available everywhere, ignore the test for
now.

5 years agoAdd powerpc64-unknown-linux-musl target
Samuel Holland [Wed, 8 Aug 2018 02:59:15 +0000 (21:59 -0500)]
Add powerpc64-unknown-linux-musl target

5 years agoUse the ELFv2 ABI on powerpc64 musl
Samuel Holland [Thu, 9 Aug 2018 03:06:18 +0000 (22:06 -0500)]
Use the ELFv2 ABI on powerpc64 musl

5 years agoFix powerpc64 ELFv2 big-endian struct-passing ABI
Samuel Holland [Sun, 16 Sep 2018 16:34:15 +0000 (16:34 +0000)]
Fix powerpc64 ELFv2 big-endian struct-passing ABI

The requirements here are not "ELFv1" requirements, but big-endian
requirements, as the extension or non-extension of the argument is
necessary to put the argument in the correct half of the register.
Parameter passing in the ELFv2 ABI needs these same transformations.
Since this code makes no difference on little-endian machines, simplify
it to use the same code path everywhere.

5 years agoAdd powerpc-unknown-linux-musl target
Samuel Holland [Mon, 10 Sep 2018 01:35:35 +0000 (01:35 +0000)]
Add powerpc-unknown-linux-musl target

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.