]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agobootstrap: Link LLVM tools dynamically in order to save time in ThinLTO builds.
Michael Woerister [Tue, 14 Aug 2018 12:31:12 +0000 (14:31 +0200)]
bootstrap: Link LLVM tools dynamically in order to save time in ThinLTO builds.

5 years agoMake Arc cloning mechanics clearer in module docs
Otto Rask [Wed, 29 Aug 2018 10:20:56 +0000 (13:20 +0300)]
Make Arc cloning mechanics clearer in module docs

Add some more wording to module documentation regarding how
`Arc::clone()` works, as some users have assumed cloning Arc's
to work via dereferencing to inner value as follows:

    use std::sync::Arc;

    let myarc = Arc::new(1);
    let myarcref = myarc.clone();

    assert!(1 == myarcref);

Instead of the actual mechanic of referencing the existing
Arc value:

    use std::sync::Arg;

    let myarc = Arc::new(1);
    let myarcref = myarc.clone();

    assert!(myarcref == &myarc); // not sure if assert could assert this
    in the real world

5 years agobench: libcore: fix build failure of any.rs benchmark (use "dyn Any")
Matthias Krüger [Wed, 29 Aug 2018 10:18:05 +0000 (12:18 +0200)]
bench: libcore: fix build failure of any.rs benchmark (use "dyn Any")

5 years agoAuto merge of #53711 - arielb1:macro-table, r=michaelwoerister
bors [Wed, 29 Aug 2018 08:42:20 +0000 (08:42 +0000)]
Auto merge of #53711 - arielb1:macro-table, r=michaelwoerister

create a valid DefIdTable for proc macro crates

At least the incremental compilation code, and a few other places in the
compiler, require the CrateMetadata for a loaded target crate to contain a
valid DefIdTable for the DefIds in the target.

Previously, the CrateMetadata for a proc macro contained the crate's
"host" DefIdTable, which is of course incompatible with the "target"
DefIdTable, causing ICEs. This creates a DefIdTable that properly refers
to the "proc macro" DefIds.

Fixes #49482.

r? @michaelwoerister

Should we beta-nominate this?

5 years agoaudit the relocations code, and clean it up a little
Ralf Jung [Wed, 29 Aug 2018 08:07:27 +0000 (10:07 +0200)]
audit the relocations code, and clean it up a little

5 years agorefactor memory access methods a bit
Ralf Jung [Tue, 28 Aug 2018 15:49:24 +0000 (17:49 +0200)]
refactor memory access methods a bit

5 years agomake ptr_op finally reponsible for all ops involving pointers; make ValTy constructor...
Ralf Jung [Mon, 27 Aug 2018 23:14:29 +0000 (01:14 +0200)]
make ptr_op finally reponsible for all ops involving pointers; make ValTy constructor private

Also remove public OpTy constructors, but a pub(crate) constructor remains

5 years agore-do argument passing one more time to finally be sane
Ralf Jung [Mon, 27 Aug 2018 11:34:35 +0000 (13:34 +0200)]
re-do argument passing one more time to finally be sane

5 years agomemory: make getting the alloc for a static an associate function for easier calling
Ralf Jung [Mon, 27 Aug 2018 11:34:12 +0000 (13:34 +0200)]
memory: make getting the alloc for a static an associate function for easier calling

5 years agomove some Scalar helpers from miri here, and use them where appropriate
Ralf Jung [Sun, 26 Aug 2018 18:42:52 +0000 (20:42 +0200)]
move some Scalar helpers from miri here, and use them where appropriate

5 years agoAuto merge of #53684 - alexcrichton:suggest-remove, r=oli-obk
bors [Wed, 29 Aug 2018 06:24:30 +0000 (06:24 +0000)]
Auto merge of #53684 - alexcrichton:suggest-remove, r=oli-obk

rustc: Suggest removing `extern crate` in 2018

This commit updates the `unused_extern_crates` lint to make automatic
suggestions about removing `extern crate` annotations in the 2018 edition. This
ended up being a little easier than originally though due to what's likely been
fixed issues in the resolver!

Closes #52829

5 years agoAuto merge of #53659 - nnethercote:rm-AccumulateVec, r=Mark-Simulacrum
bors [Wed, 29 Aug 2018 04:20:01 +0000 (04:20 +0000)]
Auto merge of #53659 - nnethercote:rm-AccumulateVec, r=Mark-Simulacrum

Remove `AccumulateVec` and its uses.

It's basically just a less capable version of `SmallVec`.

FWIW, the only use of `ArrayVec` is now within `HybridIdxSet`.

r? @Mark-Simulacrum

5 years agoAuto merge of #53642 - alexcrichton:fix-target-cpu-native, r=arielb1
bors [Wed, 29 Aug 2018 02:08:02 +0000 (02:08 +0000)]
Auto merge of #53642 - alexcrichton:fix-target-cpu-native, r=arielb1

Fix warnings about the `native` target-cpu

This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322

5 years agoAuto merge of #53671 - RalfJung:miri-refactor, r=oli-obk
bors [Wed, 29 Aug 2018 00:02:37 +0000 (00:02 +0000)]
Auto merge of #53671 - RalfJung:miri-refactor, r=oli-obk

Miri engine cleanup

* Unify the two maps in memory to store the allocation and its kind together.
* Share the handling of statics between CTFE and miri: The miri engine always
      uses "lazy" `AllocType::Static` when encountering a static.  Acessing that
      static invokes CTFE (no matter the machine).  The machine only has any
      influence when writing to a static, which CTFE outright rejects (but miri
      makes a copy-on-write).
* Add an `AllocId` to by-ref consts so miri can use them as operands without
      making copies.
* Move responsibilities around for the `eval_fn_call` machine hook: The hook
      just has to find the MIR (or entirely take care of everything); pushing the
      new stack frame is taken care of by the miri engine.
* Expose the intrinsics and lang items implemented by CTFE so miri does not
      have to reimplement them.
* Allow Machine to hook into foreign statics (used by miri to get rid of some other hacks).
* Clean up function calling.
* Switch const sanity check to work on operands, not mplaces.
* Move const_eval out of rustc_mir::interpret, to make sure that it does not access private implementation details.

In particular, we can finally make `eval_operand` take `&self`. :-)

Should be merged after https://github.com/rust-lang/rust/pull/53609, across which I will rebase.

5 years agoRemove `AccumulateVec` and its uses.
Nicholas Nethercote [Fri, 24 Aug 2018 03:51:32 +0000 (13:51 +1000)]
Remove `AccumulateVec` and its uses.

It's basically just a less capable version of `SmallVec`.

5 years agoAdd rust-gdbgui script.
Philip Daniels [Tue, 28 Aug 2018 21:05:00 +0000 (22:05 +0100)]
Add rust-gdbgui script.

This script invokes the gdbgui graphical GDB front-end
with the Rust pretty printers loaded. The script does not install
gdbgui, that must be done manually.

5 years agoFix warnings about the `native` target-cpu
Alex Crichton [Thu, 23 Aug 2018 18:03:22 +0000 (11:03 -0700)]
Fix warnings about the `native` target-cpu

This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322

5 years agoAlso link Clippy repo in the CONTRIBUTING.md file
Philipp Krones [Tue, 28 Aug 2018 18:43:10 +0000 (20:43 +0200)]
Also link Clippy repo in the CONTRIBUTING.md file

5 years agoAdd partialeq implementation for TryFromIntError type
Guillaume Gomez [Sat, 18 Aug 2018 21:24:25 +0000 (23:24 +0200)]
Add partialeq implementation for TryFromIntError type

5 years agomove file-extension based .gitignore down to src/
Ralf Jung [Tue, 28 Aug 2018 18:04:52 +0000 (20:04 +0200)]
move file-extension based .gitignore down to src/

5 years agofirst test const-ness, then hook fn call
Ralf Jung [Mon, 27 Aug 2018 15:57:30 +0000 (17:57 +0200)]
first test const-ness, then hook fn call

5 years agofix const_prop detecting unary neg underflows
Ralf Jung [Sun, 26 Aug 2018 14:36:18 +0000 (16:36 +0200)]
fix const_prop detecting unary neg underflows

5 years agorestructure unary_op to also dispatch on type first; fix promotion with unary '-...
Ralf Jung [Sun, 26 Aug 2018 13:13:01 +0000 (15:13 +0200)]
restructure unary_op to also dispatch on type first; fix promotion with unary '-' overflowing

5 years agofix unsized extern types
Ralf Jung [Sun, 26 Aug 2018 12:35:15 +0000 (14:35 +0200)]
fix unsized extern types

5 years agoaddress nits
Ralf Jung [Sun, 26 Aug 2018 12:22:59 +0000 (14:22 +0200)]
address nits

5 years agoAuto merge of #53679 - japaric:cortex-r, r=alexcrichton
bors [Tue, 28 Aug 2018 16:23:27 +0000 (16:23 +0000)]
Auto merge of #53679 - japaric:cortex-r, r=alexcrichton

add more Cortex-R targets

This expands on PR #53663 to complete the set of Cortex-R targets and builds
rust-std components for them.

r? @alexcrichton

each extra rust-std component (there's 4 of them) takes about 3 minutes to build
on my local machine. In terms of stability (LLVM codegen bugs) these new targets
should be as stable as the Cortex-M ones (e.g. `thumbv7m-none-eabi`).

If the extra build time is too much we can leave the rust-std components out for
now

closes #53663
cc @paoloteti

5 years agoUse FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.
Eduard-Mihai Burtescu [Sat, 18 Aug 2018 10:55:43 +0000 (13:55 +0300)]
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.

5 years agoFix tidy
MaloJaffre [Tue, 28 Aug 2018 13:59:21 +0000 (15:59 +0200)]
Fix tidy

5 years agoAdd docs and debug asserts
MaloJaffre [Tue, 28 Aug 2018 13:38:56 +0000 (15:38 +0200)]
Add docs and debug asserts

5 years agoAuto merge of #53493 - matthewjasper:hair-spans, r=nikomatsakis
bors [Tue, 28 Aug 2018 13:12:16 +0000 (13:12 +0000)]
Auto merge of #53493 - matthewjasper:hair-spans, r=nikomatsakis

Use smaller span for adjustments on block expressions

When returning a mutable reference don't use the entire body of the function as the span for the adjustments at the end.

The error [in this case](https://github.com/rust-lang/rust/compare/master...matthewjasper:hair-spans?expand=1#diff-ecef8b1f15622fb48a803c9b61605c78) is worse, but neither error message is really what we want. I have some ideas on how to get a better error message that will have to wait for a future PR.

5 years agosort
Jorge Aparicio [Tue, 28 Aug 2018 12:58:52 +0000 (14:58 +0200)]
sort

5 years agoWarn about naively fixing the FIXME
Oliver Schneider [Tue, 28 Aug 2018 12:04:07 +0000 (14:04 +0200)]
Warn about naively fixing the FIXME

5 years agoUse partial but correct vtable layout
Oliver Schneider [Sun, 26 Aug 2018 20:21:20 +0000 (22:21 +0200)]
Use partial but correct vtable layout

5 years agoAuto merge of #53314 - nikomatsakis:nll-invert-liveness, r=pnkfelix
bors [Tue, 28 Aug 2018 10:58:10 +0000 (10:58 +0000)]
Auto merge of #53314 - nikomatsakis:nll-invert-liveness, r=pnkfelix

NLL: experiment with inverting liveness

I got inspired to see what would happen here.

Fixes #52460

r? @pnkfelix

5 years agoFix typo in comment
Dimitri Merejkowsky [Tue, 28 Aug 2018 09:06:40 +0000 (11:06 +0200)]
Fix typo in comment

5 years agoFix definition of `LocalUseMapBuild` so that it can build under stage0,
Felix S. Klock II [Tue, 28 Aug 2018 08:59:15 +0000 (10:59 +0200)]
Fix definition of `LocalUseMapBuild` so that it can build under stage0,
which does not have as many feature gates enabled.

5 years agosplit paragraph
Ralf Jung [Tue, 28 Aug 2018 08:49:45 +0000 (10:49 +0200)]
split paragraph

5 years agoexpand keep-stage --help text
Ralf Jung [Tue, 28 Aug 2018 08:20:24 +0000 (10:20 +0200)]
expand keep-stage --help text

5 years agoAuto merge of #53616 - varkor:hir-map-rename, r=nikomatsakis
bors [Tue, 28 Aug 2018 06:44:12 +0000 (06:44 +0000)]
Auto merge of #53616 - varkor:hir-map-rename, r=nikomatsakis

Restructure hir::map::Node and hir::map::Entry

- Moves `hir::map::Node` to `hir::Node` and removes the `Node*` prefix from its variants.
- Changes `hir::map::Entry` to a struct `hir::map::Entry`.
- Removes the `Node*` prefix from each of `AnnNode`s variants.

r? @eddyb

5 years agoAuto merge of #53404 - oconnor663:current_dir_behavior, r=alexcrichton
bors [Tue, 28 Aug 2018 03:22:21 +0000 (03:22 +0000)]
Auto merge of #53404 - oconnor663:current_dir_behavior, r=alexcrichton

document the platform-specific behavior of Command::current_dir

See also https://github.com/rust-lang/rust/issues/37868.

Here's my initial wording:

> Note that if the program path is relative (e.g. `"./script.sh"`), the interaction between that path and `current_dir` varies across platforms. Windows currently ignores `current_dir` when locating the program, but Unix-like systems interpret the program path relative to `current_dir`. These implementation details aren't considered stable, and it's recommended to call `canonicalize` to get an absolute program path instead of using relative paths and `current_dir` together.

I'd like to get feedback on:

- _Should_ we consider those details stable? It might be disruptive to change them, regardless of what I can get away with claiming in docs :)
- Is `canonicalize` an appropriate recommendation? As discussed in #37868 above, there are reasons it's not called automatically in the `Command` implementation.

5 years agoAuto merge of #53272 - mark-i-m:anon_param_error_now, r=nikomatsakis
bors [Tue, 28 Aug 2018 01:04:05 +0000 (01:04 +0000)]
Auto merge of #53272 - mark-i-m:anon_param_error_now, r=nikomatsakis

Warn on anon params in 2015 edition

cc #41686 https://github.com/rust-lang/rfcs/pull/2522
cc  @Centril @nikomatsakis

TODO:
- [x] Make sure the tests pass.
- [x] Make sure there is rustfix-able suggestion. Current plan is to just suggest `_ : Foo`
- [x] Add a rustfix ui test.

EDIT: It seems I already did the last two in #48309

5 years agoAuto merge of #53227 - nivkner:pin_move, r=RalfJung
bors [Mon, 27 Aug 2018 22:56:15 +0000 (22:56 +0000)]
Auto merge of #53227 - nivkner:pin_move, r=RalfJung

move the Pin API into its own module for centralized documentation

This implements the change proposed by @withoutboats in #49150, as suggested by @RalfJung in the review of #53104,
along with the documentation that was originally in it, that was deemed more appropriate in module-level documentation.

r? @RalfJung

5 years agoremove `let x = baz` which was obscuring the real error
Niko Matsakis [Mon, 6 Aug 2018 20:41:35 +0000 (16:41 -0400)]
remove `let x = baz` which was obscuring the real error

5 years agoRevert crate root changes
varkor [Sat, 25 Aug 2018 23:20:24 +0000 (00:20 +0100)]
Revert crate root changes

5 years agoMake small modifications
varkor [Sat, 25 Aug 2018 22:10:01 +0000 (23:10 +0100)]
Make small modifications

5 years agoRename hir::map::NodeKind to hir::Node
varkor [Sat, 25 Aug 2018 14:56:16 +0000 (15:56 +0100)]
Rename hir::map::NodeKind to hir::Node

5 years agoConvert EntryKind to a struct, Entry
varkor [Sat, 25 Aug 2018 14:48:42 +0000 (15:48 +0100)]
Convert EntryKind to a struct, Entry

5 years agoRemove path prefixes from NodeKind
varkor [Wed, 22 Aug 2018 22:05:26 +0000 (23:05 +0100)]
Remove path prefixes from NodeKind

5 years agoRemove Node* prefix from AnnNode
varkor [Wed, 22 Aug 2018 21:05:19 +0000 (22:05 +0100)]
Remove Node* prefix from AnnNode

5 years agoRename hir::map::Node to hir::map::NodeKind
varkor [Wed, 22 Aug 2018 20:55:53 +0000 (21:55 +0100)]
Rename hir::map::Node to hir::map::NodeKind

5 years agoRename MapEntry to EntryKind
varkor [Wed, 22 Aug 2018 20:35:43 +0000 (21:35 +0100)]
Rename MapEntry to EntryKind

5 years agoFix invalid display of unstable messages
Guillaume Gomez [Mon, 27 Aug 2018 19:52:10 +0000 (21:52 +0200)]
Fix invalid display of unstable messages

5 years agoFix source automatic scroll
Guillaume Gomez [Mon, 27 Aug 2018 19:51:56 +0000 (21:51 +0200)]
Fix source automatic scroll

5 years agoAuto merge of #51456 - qmx:crate-in-path, r=nikomatsakis
bors [Mon, 27 Aug 2018 19:51:01 +0000 (19:51 +0000)]
Auto merge of #51456 - qmx:crate-in-path, r=nikomatsakis

resolve suggestions should use `crate::` when enabled

I couldn't find a way to add a specific assertion for the ui test, so the expected output is living under the `crates-in-path.stderr` ui test.

- is this the right place for the test?

fixes #51212

5 years agofix a typo: taget_env -> target_env
Jack O'Connor [Mon, 27 Aug 2018 17:25:58 +0000 (13:25 -0400)]
fix a typo: taget_env -> target_env

This typo was introduced in https://github.com/rust-lang/rust/pull/47334.
A couple tests bitrotted as a result, so we fix those too, and move them
to a more sensible place.

5 years agofix test stderrs
Mark Mansi [Mon, 27 Aug 2018 18:06:26 +0000 (13:06 -0500)]
fix test stderrs

5 years agomake `to_location` O(1)
Niko Matsakis [Wed, 22 Aug 2018 11:41:59 +0000 (07:41 -0400)]
make `to_location` O(1)

5 years agomerge `PointIndexMap` and `RegionValueElements`
Niko Matsakis [Tue, 21 Aug 2018 20:48:16 +0000 (16:48 -0400)]
merge `PointIndexMap` and `RegionValueElements`

5 years agomicro-optimize dominator code
Niko Matsakis [Mon, 13 Aug 2018 23:05:07 +0000 (19:05 -0400)]
micro-optimize dominator code

5 years agokill dead code from `util/liveness`
Niko Matsakis [Mon, 20 Aug 2018 20:44:48 +0000 (13:44 -0700)]
kill dead code from `util/liveness`

5 years agoimprove comment on `LiveVar`
Niko Matsakis [Mon, 20 Aug 2018 20:35:43 +0000 (13:35 -0700)]
improve comment on `LiveVar`

5 years agorename `LocalWithRegion` to `LiveVar`
Niko Matsakis [Mon, 20 Aug 2018 20:32:55 +0000 (13:32 -0700)]
rename `LocalWithRegion` to `LiveVar`

5 years agocomment what `trace` does
Niko Matsakis [Sun, 19 Aug 2018 14:45:59 +0000 (07:45 -0700)]
comment what `trace` does

5 years agofix comment
Niko Matsakis [Sun, 19 Aug 2018 14:42:22 +0000 (07:42 -0700)]
fix comment

5 years agoenable feature `impl_header_lifetime_elision`
Niko Matsakis [Mon, 13 Aug 2018 21:30:50 +0000 (17:30 -0400)]
enable feature `impl_header_lifetime_elision`

5 years agoliveness.rs: rustfmt
Niko Matsakis [Mon, 13 Aug 2018 21:50:34 +0000 (17:50 -0400)]
liveness.rs: rustfmt

5 years agoimplement liveness tracing, remove old liveness system
Niko Matsakis [Sun, 12 Aug 2018 17:07:14 +0000 (13:07 -0400)]
implement liveness tracing, remove old liveness system

5 years agorustc: Suggest removing `extern crate` in 2018
Alex Crichton [Fri, 24 Aug 2018 21:00:15 +0000 (14:00 -0700)]
rustc: Suggest removing `extern crate` in 2018

This commit updates the `unused_extern_crates` lint to make automatic
suggestions about removing `extern crate` annotations in the 2018 edition. This
ended up being a little easier than originally though due to what's likely been
fixed issues in the resolver!

Closes #52829

5 years agoupdate comment in the interest of precision
Niko Matsakis [Mon, 13 Aug 2018 16:02:38 +0000 (09:02 -0700)]
update comment in the interest of precision

5 years agoremove the liveness mode and simplify `categorize`
Niko Matsakis [Fri, 10 Aug 2018 16:42:48 +0000 (12:42 -0400)]
remove the liveness mode and simplify `categorize`

Less modes!

5 years agoAuto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakis
bors [Mon, 27 Aug 2018 17:42:45 +0000 (17:42 +0000)]
Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakis

fix for late-bound regions

Fix for https://github.com/rust-lang/rust/issues/53419

r? @nikomatsakis

5 years agoFix anon param + make it allow-by-def
Mark Mansi [Mon, 27 Aug 2018 17:14:31 +0000 (12:14 -0500)]
Fix anon param + make it allow-by-def

5 years agofix another
Mark Mansi [Sat, 11 Aug 2018 17:44:35 +0000 (12:44 -0500)]
fix another

5 years agofix some anon params
Mark Mansi [Sat, 11 Aug 2018 17:28:35 +0000 (12:28 -0500)]
fix some anon params

5 years agooops
Mark Mansi [Sat, 11 Aug 2018 16:39:10 +0000 (11:39 -0500)]
oops

5 years agowarn on anon params in 015
Mark Mansi [Sat, 11 Aug 2018 16:15:57 +0000 (11:15 -0500)]
warn on anon params in 015

5 years agoadd llvm-readobj to llvm-tools-preview
Jorge Aparicio [Mon, 27 Aug 2018 17:00:07 +0000 (19:00 +0200)]
add llvm-readobj to llvm-tools-preview

5 years agouse associated const for machine controlling mutable statics
Ralf Jung [Sun, 26 Aug 2018 10:59:59 +0000 (12:59 +0200)]
use associated const for machine controlling mutable statics

So get rid of the IsStatic trait again

5 years agoget rid of *most* of the fn call hack by honoring mir.spread_arg
Ralf Jung [Sat, 25 Aug 2018 19:22:00 +0000 (21:22 +0200)]
get rid of *most* of the fn call hack by honoring mir.spread_arg

5 years agofix len() on non-array but array-layout types (e.g. SIMD)
Ralf Jung [Sat, 25 Aug 2018 16:32:01 +0000 (18:32 +0200)]
fix len() on non-array but array-layout types (e.g. SIMD)

5 years agoexpand comment on how statics work
Ralf Jung [Sat, 25 Aug 2018 15:10:08 +0000 (17:10 +0200)]
expand comment on how statics work

5 years agofix handling of unsized types in validation; validate str to be UTF-8
Ralf Jung [Sat, 25 Aug 2018 12:36:24 +0000 (14:36 +0200)]
fix handling of unsized types in validation; validate str to be UTF-8

5 years agovalidate enum discriminant whenever it is read
Ralf Jung [Sat, 25 Aug 2018 09:07:03 +0000 (11:07 +0200)]
validate enum discriminant whenever it is read

5 years agodedicated handling for binops on bool and char (UB if they are not valid)
Ralf Jung [Fri, 24 Aug 2018 16:36:52 +0000 (18:36 +0200)]
dedicated handling for binops on bool and char (UB if they are not valid)

5 years agoget rid of FinishStatic hack from stack clenaup; const_eval can do that itself
Ralf Jung [Fri, 24 Aug 2018 15:36:18 +0000 (17:36 +0200)]
get rid of FinishStatic hack from stack clenaup; const_eval can do that itself

5 years agomove const_eval out of rustc_mir::interpret
Ralf Jung [Fri, 24 Aug 2018 14:39:25 +0000 (16:39 +0200)]
move const_eval out of rustc_mir::interpret

to make sure that it does not access private implementation details

5 years agoswitch validation to use operand, not mplace
Ralf Jung [Fri, 24 Aug 2018 13:27:05 +0000 (15:27 +0200)]
switch validation to use operand, not mplace

this means we can get rid of the public allocate_op, and make OpTy only
constructible in librustc_mir

5 years agoterminator/drop.rs is just one fn... merge it together with the other terminator...
Ralf Jung [Fri, 24 Aug 2018 12:44:30 +0000 (14:44 +0200)]
terminator/drop.rs is just one fn... merge it together with the other terminator stuff

5 years agoClean up function calling
Ralf Jung [Fri, 24 Aug 2018 12:40:55 +0000 (14:40 +0200)]
Clean up function calling

Still not as clean as I'd like it, but better

5 years agosimplify const_to_allocation_provider because it is used for statics only
Ralf Jung [Thu, 23 Aug 2018 21:38:47 +0000 (23:38 +0200)]
simplify const_to_allocation_provider because it is used for statics only

5 years agoallow Machine to hook into foreign statics; remove unused HasMemory trait
Ralf Jung [Thu, 23 Aug 2018 19:22:27 +0000 (21:22 +0200)]
allow Machine to hook into foreign statics; remove unused HasMemory trait

5 years agowithout all those copies of constants, we can finally make eval_operand take &self
Ralf Jung [Thu, 23 Aug 2018 17:27:14 +0000 (19:27 +0200)]
without all those copies of constants, we can finally make eval_operand take &self

5 years agoMiri Memory Work
Ralf Jung [Thu, 23 Aug 2018 17:04:33 +0000 (19:04 +0200)]
Miri Memory Work

* Unify the two maps in memory to store the allocation and its kind together.
* Share the handling of statics between CTFE and miri: The miri engine always
  uses "lazy" `AllocType::Static` when encountering a static.  Acessing that
  static invokes CTFE (no matter the machine).  The machine only has any
  influence when writing to a static, which CTFE outright rejects (but miri
  makes a copy-on-write).
* Add an `AllocId` to by-ref consts so miri can use them as operands without
  making copies.
* Move responsibilities around for the `eval_fn_call` machine hook: The hook
  just has to find the MIR (or entirely take care of everything); pushing the
  new stack frame is taken care of by the miri engine.
* Expose the intrinsics and lang items implemented by CTFE so miri does not
  have to reimplement them.

5 years agoAuto merge of #53580 - nikomatsakis:nll-issue-53568, r=pnkfelix
bors [Mon, 27 Aug 2018 14:44:13 +0000 (14:44 +0000)]
Auto merge of #53580 - nikomatsakis:nll-issue-53568, r=pnkfelix

fix NLL ICEs

Custom type-ops reuse some of the query machinery -- but while query results are canonicalized after they are constructed, custom type ops are not, and hence we have to resolve the type variables to avoid an ICE here.

Also, use the type-op machinery for implied outlives bounds.

Fixes #53568
Fixes #52992
Fixes #53680

5 years agoadd test for the suggestion from prelude
Douglas Campos [Mon, 27 Aug 2018 14:12:31 +0000 (14:12 +0000)]
add test for the suggestion from prelude

5 years agono need to special case std
Douglas Campos [Mon, 27 Aug 2018 12:36:30 +0000 (12:36 +0000)]
no need to special case std

5 years agoAuto merge of #53656 - nnethercote:HybridIdxSet-tweaks, r=nikomatsakis
bors [Mon, 27 Aug 2018 11:47:03 +0000 (11:47 +0000)]
Auto merge of #53656 - nnethercote:HybridIdxSet-tweaks, r=nikomatsakis

`HybridIdxSet` tweaks

A couple of tweaks to `HybridIdxSet`.

r? @nikomatsakis

5 years agoAlso use smaller spans for unsize adjustments
Matthew Jasper [Mon, 27 Aug 2018 11:36:49 +0000 (12:36 +0100)]
Also use smaller spans for unsize adjustments

5 years agoAuto merge of #53624 - Zoxc:ice-fix, r=oli-obk
bors [Mon, 27 Aug 2018 09:08:27 +0000 (09:08 +0000)]
Auto merge of #53624 - Zoxc:ice-fix, r=oli-obk

Move with_globals setup from run_compiler to run

An alternative to https://github.com/rust-lang/rust/pull/53526

Note this breaks some miri stuff and clippy since they call `run_compiler` directly, and they now need to also call `with_globals ` cc @rust-lang/dev-tools

r? @oli-obk

5 years agoAvoid calling `unroll_place()` in a common case.
Nicholas Nethercote [Mon, 27 Aug 2018 06:40:42 +0000 (16:40 +1000)]
Avoid calling `unroll_place()` in a common case.

This reduces the execution time for `ucd-check` by 25%.