Commit graph

140520 commits

Author SHA1 Message Date
Tomasz Miąsko
5a9538acb5 Functions inlined into reachable functions are reachable
Consider functions to be reachable for code coverage purposes, either
when they reach the code generation directly, or indirectly as inlined
part of another function.
2021-03-15 23:26:03 +01:00
Tomasz Miąsko
1796cc0e6c Make source-based code coverage compatible with MIR inlining
When codegenning code coverage use the instance that coverage data was
originally generated for, to ensure basic level of compatibility with
MIR inlining.
2021-03-15 23:26:03 +01:00
Vadim Petrochenkov
e98b7d1bcf Update clippy tests 2021-03-16 00:12:38 +03:00
Soveu
96d6f22a8e
Merge branch 'master' into dedup 2021-03-15 21:51:38 +01:00
Soveu
2285f11724 Vec::dedup optimization - add test for panic 2021-03-15 21:26:22 +01:00
Aaron Hill
d6a7c1d47f
Extend proc_macro_back_compat lint to procedural-masquerade
We now lint on *any* use of `procedural-masquerade` crate. While this
crate still exists, its main reverse dependency (`cssparser`) no longer
depends on it. Any crates still depending off should stop doing so, as
it only exists to support very old Rust versions.

If a crate actually needs to support old versions of rustc via
`procedural-masquerade`, then they'll just need to accept the warning
until we remove it entirely (at the same time as the back-compat hack).
The latest version of `procedural-masquerade` does not work with the
latest rustc, but trying to check for the version seems like more
trouble than it's worth.

While working on this, I realized that the `proc-macro-hack` check was
never actually doing anything. The corresponding enum variant in
`proc-macro-hack` is named `Value` or `Nested` - it has never been
called `Input`. Due to a strange Crater issue, the Crater run that
tested adding this did *not* end up testing it - some of the crates that
would have failed did not actually have their tests checked, making it
seem as though the `proc-macro-hack` check was working.

The Crater issue is being discussed at
https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Nearly.20identical.20Crater.20runs.20processed.20a.20crate.20differently/near/230406661

Despite the `proc-macro-hack` check not actually doing anything, we
haven't gotten any reports from users about their build being broken.
I went ahead and removed it entirely, since it's clear that no one is
being affected by the `proc-macro-hack` regression in practice.
2021-03-15 16:00:49 -04:00
Albin Hedman
db9a53b5d7
Constify mem::transmute_copy 2021-03-15 20:45:57 +01:00
Albin Hedman
45988ee438
Constify mem::replace and ptr::replace 2021-03-15 20:45:43 +01:00
Albin Hedman
64e2248794
Constify mem::swap and ptr::swap[_nonoverlapping] 2021-03-15 20:45:22 +01:00
Albin Hedman
62cf244563
Constify copy_to and copy_from 2021-03-15 20:45:20 +01:00
Soveu
afdbc9ece1 Vec::dedup optimization - finishing polishes 2021-03-15 20:36:29 +01:00
Soveu
2abab1f688 Vec::dedup optimization - add tests 2021-03-15 20:24:35 +01:00
Mara Bos
924e522d16 Deprecate RustcEncodable and RustcDecodable. 2021-03-15 20:16:16 +01:00
Julian Frimmel
ff8717b56d Specify *.woff2 files as binary
This prevents older git versions to change the "line endings".
2021-03-15 20:14:56 +01:00
Vadim Petrochenkov
7e66e9d6b0 More precise spans for HIR paths 2021-03-15 22:13:45 +03:00
Michael Howell
dcba95f43e Declare word outside the loop, as recommended by eslint 2021-03-15 11:58:34 -07:00
Oli Scherer
e67594166e Run tests in nll mode 2021-03-15 18:35:47 +00:00
bors
107896c32d Auto merge of #83121 - the8472:env-rwlock-2, r=joshtriplett
use RWlock when accessing os::env (take 2)

This reverts commit acdca316c3 (#82877) i.e. redoes #81850 since the invalid unlock attempts in the child process have been fixed in #82949

r? `@joshtriplett`
2021-03-15 18:32:10 +00:00
Oli Scherer
c2683aa569 Explain each variant of TAIT usage with examples 2021-03-15 17:39:18 +00:00
Oli Scherer
6109d73112 🍼 for tidy 2021-03-15 17:39:13 +00:00
Oli Scherer
4a6dc8e203 Only allow tait defining uses in function and method return position 2021-03-15 17:36:57 +00:00
Simonas Kazlauskas
9aa48ba13b No background for code in portability snippets
This better matches the appearance of this kind of snippet in the full
item view and is less jarring to read due to repeated
foreground-background changes.
2021-03-15 19:36:27 +02:00
Oli Scherer
cdbb0ff8ca Special case type aliases from impl trait in const/static types 2021-03-15 17:33:28 +00:00
Oli Scherer
3abdb08351 Add a test showing how impl_trait_in_bindings is a breaking change 2021-03-15 17:33:20 +00:00
Oli Scherer
1f7df1956a Replace type_alias_impl_trait by min_type_alias_impl_trait with no actual changes in behaviour
This makes `type_alias_impl_trait` not actually do anything anymore
2021-03-15 17:32:43 +00:00
Simonas Kazlauskas
7134b0ee67 Fall-back to sans-serif if Arial is not available
Otherwise on systems where Arial is not available the system will
fallback to a serif font, rather than a sans-serif one.

This is especially relevant on acessibility-conscious setups (such as is
mine) that have web-fonts disabled and a limited set of fonts available
on the system.
2021-03-15 19:22:15 +02:00
Roxane
189d206522 Fix error after rebase 2021-03-15 13:16:18 -04:00
Roxane
22eaffe71a Add comments with examples and tests 2021-03-15 13:16:04 -04:00
Oli Scherer
19dce738f9 Delete non-revision ui test output file if revisions are used 2021-03-15 16:56:19 +00:00
Oli Scherer
5553301137 Make regression test succeed as long as it ICEs 2021-03-15 16:56:12 +00:00
Oli Scherer
f261a82a8d Use tracing instrumentation for better bug diagnosing 2021-03-15 16:53:05 +00:00
Oli Scherer
327cc62b0d Add reproduction test 2021-03-15 16:46:45 +00:00
Aaron Hill
e70d47b3b5
Mark extern_mod_stmt_cnum as eval_always
This query reads from global untracked state, so it always needs to be
evaluated.
2021-03-15 12:26:49 -04:00
bors
2ccf06302c Auto merge of #83149 - Dylan-DPC:rollup-ov70c5v, r=Dylan-DPC
Rollup of 10 pull requests

Successful merges:

 - #82989 (Custom error on literal names from other languages)
 - #83054 (Validate rustc_layout_scalar_valid_range_{start,end} attributes)
 - #83098 (Find more invalid doc attributes)
 - #83108 (Remove unused `opt_local_def_id_to_hir_id` function)
 - #83110 (Fix typos in `library/core/src/ptr/mod.rs` and `library/std/src/sys_common/thread_local_dtor.rs`)
 - #83113 (Minor refactoring in try_index_step)
 - #83127 (Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl`)
 - #83132 (Don't encode file information for span with a dummy location)
 - #83141 (⬆️ rust-analyzer)
 - #83144 (Introduce `rustc_interface::interface::Config::parse_sess_created` callback)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-03-15 15:24:54 +00:00
Dylan DPC
2816c110e0
Rollup merge of #83144 - hyd-dev:parse-sess-created, r=oli-obk
Introduce `rustc_interface::interface::Config::parse_sess_created` callback

Resolves #82900.

cc `@oli-obk`
2021-03-15 16:23:00 +01:00
Dylan DPC
13eac5b236
Rollup merge of #83141 - lnicola:rust-analyzer-2021-03-15, r=jonas-schievink
⬆️ rust-analyzer
2021-03-15 16:22:59 +01:00
Dylan DPC
9b16c7a712
Rollup merge of #83132 - Aaron1011:fix/incr-cache-dummy, r=estebank
Don't encode file information for span with a dummy location

Fixes #83112

The location information for a dummy span isn't real, so don't encode
it. This brings the incr comp cache code into line with the Span
`StableHash` impl, which doesn't hash the location information for dummy
spans.

Previously, we would attempt to load the 'original' file from a dummy
span - if the file id changed (e.g. due to being moved on disk), we would get an
ICE, since the Span was still valid due to its hash being unchanged.
2021-03-15 16:22:58 +01:00
Dylan DPC
d1f5f1d156
Rollup merge of #83127 - Aaron1011:time-macros-impl-warn, r=petrochenkov
Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl`

Now that future-incompat-report support has landed in nightly Cargo, we
can start to make progress towards removing the various proc-macro
back-compat hacks that have accumulated in the compiler.

This PR introduces a new lint `proc_macro_back_compat`, which results in
a future-incompat-report entry being generated. All proc-macro
back-compat warnings will be grouped under this lint. Note that this
lint will never actually become a hard error - instead, we will remove
the special cases for various macros, which will cause older versions of
those crates to emit some other error.

I've added code to fire this lint for the `time-macros-impl` case. This
is the easiest case out of all of our current back-compat hacks - the
crate was renamed to `time-macros`, so seeing a filename with
`time-macros-impl` guarantees that an older version of the parent `time`
crate is in use.

When Cargo's future-incompat-report feature gets stabilized, affected
users will start to see future-incompat warnings when they build their
crates.
2021-03-15 16:22:57 +01:00
Dylan DPC
8ec9b2a0ac
Rollup merge of #83113 - osa1:refactor_try_index_step, r=jonas-schievink
Minor refactoring in try_index_step

Merges `if-let` and `if x.is_some() { ... }` blocks
2021-03-15 16:22:56 +01:00
Dylan DPC
194472c9e3
Rollup merge of #83110 - hyksm:fix-typo, r=jonas-schievink
Fix typos in `library/core/src/ptr/mod.rs` and `library/std/src/sys_common/thread_local_dtor.rs`

adress -> address
2021-03-15 16:22:55 +01:00
Dylan DPC
f1061d1dff
Rollup merge of #83108 - jyn514:remove-unused, r=estebank
Remove unused `opt_local_def_id_to_hir_id` function

Found while investigating #82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
2021-03-15 16:22:53 +01:00
Dylan DPC
75a15bf275
Rollup merge of #83098 - camelid:more-doc-attr-check, r=davidtwco
Find more invalid doc attributes

- Lint on `#[doc(123)]`, `#[doc("hello")]`, etc.
- Lint every attribute; e.g., will now report two warnings for `#[doc(foo, bar)]`
- Add hyphen to "crate level"
- Display paths like `#[doc(foo::bar)]` correctly instead of as an empty string
2021-03-15 16:22:52 +01:00
Dylan DPC
b8622f2b3b
Rollup merge of #83054 - tmiasko:rustc_layout_scalar_valid_range, r=davidtwco
Validate rustc_layout_scalar_valid_range_{start,end} attributes

Fixes #82251, fixes #82981.
2021-03-15 16:22:51 +01:00
Dylan DPC
4eca4929ec
Rollup merge of #82989 - Smittyvb:other-lang-literal-errors, r=varkor
Custom error on literal names from other languages

This detects all Java literal types and all single word C data types, and suggests the corresponding Rust literal type.
2021-03-15 16:22:50 +01:00
hyd-dev
0bbfd548ec
Fix src/test/run-make-fulldeps/issue-19371 2021-03-15 21:16:39 +08:00
hyd-dev
4709dcd476
Change the .unwrap to .expect with a helpful message 2021-03-15 20:45:45 +08:00
Oli Scherer
1ffd21a15c Pacify tidy 2021-03-15 12:19:29 +00:00
Smitty
5eae9af193 Custom error on literal names from other languages
This detects all Java literal types and all single word C data types,
and suggests the corresponding Rust literal type.
2021-03-15 08:11:02 -04:00
Oli Scherer
9f407ae5ee Do not expose fallible to_int operation on Scalar.
Any use of it has been shown to be a bug in the past.
2021-03-15 12:06:52 +00:00
Oli Scherer
0dd5a1b622 Explain pointer and dyn Trait handling in const_to_valtree 2021-03-15 12:06:52 +00:00