Commit graph

129819 commits

Author SHA1 Message Date
Eduard-Mihai Burtescu 0ce4452fce rustc_codegen_llvm: add support for inlined function debuginfo. 2020-10-21 04:43:57 +03:00
Eduard-Mihai Burtescu 737499593d rustc_codegen_llvm: expose DILocation to rustc_codegen_ssa. 2020-10-21 04:43:57 +03:00
Eduard-Mihai Burtescu 88d874de63 rustc_codegen_llvm: avoid converting between DILocation and Value. 2020-10-21 04:43:57 +03:00
Eduard-Mihai Burtescu fa2b381ec8 rustc_codegen_llvm: move DISubprogram creation to a dbg_scope_fn method. 2020-10-21 04:43:57 +03:00
Eduard-Mihai Burtescu 9d57c417fc rustc_codegen_llvm: create DIFiles from just SourceFiles. 2020-10-21 04:43:56 +03:00
Eduard-Mihai Burtescu 2bfb462b58 rustc_mir: don't throw away inlined locals' spans. 2020-10-21 04:43:56 +03:00
Eduard-Mihai Burtescu 387e31c9a7 rustc_mir: properly map scope parent chains into the caller when inlining. 2020-10-21 04:43:56 +03:00
Eduard-Mihai Burtescu 6451b39a25 rustc_mir: support MIR-inlining #[track_caller] functions. 2020-10-21 04:43:56 +03:00
Eduard-Mihai Burtescu fb36440b7a test: ensure #[track_caller] tests also test MIR inlining. 2020-10-21 04:43:56 +03:00
Eduard-Mihai Burtescu 6bc5eafbce rustc_mir: track inlined callees in SourceScopeData. 2020-10-21 04:43:56 +03:00
Eduard-Mihai Burtescu 708fc0b692 rustc_mir: use Instance more in the inliner. 2020-10-21 04:43:55 +03:00
Eduard-Mihai Burtescu 8c942c1511 rustc_mir: rename location: SourceInfo to source_info. 2020-10-21 04:43:55 +03:00
bors 31530e5d13 Auto merge of #78162 - GuillaumeGomez:rollup-6a4qiqu, r=GuillaumeGomez
Rollup of 9 pull requests

Successful merges:

 - #78046 (Add codegen test for issue #73827)
 - #78061 (Optimize const value interning for ZST types)
 - #78070 (we can test std and core panic macros together)
 - #78076 (Move orphan module-name/mod.rs files into module-name.rs files)
 - #78129 (Wrapping intrinsics doc links update.)
 - #78133 (Add some MIR-related regression tests)
 - #78144 (Don't update `entries` in `TypedArena` if T does not need drop)
 - #78145 (Drop unneeded `mut`)
 - #78157 (Remove unused type from librustdoc)

Failed merges:

r? `@ghost`
2020-10-20 21:27:47 +00:00
Guillaume Gomez 1df5346bf2
Rollup merge of #78157 - GuillaumeGomez:remove-unused-type, r=jyn514
Remove unused type from librustdoc

r? @jyn514
2020-10-20 21:46:43 +02:00
Guillaume Gomez 0c2dbb2a18
Rollup merge of #78145 - LingMan:ast_pretty_mut, r=jonas-schievink
Drop unneeded `mut`

These parameters don't get modified.

Note that `trailing_comment` is pub and gets exported from `rustc_ast_pretty`. Is that considered to be a stable API? If yes, and you want to reserve the right to modify `self` in `trailing_comment` in the future, that hunk would need to be dropped.
2020-10-20 21:46:42 +02:00
Guillaume Gomez ad218f9bb9
Rollup merge of #78144 - bugadani:elements-nodrop, r=oli-obk
Don't update `entries` in `TypedArena` if T does not need drop

As far as I can tell, `entries` is only used when dropping `TypedArenaChunk`s and their contents. It is already ignored there, if T is not `mem::needs_drop`, this PR just skips updating it's value.

You can see `TypedArenaChunk` ignoring the entry count in L71. The reasoning is similar to what you can find in `DroplessArena`.

r? @oli-obk
2020-10-20 21:46:40 +02:00
Guillaume Gomez a8a424f4aa
Rollup merge of #78133 - JohnTitor:mir-tests, r=lcnr
Add some MIR-related regression tests

Closes #68841
Closes #75053
Closes #76375
Closes #77911

I think they're fixed by #77306.
2020-10-20 21:46:38 +02:00
Guillaume Gomez adda858356
Rollup merge of #78129 - mbartlett21:patch-1, r=kennytm
Wrapping intrinsics doc links update.

The links in the wrapping intrinsics docs now refer to the `wrapping_*` functions, not the `checked_*` functions.
2020-10-20 21:46:37 +02:00
Guillaume Gomez 01e6019448
Rollup merge of #78076 - est31:orphan_mod, r=Mark-Simulacrum
Move orphan module-name/mod.rs files into module-name.rs files
2020-10-20 21:46:35 +02:00
Guillaume Gomez 6adc989700
Rollup merge of #78070 - RalfJung:const-panic-test, r=oli-obk
we can test std and core panic macros together

r? @oli-obk
2020-10-20 21:46:33 +02:00
Guillaume Gomez 3fea201b11
Rollup merge of #78061 - wesleywiser:opt_zst_const_interning, r=oli-obk
Optimize const value interning for ZST types

Interning can skip any inhabited ZST type in general.

Fixes #68010

r? @oli-obk
2020-10-20 21:46:32 +02:00
Guillaume Gomez 2c1de08624
Rollup merge of #78046 - bugadani:issue-73827, r=nikic
Add codegen test for issue #73827

Closes #73827
2020-10-20 21:46:30 +02:00
Guillaume Gomez f38250403c Remove unused type from librustdoc 2020-10-20 21:44:51 +02:00
bors 981346fc07 Auto merge of #78151 - tmiasko:disable-match-branch-simplification, r=wesleywiser
Disable MatchBranchSimplification

This optimization can result in unsoundness, because it introduces
additional uses of a place holding the discriminant value without
ensuring that it is valid to do so.

Found by validation from #77369 / #78147.
2020-10-20 16:59:23 +00:00
Dániel Buga 2705caed8a Track element count only for types that need drop 2020-10-20 17:01:51 +02:00
LingMan 13f0f49a4e Drop unneeded mut
These parameters don't get modified.
2020-10-20 16:42:51 +02:00
bors 9832374f6e Auto merge of #76893 - lcnr:existential-proj, r=estebank
Improve `skip_binder` usage during FlagComputation

It looks like there was previously a bug around `ExistentialPredicate::Projection` here, don't know how to best trigger that one to add a regression test though.
2020-10-20 08:59:12 +00:00
Yuki Okushi a619865889 Add test for issue-77911 2020-10-20 17:25:21 +09:00
Yuki Okushi af337e87e2 Add test for issue-76375 2020-10-20 17:25:19 +09:00
Yuki Okushi 7d4d64d69f Add test for issue-75053 2020-10-20 17:07:27 +09:00
Yuki Okushi 35b737465c Add test for issue-68841 2020-10-20 17:07:11 +09:00
bors 554633534c Auto merge of #76696 - Aaron1011:tokenstream-avoid-clone, r=petrochenkov
Avoid cloning the contents of a `TokenStream` in a few places
2020-10-20 05:45:08 +00:00
mbartlett21 061cf5363c
Wrapping intrinsics update link
Now refers to `wrapping_*`, not `checked_*` for wrapping intrinsics.
2020-10-20 14:09:01 +10:00
bors c9b52100d5 Auto merge of #78127 - JohnTitor:rollup-p1bxtqq, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #77612 (BTreeMap: test invariants more thoroughly and more readably)
 - #77761 (Assert that pthread mutex initialization succeeded)
 - #77778 ([x.py setup] Allow setting up git hooks from other worktrees)
 - #77838 (const keyword: brief paragraph on 'const fn')
 - #77923 ([net] apply clippy lints)
 - #77931 (Fix false positive for `unused_parens` lint)
 - #77959 (Tweak ui-tests structure)
 - #78105 (change name in .mailmap)
 - #78111 (Trait predicate ambiguities are not always in `Self`)
 - #78121 (Do not ICE on pattern that uses a binding multiple times in generator)

Failed merges:

r? `@ghost`
2020-10-20 03:13:30 +00:00
Yuki Okushi 21df410a62
Rollup merge of #78121 - LeSeulArtichaut:issue-78115, r=tmandry
Do not ICE on pattern that uses a binding multiple times in generator

Fixes #78115.
r? @tmandry
2020-10-20 12:11:13 +09:00
Yuki Okushi 3f1c637db4
Rollup merge of #78111 - SNCPlay42:not-always-self, r=lcnr
Trait predicate ambiguities are not always in `Self`

When reporting ambiguities in trait predicates, the compiler incorrectly assumed the ambiguity was always in the type the trait should be implemented on, and never the generic parameters of the trait. This caused silly suggestions for predicates like `<KnownType as Trait<_>>`, such as giving explicit types to completely unrelated variables that happened to be of type `KnownType`.

This also reverts #73027, which worked around this issue in some cases and does not appear to be necessary any more.

fixes #77982
fixes #78055
2020-10-20 12:11:11 +09:00
Yuki Okushi aebeec7e5a
Rollup merge of #78105 - lcnr:namesNstuff, r=Mark-Simulacrum
change name in .mailmap
2020-10-20 12:11:10 +09:00
Yuki Okushi 587cf84be9
Rollup merge of #77959 - JohnTitor:tweak-test-structure, r=petrochenkov
Tweak ui-tests structure

We have some similar name dirs in ui tests, e.g. `associated-type` and `associated-types` and it can be an issue when we add a test, "which is the right place?". At a glance, it seems they can be merged into one directory so let's merge them to avoid some confusion :)
2020-10-20 12:11:08 +09:00
Yuki Okushi 378ca5e640
Rollup merge of #77931 - aticu:fix_60336, r=petrochenkov
Fix false positive for `unused_parens` lint

Fixes #60336
2020-10-20 12:11:06 +09:00
Yuki Okushi 6df79bf8a8
Rollup merge of #77923 - wcampbell0x2a:cleanup-net-module, r=scottmcm
[net] apply clippy lints

Applied helpful clippy lints to the network std library module.
2020-10-20 12:11:04 +09:00
Yuki Okushi f9db00839e
Rollup merge of #77838 - RalfJung:const-fn, r=kennytm
const keyword: brief paragraph on 'const fn'

`const fn` were mentioned in the title, but called "deterministic functions" which is not their main property (though at least currently it is a consequence of being const-evaluable). This adds a brief paragraph discussing them, also in the hopes of clarifying that they do *not* have any effect on run-time uses.
2020-10-20 12:11:02 +09:00
Yuki Okushi 24907f3507
Rollup merge of #77778 - jyn514:git-hook, r=mark-simulacrum
[x.py setup] Allow setting up git hooks from other worktrees

Closes https://github.com/rust-lang/rust/issues/77684
r? @caass
2020-10-20 12:11:00 +09:00
Yuki Okushi b09ef114bb
Rollup merge of #77761 - tmiasko:pthread-mutex, r=cuviper
Assert that pthread mutex initialization succeeded

If pthread mutex initialization fails, the failure will go unnoticed unless
debug assertions are enabled. Any subsequent use of mutex will also silently
fail, since return values from lock & unlock operations are similarly checked
only through debug assertions.

In some implementations the mutex initialization requires a memory
allocation and so it does fail in practice.

Assert that initialization succeeds to ensure that mutex guarantees
mutual exclusion.

Fixes #34966.
2020-10-20 12:10:58 +09:00
Yuki Okushi c5b0a88669
Rollup merge of #77612 - ssomers:btree_cleanup_2, r=Mark-Simulacrum
BTreeMap: test invariants more thoroughly and more readably

r? @Mark-Simulacrum
2020-10-20 12:10:52 +09:00
Tomasz Miąsko c2af254e3b Disable MatchBranchSimplification
This optimization can result in unsoundness, because it introduces
additional uses of a place holding the discriminant value without
ensuring that it is valid to do so.
2020-10-20 00:00:00 +00:00
Tomasz Miąsko 21c29b1e95 Check that pthread mutex initialization succeeded
If pthread mutex initialization fails, the failure will go unnoticed unless
debug assertions are enabled. Any subsequent use of mutex will also silently
fail, since return values from lock & unlock operations are similarly checked
only through debug assertions.

In some implementations the mutex initialization requires a memory
allocation and so it does fail in practice.

Check that initialization succeeds to ensure that mutex guarantees
mutual exclusion.
2020-10-20 00:00:00 +00:00
LeSeulArtichaut 334c6c5433 Add regression test 2020-10-19 23:34:52 +02:00
LeSeulArtichaut 66ac5a2d63 Do not ICE on pattern that uses a binding multiple times in generator 2020-10-19 23:34:47 +02:00
SNCPlay42 c146e8c54f revert workaround #73027 2020-10-19 21:11:40 +01:00
SNCPlay42 71ca239f80 don't assume trait ambiguity happens in Self 2020-10-19 21:11:40 +01:00