about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-05-09Auto merge of #49834 - Zoxc:sync-trait-cache, r=nikomatsakisbors-10/+17
Make SelectionCache and EvaluationCache thread-safe Split out from https://github.com/rust-lang/rust/pull/49558 r? @nikomatsakis
2018-05-09Auto merge of #49711 - ibabushkin:auto_trait_refactor, r=nikomatsakisbors-541/+698
Refactor auto trait handling in librustdoc to be accessible from librustc. These commits transfer some of the functionality introduced in https://github.com/rust-lang/rust/pull/47833 to librustc with the intention of making the tools to work with auto traits accessible to third-party code, for example [rust-semverver](https://github.com/rust-lang-nursery/rust-semverver). Some rough edges remain, and I'm certain some of the FIXMEs introduced will need some discussion, most notably the fairly ugly overall approach to pull out the core logic into librustc, which was previously fairly tightly coupled with various bits and bobs from librustdoc. cc @Aaron1011
2018-05-09Rollup merge of #50527 - glandium:cleanup, r=sfacklerkennytm-1/+1
Cleanup a `use` in a raw_vec test `allocator` is deprecated in favor of `alloc`, and `Alloc` is already imported through `super::*`.
2018-05-09Rollup merge of #50511 - Manishearth:must-use, r=QuietMisdreavuskennytm-12/+14
Add some explanations for #[must_use] `#[must_use]` can be given a string argument which is shown whilst warning for things. We should add a string argument to most of the user-exposed ones. I added these for everything but the operators, mostly because I'm not sure what to write there or if we need anything there.
2018-05-09Rollup merge of #50505 - Aaronepower:add-test, r=oli-obkkennytm-0/+29
Added regression function match value test closes #44333
2018-05-09Rollup merge of #50464 - est31:master, r=rkruppekennytm-6/+4
Remove some transmutes
2018-05-09Rollup merge of #50460 - F001:const_string, r=kennytmkennytm-2/+9
Make `String::new()` const Following the steps of https://github.com/rust-lang/rust/pull/50233 , make `String::new()` a `const fn`.
2018-05-09Rollup merge of #50148 - japaric:const-manuallydrop, r=oli-obkkennytm-1/+2
turn `ManuallyDrop::new` into a constant function
2018-05-09Rollup merge of #49988 - clarcharr:never_docs, r=steveklabnikkennytm-0/+53
Mention Result<!, E> in never docs. Fixes #48096.
2018-05-09Rollup merge of #50539 - clarcharr:log_const, r=dtolnaykennytm-0/+16
Add more logarithm constants Right now, we have `ln(2)` and `ln(10)`, but only `log2(e)` and `log10(e)`. This also adds `log2(10)` and `log10(2)` for consistency.
2018-05-09Rollup merge of #50525 - nnethercote:lit_token, r=michaelwoeristerkennytm-6/+17
Optimize string handling in lit_token(). In the common case, the string value in a string literal Token is the same as the string value in a string literal LitKind. (The exception is when escapes or \r are involved.) This patch takes advantage of that to avoid calling str_lit() and re-interning the string in that case. This speeds up incremental builds for a few of the rustc-benchmarks, the best by 3%. Benchmarks that got a speedup of 1% or more: ``` coercions avg: -1.1% min: -3.5% max: 0.4% regex-check avg: -1.2% min: -1.5% max: -0.6% futures-check avg: -0.9% min: -1.4% max: -0.3% futures avg: -0.8% min: -1.3% max: -0.3% futures-opt avg: -0.7% min: -1.2% max: -0.1% regex avg: -0.5% min: -1.2% max: -0.1% regex-opt avg: -0.5% min: -1.1% max: -0.1% hyper-check avg: -0.7% min: -1.0% max: -0.3% ```
2018-05-09Rollup merge of #50456 - alexcrichton:update-cargo, r=alexcrichtonkennytm-0/+0
Update the Cargo submodule Hopefully brining in a few fixes to Cargo regressions!
2018-05-09Optimize string handling in lit_token().Nicholas Nethercote-6/+17
In the common case, the string value in a string literal Token is the same as the string value in a string literal LitKind. (The exception is when escapes or \r are involved.) This patch takes advantage of that to avoid calling str_lit() and re-interning the string in that case. This speeds up incremental builds for a few of the rustc-benchmarks, the best by 3%.
2018-05-08Add more logarithm constantsClar Charr-0/+16
2018-05-08Auto merge of #50530 - oli-obk:miri, r=kennytmbors-19/+46
Fix thinning pointers to extern types in miri r? @kennytm as an alternative to disabling the miri build fixes #50495
2018-05-08Update the Cargo/stdsimd submodulesAlex Crichton-0/+0
Hopefully brining in a few fixes to Cargo regressions as well as some new stdsimd functions!
2018-05-08Auto merge of #50497 - RalfJung:pinmut, r=withoutboatsbors-31/+34
Rename Pin to PinMut, and some more breaking changes As discussed at [1] §3 and [2] and [3], a formal look at pinning requires considering a distinguished "shared pinned" mode/typestate. Given that, it seems desirable to at least eventually actually expose that typestate as a reference type. This renames Pin to PinMut, freeing the name Pin in case we want to use it for a shared pinned reference later on. [1] https://www.ralfj.de/blog/2018/04/10/safe-intrusive-collections-with-pinning.html [2] https://github.com/rust-lang/rfcs/pull/2349#issuecomment-379250361 [3] https://github.com/rust-lang/rust/issues/49150#issuecomment-380488275 Cc @withoutboats
2018-05-08Auto merge of #50490 - nrc:method-docs, r=eddybbors-36/+30
save-analysis: emit correct docs for methods cc https://github.com/rust-lang-nursery/rls/issues/446 r? @eddyb
2018-05-08Fix thinning pointers to extern types in miriOliver Schneider-19/+46
2018-05-08Auto merge of #50503 - alexheretic:master, r=oli-obkbors-23/+27
Update rls with compiling clippy Updates rls to use a working clippy version. This pr can be closed if the latest clippy release is broken again.
2018-05-08Cleanup a `use` in a raw_vec testMike Hommey-1/+1
`allocator` is deprecated in favor of `alloc`, and `Alloc` is already imported through `super::*`.
2018-05-08Auto merge of #50390 - hdhoang:46205_deny_by_default, r=nikomatsakisbors-80/+42
lint: deny incoherent_fundamental_impls by default Warn the ecosystem of the pending intent-to-disallow in #49799. There are 4 ICEs on my machine, look unrelated (having happened before in https://github.com/rust-lang/rust/issues/49146#issuecomment-384473523) ```rust thread 'main' panicked at 'assertion failed: position <= slice.len()', libserialize/leb128.rs:97:1 ``` ``` [run-pass] run-pass/allocator/xcrate-use2.rs [run-pass] run-pass/issue-12133-3.rs [run-pass] run-pass/issue-32518.rs [run-pass] run-pass/trait-default-method-xc-2.rs ``` r? @nikomatsakis
2018-05-08Auto merge of #50260 - Manishearth:no-extern-crate, r=nikomatsakisbors-1/+189
idiom lints for removing `extern crate` Based off of https://github.com/rust-lang/rust/pull/49789 This contains two lints: - One that suggests replacing pub extern crates with pub use, and removing non-pub extern crates entirely - One that suggests rewriting `use modulename::...::cratename::foo` as `cratename::foo` The latter is a bit tricky to emit suggestions for; for one this involves splicing spans (never a good idea), and it also won't be able to correctly handle `use module::{cratename, foo}` and use-trees. I'm not sure how to proceed here. Currently it doesn't suggest anything at all. Perhaps we can go the other way and suggest removal of all extern crates _except_ those used through modules (stash node ids somewhere) and suggest replacing those with `<visibility> use`? r? @nikomatsakis fixes https://github.com/rust-lang/rust/issues/48719
2018-05-07Auto merge of #50305 - GuillaumeGomez:fix-mod-stackoverflow, r=QuietMisdreavusbors-9/+47
Prevent infinite recursion of modules Fixes #50196. r? @QuietMisdreavus
2018-05-07Add explanation for #[must_use] on string replace methodsManish Goregaokar-2/+4
2018-05-07Add explanation for #[must_use] on mutex guardsManish Goregaokar-4/+4
2018-05-07Add explanation for #[must_use] on Debug buildersManish Goregaokar-5/+5
2018-05-07Add explanation for #[must_use] on ResultManish Goregaokar-1/+1
2018-05-07Make SelectionCache and EvaluationCache thread-safeJohn Kåre Alsaker-10/+17
2018-05-07Added regression function match value test, closes #44333Aaron Power-0/+29
2018-05-07Update clippy 0.0.197Alex Butler-40/+22
2018-05-07Auto merge of #50454 - Manishearth:edition-preview-fixes, r=alexcrichtonbors-24/+53
Various edition preview fixes Implement a bunch of things discussed in the meeting.
2018-05-07Update rls 1263f1fAlex Butler-4/+26
Fix rls-clippy feature compile
2018-05-07Auto merge of #50487 - nikic:heap-manually-drop, r=Gankrobors-6/+5
Use ManuallyDrop instead of Option in BinaryHeap Hole implementation The Option is always Some until drop, where it becomes None. Make this more explicit and avoid unwraps by using ManuallyDrop. This change should be performance-neutral as LLVM already optimizes the unwraps away in the inlined code. However I've seen this pattern copied from here to other crates where it is not optimized away, so I think it would be good to change it.
2018-05-07Unpin: Fix references to Pin typeRalf Jung-4/+4
2018-05-07Rename PinMut::borrow to PinMut::reborrow and make it a methodRalf Jung-3/+6
2018-05-07PinMut::get_mut can also preserve the lifetimeRalf Jung-1/+1
2018-05-07Change PinMut::map to be able to preserve the original reference's lifetimeRalf Jung-1/+1
Suggested by @dylanede at <https://github.com/rust-lang/rust/issues/49150#issuecomment-381071442>.
2018-05-07Rename Pin to PinMutRalf Jung-27/+27
As discussed at [1] §3 and [2] and [3], a formal look at pinning requires considering a distinguished "shared pinned" mode/typestate. Given that, it seems desirable to at least eventually actually expose that typestate as a reference type. This renames Pin to PinMut, freeing the name Pin in case we want to use it for a shared pinned reference later on. [1] https://www.ralfj.de/blog/2018/04/10/safe-intrusive-collections-with-pinning.html [2] https://github.com/rust-lang/rfcs/pull/2349#issuecomment-379250361 [3] https://github.com/rust-lang/rust/issues/49150#issuecomment-380488275
2018-05-07Prevent infinite recursion of modulesGuillaume Gomez-9/+47
2018-05-07make the const constructor unstableJorge Aparicio-0/+1
2018-05-07Auto merge of #50000 - michaelwoerister:cross-lang-lto, r=alexcrichtonbors-17/+160
Add some groundwork for cross-language LTO. Implements part of #49879: - Adds a `-Z cross-lang-lto` flag to rustc - Makes sure that bitcode is embedded in object files if the flag is set. This should already allow for using cross language LTO for staticlibs (where one has to invoke the linker manually anyway). However, `rustc` will not try to enable LTO for its own linker invocations yet. r? @alexcrichton
2018-05-07Fix Mac OS section name for LLVM bitcode.Michael Woerister-1/+1
2018-05-07Auto merge of #50437 - zackmdavis:must_note, r=estebankbors-10/+17
in which the must-use additional messaging is tucked into a note _I_ think it looks better this way! What do _you_ think?? ![must_use_note](https://user-images.githubusercontent.com/1076988/39612597-b6dd2dae-4f15-11e8-87ec-ab9da21ef062.png) r? @estebank
2018-05-06in which the must-use additional messaging is tucked into a noteZack M. Davis-10/+17
Also, a comment is edited to reflect that spaces around the equals-sign in attributes is the standard (q.v. rust-lang-nursery/fmt-rfcs@bea80532e7).
2018-05-07Auto merge of #50434 - nrc:tool-bustage-infra, r=alexcrichtonbors-1/+1
Ping infra team on all tool bustage r? @kennytm cc @rust-lang/core as discussed at today's meeting
2018-05-07save-analysis: emit correct docs for methodsNick Cameron-36/+30
cc https://github.com/rust-lang-nursery/rls/issues/446
2018-05-06Auto merge of #50468 - nrc:test-rustfmt, r=alexcrichtonbors-5/+8
Pass a test directory to rustfmt Another attempt to fix the rustfmt tests. `RUSTFMT_TEST_DIR` is consumed by Rustfmt in the latext commit (thus the Rustfmt update) because we need a place to create temp files that won't be read-only. r? @alexcrichton
2018-05-06Auto merge of #50309 - samWson:issue-49938, r=eddybbors-18/+18
Issue 49938: Reference tagged unions discr(iminant) as tag Here the changes reference the Tagged type _discriminant_ as _tag_ instead. This is the correct terminology when referencing how tagged unions are represented in memory.
2018-05-06Auto merge of #50474 - sinkuu:fix_assert_ice, r=alexcrichtonbors-58/+24
Fix ICE in assertion macro Fixes #50471. Needs beta-backport (stable-to-beta/nightly regression). * `panic` with single argument does not need escaping `{` and `}` * Instead of unescaping `\u{...}` manually, just use `escape_debug` in pprust