Commit Graph

103105 Commits

Author SHA1 Message Date
Guillaume Gomez
81e549cc76 remove code that doesn't belong in clean/types.rs 2019-12-04 13:13:59 +01:00
Guillaume Gomez
72fdce2d86 remove code that doesn't belong in clean/mod.rs anymore 2019-12-03 22:03:38 +01:00
Guillaume Gomez
c0e78d6124 Create new types.rs file 2019-12-03 22:03:19 +01:00
bors
8f1bbd69e1 Auto merge of #66873 - RalfJung:miri-args, r=dtolnay
really_init cmdline args on Miri

r? @joshtriplett

Closes #66862.
2019-11-30 02:12:19 +00:00
bors
9081929d45 Auto merge of #66879 - RalfJung:rollup-nprxpzi, r=RalfJung
Rollup of 11 pull requests

Successful merges:

 - #66379 (Rephrase docs in for ptr)
 - #66589 (Draw vertical lines correctly in compiler error messages)
 - #66613 (Allow customising ty::TraitRef's printing behavior)
 - #66766 (Panic machinery comments and tweaks)
 - #66791 (Handle GlobalCtxt directly from librustc_interface query system)
 - #66793 (Record temporary static references in generator witnesses)
 - #66808 (Cleanup error code)
 - #66826 (Clarifies how to tag users for assigning PRs)
 - #66837 (Clarify `{f32,f64}::EPSILON` docs)
 - #66844 (Miri: do not consider memory allocated by caller_location leaked)
 - #66872 (Minor documentation fix)

Failed merges:

r? @ghost
2019-11-29 22:00:28 +00:00
Ralf Jung
0b1b36ccb6
Rollup merge of #66872 - Mikotochan:patch-1, r=jonas-schievink
Minor documentation fix

Fixed the documentation for any as is a trait rather than a type.
2019-11-29 22:57:44 +01:00
Ralf Jung
0f6745d6e2
Rollup merge of #66844 - RalfJung:caller-location-leak, r=oli-obk
Miri: do not consider memory allocated by caller_location leaked

Fixes https://github.com/rust-lang/miri/issues/1071

r? @oli-obk

I am not sure if this is the best approach, but it certainly is the easiest.
2019-11-29 22:57:42 +01:00
Ralf Jung
395937823c
Rollup merge of #66837 - ohadravid:epsilon-doc, r=dtolnay
Clarify `{f32,f64}::EPSILON` docs

The doc for `EPSILON` says:
>  This is the difference between `1.0` and the next **largest** representable number.

Which is a bit unclear.

[Wikipedia](https://en.wikipedia.org/wiki/Machine_epsilon) says
> Machine epsilon is defined as the difference between 1 and the next **larger** floating point number

So this PR update the docs to match the Wikipedia version.

The original PR also has this in a [comment](https://github.com/rust-lang/rust/pull/50919#discussion_r192600209).
2019-11-29 22:57:41 +01:00
Ralf Jung
5c90811814
Rollup merge of #66826 - mlodato517:mlodato517-clarify-pr-message-assigner, r=Dylan-DPC
Clarifies how to tag users for assigning PRs

Clarifies language of where to put `r?` text to assign a particular user. Mostly a follow up of [this discussion](https://github.com/rust-lang/rust/pull/66797#issuecomment-559153444).
2019-11-29 22:57:39 +01:00
Ralf Jung
0f6e6363fc
Rollup merge of #66808 - GuillaumeGomez:cleanup-err-code-3, r=Dylan-DPC
Cleanup error code

r? @Dylan-DPC
2019-11-29 22:57:38 +01:00
Ralf Jung
37c1f52b43
Rollup merge of #66793 - matthewjasper:record-static-refs, r=cramertj
Record temporary static references in generator witnesses

Closes #66695

* Record the pointer to static's type in MIR.
* Normalize the static's type (so that constants can be compared correctly).
2019-11-29 22:57:36 +01:00
Ralf Jung
6ea1df2340
Rollup merge of #66791 - cjgillot:arena, r=Mark-Simulacrum
Handle GlobalCtxt directly from librustc_interface query system

This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface.
This simplifies the code to construct it, at the expense of added complexity in the query control flow.
This allows to handle the arenas directly from librustc_interface.

Based on #66707

r? @Zoxc
2019-11-29 22:57:34 +01:00
Ralf Jung
56203be06f
Rollup merge of #66766 - RalfJung:panic-comments, r=SimonSapin
Panic machinery comments and tweaks

This is mostly more comments, but I also renamed some things:
* `BoxMeUp::box_me_up` is not terribly descriptive, and since this is a "take"-style method (the argument is `&mut self` but the return type is fully owned, even though you can't tell from the type) I chose a name involving "take".
* `continue_panic_fmt` was very confusing as it was entirely unclear what was being continued -- for some time I thought "continue" might be the same as "resume" for a panic, but that's something entirely different. So I renamed this to `begin_panic_handler`, matching the `begin_panic*` theme of the other entry points.

r? @Dylan-DPC @SimonSapin
2019-11-29 22:57:33 +01:00
Ralf Jung
64efc45bb9
Rollup merge of #66613 - Areredify:trait-ref-print, r=eddyb
Allow customising ty::TraitRef's printing behavior

This pr allows to explicitly choose which representation of `TraitRef` (`<T as Trait<U>>` or `Trait<U>`) you want to print. `Debug` and `Display` representations of `TraitRef` now match.

Closes #59188.
2019-11-29 22:57:31 +01:00
Ralf Jung
7b75a360f6
Rollup merge of #66589 - TheSamsa:master, r=Dylan-DPC
Draw vertical lines correctly in compiler error messages

... with multiline annotations correctly when non-1space unicode characters are to the left

For this we use the correct calculation of the 'left' identation

closes #66552
2019-11-29 22:57:30 +01:00
Ralf Jung
764ef8c81f
Rollup merge of #66379 - CreepySkeleton:patch-1, r=RalfJung
Rephrase docs in for ptr

These methods can be supplied with NULL just fine, this is the whole point of `Option<&T>` return type.
2019-11-29 22:57:28 +01:00
Ralf Jung
f621c252ec really_init cmdline args on Miri 2019-11-29 20:07:55 +01:00
Mikotochan
26e5fd4c96
Minor documentation fix
Fixed the documentation for any as is a trait rather than a type.
2019-11-29 20:47:16 +02:00
bors
25d8a9494c Auto merge of #66321 - ninjasource:async-fn-resume-after-completion, r=oli-obk
Async fn resume after completion

#65419 -- Attempting to run an async fn after completion mentions generators
Not yet ready for review - work in progress
Just need to run the tests on a proper build server
2019-11-29 18:11:33 +00:00
David Haig
851492c372 Ignore wasm for panic tests 2019-11-29 15:37:46 +00:00
bors
d99e0c6d02 Auto merge of #66697 - petrochenkov:nocstore, r=eddyb
rustc_metadata: Privatize more things and a couple of other refactorings

This PR continues https://github.com/rust-lang/rust/pull/66496 and hits the point of diminishing returns.
All fields of `CrateRoot` and `CrateMetadata` are privatized.
For read-only fields this certainly makes sense, but for a few fields updateable from outside of `rmeta.rs` (mostly `creader.rs`) it was done mostly for consistency, I can make them `pub(crate)` again if requested.

`cstore.rs` (which became small after #66496) was merged into `creader.rs`.

A few things noticed while making the privacy changes were addressed in the remaining refactoring commits.

Fixes https://github.com/rust-lang/rust/issues/66550
r? @eddyb @Mark-Simulacrum
2019-11-29 14:51:59 +00:00
Mikhail Babenko
f07bd06137 allow customising ty::TraitRef's printing behavior
fix clippy

allow customising ty::TraitRef's printing behavior

fix clippy

stylistic fix
2019-11-29 17:30:21 +03:00
bors
c4375c9dfd Auto merge of #66645 - RalfJung:dereferenceable, r=pnkfelix
remove the 'dereferenceable' attribute from Box

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

r? @eddyb @rkruppe
2019-11-29 11:35:03 +00:00
bors
fe969f4ec6 Auto merge of #66590 - Aaron1011:fix/real-impl-trait-coherence, r=varkor
Apply proper commit from PR #63934

While working on PR #63934, I accidentally reverted to an older version
of the PR while working on a rebase. The PR was then merged, not with
the later, approved changes, but with earlier, unapproved changes.

This PR applies the changes that were *suppoesd* to be mereged in
PR #63934. All of the proper tests appear to have been merged
in PR #63934, so this PR adds no new tests
2019-11-29 08:12:43 +00:00
bors
3907d59bcf Auto merge of #66547 - leo60228:procfs-fallback, r=dtolnay
Fallback to .init_array when no arguments are available on glibc Linux

Linux is one of the only platforms where `std::env::args` doesn't work in a cdylib.
2019-11-29 05:04:51 +00:00
bors
861e96f2e9 Auto merge of #66567 - estebank:suggest-copy, r=Centril
Use structured suggestion when requiring `Copy` constraint in type param
2019-11-29 00:23:23 +00:00
bors
61e1c3d343 Auto merge of #66843 - RalfJung:miri, r=RalfJung
update Miri

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

r? @ghost
2019-11-28 20:39:41 +00:00
Esteban Küber
0f530ecb68 review comments 2019-11-28 12:22:07 -08:00
Esteban Küber
9fb446d472 Deduplicate type param constraint suggestion code 2019-11-28 12:20:28 -08:00
Esteban Küber
02bc412d19 Use structured suggestion when requiring Copy constraint in type param 2019-11-28 12:20:28 -08:00
Aaron Hill
79fcaf8f12
Apply proper commit from PR #63934
While working on PR #63934, I accidentally reverted to an older version
of the PR while working on a rebase. The PR was then merged, not with
the later, approved changes, but with earlier, unapproved changes.

This PR applies the changes that were *suppoesd* to be mereged in
PR #63934. All of the proper tests appear to have been merged
in PR #63934, so this PR adds no new tests

Fixes #66580
2019-11-28 13:52:08 -05:00
Ralf Jung
3048d7e5b5 do not consider memory allocated by caller_location leaked 2019-11-28 19:15:32 +01:00
Vadim Petrochenkov
e84c926d47 rustc: Move some queries to rustc_metadata 2019-11-28 20:59:57 +03:00
Vadim Petrochenkov
e0b329a186 rustc_metadata: Avoid some side effects during speculative crate resolution
Namely, `update_extern_crate`.

Also, stop tracking visited crates in `update_extern_crate`, the rank check does the same thing (prevents visiting dependencies if the rank didn't change), but more precisely.
2019-11-28 20:59:57 +03:00
Vadim Petrochenkov
e4710ade6d rustc_metadata: Pass SVH by value 2019-11-28 20:59:57 +03:00
Vadim Petrochenkov
9be526e8eb rustc_metadata: Move has_global_allocator from session to cstore 2019-11-28 20:59:57 +03:00
Vadim Petrochenkov
4c8105e8b7 rustc_metadata: Privatize some fields and methods of CStore
After it's moved to `creader.rs`
2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
753ce4518e rustc_metadata: Merge cstore.rs into creader.rs 2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
3b1d60a6bc rustc_metadata: Privatize CrateMetadata::root 2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
a9cef4945f rustc_metadata: Privatize all fields of CrateRoot
All of them are read-only
2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
765133ac2e rustc_metadata: Privatize CrateMetadata::dep_kind 2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
32aa58c96b rustc_metadata: Privatize CrateMetadata::source 2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
e2414852b1 rustc_metadata: Privatize CrateMetadata::extern_crate 2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
37304cda63 rustc_metadata: Privatize CrateMetadata::dependencies 2019-11-28 20:59:56 +03:00
Vadim Petrochenkov
0525cf9d68 rustc_metadata: Cleanup generation of crate dependency lists 2019-11-28 20:58:46 +03:00
Ralf Jung
9e940f0277 update Miri 2019-11-28 18:40:05 +01:00
bors
bbb664a99c Auto merge of #66642 - ecstatic-morse:promotion-in-const, r=eddyb
Create promoted MIR fragments for `const` and `static`s

Resolves #65732.

The previous strategy of removing `Drop` and `StorageDead` for promoted locals only worked for rvalue lifetime extension and only if no `loop`s were present. This PR applies the approach currently used for `fn` and `const fn`s to `const` and `statics`.

This may have some performance impacts.

r? @eddyb
2019-11-28 17:30:24 +00:00
bors
f453d1127d Auto merge of #66603 - Nadrieril:fix-65413, r=varkor
Fix #65413

#65413 was due to an oversight in `pat_constructor` that didn't check if a particular const value was maybe a slice/array const.
2019-11-28 14:22:47 +00:00
Ohad Ravid
85a468b8cf Clarify {f32,f64}::EPSILON docs 2019-11-28 13:49:58 +01:00
bors
4752c05af4 Auto merge of #66246 - matthewjasper:simplify-mem-cat, r=pnkfelix
Simplify memory categorization

With AST borrowck gone, mem_categorization can be simplified, a lot.

* `cmt_` is now called `Place`. Most local variable names have been updated to reflect this, but the `cat_*` methods retain their names.
* `MemCategorizationContext` no longer needs a `ScopeTree` and always needs an `InferCtxt`.
* `Place` now uses a similar representation to `mir::Place` with a `Vec` of projections.
* `Upvar` places don't include the implicit environment and capture derefs. These are now handled by `regionck` when needed.
* Various types, methods and variants only used by AST borrowck have been removed.
* `ExprUseVisitor` now lives in `rustc_typeck::expr_use_visitor`.
* `MemCategorizationContext` and `Place` live in `rustc_typeck::mem_categorization`.
* `Place` is re-exported in `rustc_typeck::expr_use_visitor` so that Clippy can access it.

The loss of an error in `issue-4335.rs` is due to a change in capture inference in ill-formed programs. If any projection from a variable is moved from then we capture that variable by move, whether or not the place being moved from allows this.

Closes #66270
2019-11-28 10:36:56 +00:00