Commit Graph

106369 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
f0eec88581 track_caller test caller_location ctfe/rt equivalence wrt. fnptrs 2020-02-03 16:15:30 +01:00
Guillaume Gomez
46f6dad101 Fix links to types instead of modules 2020-02-03 16:12:35 +01:00
Jonas Schievink
392e59500a Fix miscompilation 2020-02-03 14:08:57 +01:00
bors
bdd946df3a Auto merge of #68665 - eddyb:debuginfo-early-create-var, r=nagisa
codegen: create DIVariables ahead of using them with llvm.dbg.declare.

Instead of having `rustc_codegen_llvm` bundle creation of a `DIVariable` and `llvm.dbg.declare` into a single operation, they are now two separate methods, and the `DIVariable` is created earlier, specifically when `mir::VarDebugInfo`s are being partitioned into locals.

While this isn't currently needed, it's a prerequisite for #48300, which adds fragmented debuginfo, where one `mir::VarDebugInfo` has multiple parts of itself mapped to different `mir::Place`s.
For debuggers to see one composite variable instead of several ones with the same name, we need to create a single `DIVariable` and share it between multiple `llvm.dbg.declare` calls, which are likely pointing to different MIR locals.
That makes the `per_local_var_debug_info` partitioning a good spot to do this in, as we can create *exactly* one `DIVariable` per `mir::VarDebugInfo`, and refer to it as many things as needed.

I'm opening this PR separately because I want to test its perf impact in isolation (see https://github.com/rust-lang/rust/pull/48300#issuecomment-580121438).

r? @nagisa or @oli-obk cc @michaelwoerister @nikomatsakis
2020-02-03 13:06:44 +00:00
Eduard-Mihai Burtescu
e35dfad5b8 rustc_codegen_llvm: avoid redundant calls to span_start. 2020-02-03 12:14:22 +02:00
Eduard-Mihai Burtescu
f4b74773c7 rustc_codegen_ssa: convert mir::VarDebugInfo into a custom PerLocalVarDebugInfo. 2020-02-03 12:14:22 +02:00
Eduard-Mihai Burtescu
0b633c82f0 rustc_codegen_ssa: split declare_local into create_dbg_var and dbg_var_addr. 2020-02-03 12:14:21 +02:00
bors
c58e09f138 Auto merge of #68778 - RalfJung:raw-addr-of, r=eddyb
add raw-addr-of variant to mir_raw_fat_ptr

As suggested at https://github.com/rust-lang/rust/pull/48300#discussion_r372520388

r? @eddyb
2020-02-03 09:54:09 +00:00
bors
0d34a87722 Auto merge of #68772 - matthewjasper:relate-opt, r=davidtwco
Avoid exponential behaviour when relating types

When equating bound types we check subtyping in both directions. Since closures are invariant in their substs, we end up comparing the two types an exponential number of times. If there are no bound variables this isn't needed.

Closes #68061
2020-02-03 06:38:34 +00:00
David
152811d8bf Change expansion error to be non-fatal
Changes the error handler for inner attributes that replace the root
with a non-module. Previously it would emit a fatal error. It now emits
an empty expasion and a non-fatal error like the existing handler for a
failed expansion.
2020-02-02 21:03:38 -08:00
bors
a2e80300cd Auto merge of #68756 - JohnTitor:fix-ice-save-analysis-2, r=davidtwco
Fix ICE with save-analysis

Fixes #68749

It should be fine since it's the same way as `visit_expr`.
2020-02-03 03:28:08 +00:00
Nicholas Nethercote
d62b6f2047 Pull out a special case in merge_from_succ.
This is a small perf win.
2020-02-03 13:34:51 +11:00
Nicholas Nethercote
0eb297d3e0 Fix up merge_from_succ.
This function has a variable `changed` that is erroneously used for two
related-but-different purpose:
- to detect if the current element has changed;
- to detect if any elements have changed.

As a result, its use for the first purpose is broken, because if any
prior element changed then the code always thinks the current element
has changed. This is only a performance bug, not a correctness bug,
because we frequently end up calling `assign_unpacked` unnecessarily to
overwrite the element with itself.

This commit adds `any_changed` to correctly distinguish between the two
purposes. This is a small perf win for some benchmarks.
2020-02-03 13:33:45 +11:00
bors
01db581942 Auto merge of #68735 - JohnTitor:fix-ice-0202, r=estebank
Use `next_point` to avoid ICE

Fixes #68730

r? @estebank (I think you're familiar with that)
2020-02-03 00:04:16 +00:00
Amos Onn
22b263ae18 Optimize core::ptr::align_offset
- As explained in the comment inside mod_inv, it is valid to work mod
  `usize::max_value()` right until the end.
2020-02-03 01:03:33 +01:00
Amos Onn
3173cd1473 Optimize core::ptr::align_offset
- When calculating the inverse, it's enough to work `mod a/g` instead
  of `mod a`.
2020-02-03 01:03:33 +01:00
Amos Onn
e835d0d761 Optimize core::ptr::align_offset
- Stopping condition inside mod_inv can be >= instead of >
- Remove intrinsics::unchecked_rem, we are working modulu powers-of-2 so
we can simply mask
2020-02-03 01:03:33 +01:00
Esteban Küber
b9c125af75 Deal with spans showing std lib
Address #53081
2020-02-02 13:51:23 -08:00
Esteban Küber
865216b3ad Point at reason in object unsafe trait with Self in supertraits or where-clause 2020-02-02 13:45:41 -08:00
Esteban Küber
16d935e725 fix rebase 2020-02-02 12:50:07 -08:00
bors
8f49d46297 Auto merge of #68720 - wesleywiser:llvm_time_trace, r=davidtwco
Add support for enabling the LLVM time-trace feature

I found this helpful while investigating an LLVM performance issue.
Passing `-Z llvm-time-trace` causes a `llvm_timings.json` file to be
created. This file can be inspected in with the Chrome Profiler
tools or with any other compatible tool like SpeedScope.

More information on the LLVM feature:

- https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler-for-Clang/

- https://reviews.llvm.org/rL357340
2020-02-02 20:33:47 +00:00
Esteban Küber
342db717e2 Account for ?Sized type parameter bounds 2020-02-02 11:53:10 -08:00
Esteban Küber
d216b731f6 Remove duplicated code 2020-02-02 11:53:10 -08:00
Esteban Küber
cb6dfeaf61 Suggest ?Sized on type parameters 2020-02-02 11:53:10 -08:00
Esteban Küber
542130bde9 add tests for structured suggestion 2020-02-02 11:53:10 -08:00
Esteban Küber
a52ec87a17 Use more appropriate spans on object unsafe traits and provide structured suggestions when possible 2020-02-02 11:53:10 -08:00
Esteban Küber
413bfa4b98 Wording changes to object unsafe trait errors
Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920
2020-02-02 11:53:10 -08:00
Esteban Küber
3ca1c5d5b5 Point at Sized requirements
Make #47990 easier to understand
2020-02-02 11:53:10 -08:00
Esteban Küber
06fea92356 review comments 2020-02-02 11:53:10 -08:00
Esteban Küber
132921bc52 Remove duplicated code 2020-02-02 11:53:10 -08:00
Esteban Küber
144e259445 Slight rewording of diagnostic message 2020-02-02 11:53:10 -08:00
Esteban Küber
6870f79e9c Use more accurate failed predicate spans 2020-02-02 11:53:09 -08:00
Esteban Küber
8d48597b76 Point at return type obligations instead of at fn ident 2020-02-02 11:52:34 -08:00
Esteban Küber
972ae5afe5 Point at the Sized obligation in where clauses 2020-02-02 11:52:34 -08:00
Esteban Küber
4b2f1db6e4 Tweak Self: Sized restriction diagnostic output 2020-02-02 11:52:34 -08:00
Esteban Küber
d137b7ac11 review comments 2020-02-02 11:52:34 -08:00
Esteban Küber
0eb29d1a44 fix test 2020-02-02 11:52:34 -08:00
Esteban Küber
d72bcdb42c When object unsafe trait uses itself in associated item suggest using Self 2020-02-02 11:52:34 -08:00
Esteban Küber
1c9242f83f Point at Sized bound 2020-02-02 11:52:34 -08:00
Esteban Küber
fca5c64abd Point at arguments or output when fn obligations come from them, or ident when they don't 2020-02-02 11:52:33 -08:00
Ralf Jung
ee60158440 add raw-addr-of variant to mir_raw_fat_ptr 2020-02-02 20:51:24 +01:00
bors
f43c34a134 Auto merge of #68774 - RalfJung:miri, r=RalfJung
bump Miri

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

Cc @oli-obk r? @ghost
2020-02-02 16:58:49 +00:00
Guillaume Gomez
019ca55b45
Clean up E0263 explanation 2020-02-02 15:28:18 +01:00
Ralf Jung
8c5bec103f bump Miri 2020-02-02 14:51:30 +01:00
bors
994e5e7465 Auto merge of #68771 - Centril:rollup-zllcup9, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #68733 (Update option.rs)
 - #68760 (Issue error on `compile-fail` header in UI test)
 - #68763 (Do not suggest duplicate bounds)
 - #68764 (parser: syntactically allow `self` in all `fn` contexts)
 - #68769 (parser: avoid re-wrapping NtItem)

Failed merges:

r? @ghost
2020-02-02 13:16:43 +00:00
Mazdak Farrokhzad
011fb23c58
Rollup merge of #68769 - Centril:unwrap, r=petrochenkov
parser: avoid re-wrapping NtItem

r? @petrochenkov
2020-02-02 14:15:53 +01:00
Mazdak Farrokhzad
5951cd3dda
Rollup merge of #68764 - Centril:self-semantic, r=petrochenkov
parser: syntactically allow `self` in all `fn` contexts

Part of https://github.com/rust-lang/rust/pull/68728.

`self` parameters are now *syntactically* allowed as the first parameter irrespective of item context (and in function pointers). Instead, semantic validation (`ast_validation`) is used.

r? @petrochenkov
2020-02-02 14:15:52 +01:00
Mazdak Farrokhzad
2e1790dda1
Rollup merge of #68763 - JohnTitor:do-not-sugg-dup-bounds, r=estebank
Do not suggest duplicate bounds

Fixes #68205
Fixes #68695

r? @estebank
2020-02-02 14:15:51 +01:00
Mazdak Farrokhzad
3a7f1edd81
Rollup merge of #68760 - Tyg13:compile_fail_ui_test, r=Centril
Issue error on `compile-fail` header in UI test

Fixes #68732

r? @Centril
2020-02-02 14:15:49 +01:00
Mazdak Farrokhzad
f2cc0cc09d
Rollup merge of #68733 - cata0309:patch-1, r=Dylan-DPC
Update option.rs

I updated the example of the `expect` examples so they won't contain depressing sentences any more !
2020-02-02 14:15:48 +01:00