Commit Graph

195979 Commits

Author SHA1 Message Date
bors
ffa77332c6 Auto merge of #99598 - GuillaumeGomez:clean-trait-fields-on-demand, r=notriddle
Make some clean::Trait fields computation on demand

r? `@notriddle`
2022-07-22 16:52:10 +00:00
Ralf Jung
2564a080d8 update Miri 2022-07-22 12:18:52 -04:00
Ralf Jung
77be253c9b cargotest: do not run quickcheck tests in xsv 2022-07-22 11:51:44 -04:00
bors
7e30ca1f2a Auto merge of #12844 - Veykril:highlight-attr, r=Veykril
fix: Improve syntax highlighting in attributes

Fixes https://github.com/rust-lang/rust-analyzer/issues/12842
2022-07-22 15:31:32 +00:00
Lukas Wirth
1ab862a628 fix: Improve syntax highlighting in attributes 2022-07-22 17:29:03 +02:00
Tomasz Miąsko
e497fb19b0 Outline SubstFolder bug reporting code paths
Bug reporting macro `span_bug!` generates quite a bit of code,
we don't expect to execute. Outline it into a separate function.
2022-07-22 17:00:49 +02:00
Tomasz Miąsko
880bde0ced Inline SubstFolder::tcx 2022-07-22 17:00:49 +02:00
Tomasz Miąsko
0e6251dcde Inline Predicate::has_vars_bound_at_or_above 2022-07-22 17:00:49 +02:00
Tomasz Miąsko
bb73f171e5 Inline DebruijnIndex methods 2022-07-22 17:00:49 +02:00
Ralf Jung
19e29e9a57 interpret: fix vtable check debug assertion 2022-07-22 10:37:03 -04:00
ouz-a
447aaceed7 has_deref: simpler comparison, ty fix 2022-07-22 17:35:28 +03:00
ouz-a
c3e1e7a947 simplify more, ret_deref -> has_deref 2022-07-22 17:35:26 +03:00
ouz-a
c0e4230bf5 simplify some code that depend on Deref 2022-07-22 17:32:50 +03:00
bors
22d25f21dc Auto merge of #99521 - fee1-dead-contrib:const_fix_hax, r=oli-obk
Fix hack that remaps env constness.

WARNING: might have perf implications.

Are there any more problems with having a constness in the `ParamEnv` now? :)

r? `@oli-obk`
2022-07-22 12:48:29 +00:00
Ralf Jung
ae22ae1358 miri: make --stage 0 testing work 2022-07-22 08:33:35 -04:00
bors
cb8a3be2a1 Auto merge of #12835 - fasterthanlime:sysroot-abi, r=fasterthanlime
Introduce proc-macro-srv/sysroot-abi

Still a WIP.

This change is tracked by:

  * https://github.com/rust-lang/rust-analyzer/issues/12818
2022-07-22 12:28:27 +00:00
Guillaume Gomez
edb9add193 Make some clean::Trait fields computation on demand 2022-07-22 14:26:05 +02:00
Amos Wenger
e591ff3269 Add comment about replacing crossbeam with std scoped threads when they land 2022-07-22 14:23:36 +02:00
bors
41419e7036 Auto merge of #99491 - workingjubilee:sync-psimd, r=workingjubilee
Sync in portable-simd subtree

r? `@ghost`
2022-07-22 09:48:00 +00:00
Nikita Popov
7514610219 Mark atomics as unsupported on thumbv6m
The thumbv6m target does not support atomics. Historically, LLVM
had a bug where atomic load/stores for this target were emitted
as plain load/stores rather than as libatomic calls. This was
fixed in https://reviews.llvm.org/D120026, which will be part of
LLVM 15. As we require that "atomic support" does not use libatomic,
we need to indicate that this target does not have native atomics.
2022-07-22 10:54:39 +02:00
bors
e7a9c11416 Auto merge of #99592 - Dylan-DPC:rollup-xlw4wax, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #98174 (Rename `<*{mut,const} T>::as_{const,mut}` to `cast_`)
 - #98868 (Fix unreachable coverage generation for inlined functions)
 - #99393 (feat: omit suffixes in const generics (e.g. `1_i32`))
 - #99423 (Group CSS font rule)
 - #99539 (Improve suggestions for returning binding)
 - #99579 (Add same warning to Result::expect as Result::unwrap)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-22 07:12:19 +00:00
Dylan DPC
5df3b98321
Rollup merge of #99579 - CleanCut:expect-warning, r=joshtriplett
Add same warning to Result::expect as Result::unwrap

I was reading a recent blog post by Jimmy Hartzell and [he noted](https://www.thecodedmessage.com/posts/2022-07-14-programming-unwrap/#context):

> I will however note that the documentation of `unwrap` comes with [a warning not to use it](https://doc.rust-lang.org/std/result/enum.Result.html#method.unwrap). The warning is framed in terms of the fact that `unwrap` may panic, but the [documentation of `expect`](https://doc.rust-lang.org/std/result/enum.Result.html#method.expect), where this is equally true, does not come with such a warning.

It _is_ equally true. Let's add the same warning to `expect`. This PR is a copy-and-paste of the warning text from the docstring for `unwrap`.
2022-07-22 11:53:43 +05:30
Dylan DPC
92bebac0b9
Rollup merge of #99539 - compiler-errors:bidirectional-block-suggestions, r=fee1-dead
Improve suggestions for returning binding

Fixes #99525

Also reworks the cause codes for match and if a bit, I think cleaning them up in a positive way.
We no longer need to call `could_remove_semicolon` in successful code, which might save a few cycles?
2022-07-22 11:53:42 +05:30
Dylan DPC
aec458b54f
Rollup merge of #99423 - GuillaumeGomez:group-css-font-rule, r=notriddle
Group CSS font rule

Another CSS cleanup I came by when working on something else.

r? ``@notriddle``
2022-07-22 11:53:41 +05:30
Dylan DPC
449ffe0bd5
Rollup merge of #99393 - Logarithmus:feature/99255-omit-const-generic-suffixes, r=petrochenkov
feat: omit suffixes in const generics (e.g. `1_i32`)

Closes #99255
2022-07-22 11:53:40 +05:30
Dylan DPC
6e3dd69e36
Rollup merge of #98868 - tmiasko:unreachable-coverage, r=wesleywiser
Fix unreachable coverage generation for inlined functions

To generate a function coverage we need at least one coverage counter,
so a coverage from unreachable blocks is retained only when some live
counters remain.

The previous implementation incorrectly retained unreachable coverage,
because it didn't account for the fact that those live counters can
belong to another function due to inlining.

Fixes #98833.
2022-07-22 11:53:40 +05:30
Dylan DPC
ad31d5c6a5
Rollup merge of #98174 - Kixunil:rename_ptr_as_mut_const_to_cast, r=scottmcm
Rename `<*{mut,const} T>::as_{const,mut}` to `cast_`

This renames the methods to use the `cast_` prefix instead of `as_` to
make it more readable and avoid confusion with `<*mut T>::as_mut()`
which is `unsafe` and returns a reference.

Sorry, didn't notice ACP process exists, opened https://github.com/rust-lang/libs-team/issues/51

See #92675
2022-07-22 11:53:39 +05:30
Eric Huss
d2cd32c7da Update books 2022-07-21 20:41:44 -07:00
León Orell Valerian Liehr
c98399f5eb Don't suggest unnameable generic arguments 2022-07-22 04:55:31 +02:00
bors
aa01891700 Auto merge of #99420 - RalfJung:vtable, r=oli-obk
make vtable pointers entirely opaque

This implements the scheme discussed in https://github.com/rust-lang/unsafe-code-guidelines/issues/338: vtable pointers should be considered entirely opaque and not even readable by Rust code, similar to function pointers.

- We have a new kind of `GlobalAlloc` that symbolically refers to a vtable.
- Miri uses that kind of allocation when generating a vtable.
- The codegen backends, upon encountering such an allocation, call `vtable_allocation` to obtain an actually dataful allocation for this vtable.
- We need new intrinsics to obtain the size and align from a vtable (for some `ptr::metadata` APIs), since direct accesses are UB now.

I had to touch quite a bit of code that I am not very familiar with, so some of this might not make much sense...
r? `@oli-obk`
2022-07-22 01:33:49 +00:00
Nathan Stocks
7ba0be832a add same warning to Result::expect as Result::unwrap 2022-07-21 18:15:24 -06:00
bors
31b9b012bb Auto merge of #99530 - RalfJung:miri, r=oli-obk
update Miri

Fixes https://github.com/rust-lang/rust/issues/99461
r? `@oli-obk` because of lockfile changes (seems like serde is getting implicitly bumped)
2022-07-21 22:24:06 +00:00
Ralf Jung
c2df1c21f8 update Miri 2022-07-21 16:04:37 -04:00
klensy
b38c94857d avoid embedding StabilityLevel::Unstable reason string into metadata multiple times 2022-07-21 22:53:02 +03:00
bors
62b272d25c Auto merge of #99501 - lcnr:check-regions-infcx, r=oli-obk
move `considering_regions` to the infcx

it seems weird to prove some obligations which constrain inference vars while ignoring regions  in a context which considers regions. This is especially weird because even for a fulfillment context with ignored regions, we still added region outlives bounds when directly relating regions.

tbh our handling of regions is still very weird, but at least this is a step in the right direction imo.

r? rust-lang/types
2022-07-21 19:43:21 +00:00
Amos Wenger
39db9cdb7d Use std::panic::resume_unwind 2022-07-21 21:35:15 +02:00
Amos Wenger
48bcc229bf Move interner methods to Symbol, return SmolStr directly since it's ref-counted 2022-07-21 21:32:46 +02:00
Amos Wenger
246947b779 Fix raw ident handling (a little) 2022-07-21 19:13:44 +02:00
bors
af7ab34470 Auto merge of #99567 - matthiaskrgr:rollup-08hh3r4, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #98707 (std: use futex-based locks on Fuchsia)
 - #99413 (Add `PhantomData` marker for dropck to `BTreeMap`)
 - #99454 (Add map_continue and continue_value combinators to ControlFlow)
 - #99523 (Fix the stable version of `AsFd for Arc<T>` and `Box<T>`)
 - #99526 (Normalize the arg spans to be within the call span)
 - #99528 (couple of clippy::perf fixes)
 - #99549 (Add regression test for #52304)
 - #99552 (Rewrite `orphan_check_trait_ref` to use a `TypeVisitor`)
 - #99557 (Edit `rustc_index::vec::IndexVec::pick3_mut` docs)
 - #99558 (Fix `remap_constness`)
 - #99559 (Remove unused field in ItemKind::KeywordItem)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-21 17:02:31 +00:00
Amos Wenger
941416a1d6 Add test for idents incl. raw idents 2022-07-21 18:48:19 +02:00
Amos Wenger
9cf99a9c71 Stringify literals create client-side properly 2022-07-21 18:44:41 +02:00
Michael Goulet
3eef023da0 Address more nits 2022-07-21 16:43:10 +00:00
Matthias Krüger
af64d93dbb
Rollup merge of #99559 - GuillaumeGomez:rm-unused-field-keyword, r=notriddle
Remove unused field in ItemKind::KeywordItem

For the keyword name, we use `Item::name` directly everywhere so there is no point into keeping it.

r? ``@notriddle``
2022-07-21 18:42:12 +02:00
Matthias Krüger
b068dc7392
Rollup merge of #99558 - fee1-dead-contrib:remap_constness_fix, r=oli-obk
Fix `remap_constness`

`~const Drop` was renamed to `~const Destruct` and this special case should
be removed
2022-07-21 18:42:11 +02:00
Matthias Krüger
14c385d3d6
Rollup merge of #99557 - pierwill:patch-6, r=tmiasko
Edit `rustc_index::vec::IndexVec::pick3_mut` docs

Clarify when this method will panic.

Part of #93792.
2022-07-21 18:42:10 +02:00
Matthias Krüger
31284d2ef2
Rollup merge of #99552 - lcnr:orphan_check-rework, r=oli-obk
Rewrite `orphan_check_trait_ref` to use a `TypeVisitor`

The current impl is far more confusing than it has any right to be 

r? rust-lang/types
2022-07-21 18:42:09 +02:00
Matthias Krüger
d425fe8fb3
Rollup merge of #99549 - JohnTitor:issue-52304, r=compiler-errors
Add regression test for #52304

Closes #52304
r? ```@compiler-errors```

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-21 18:42:08 +02:00
Matthias Krüger
230b775719
Rollup merge of #99528 - matthiaskrgr:2022_07_perf, r=estebank
couple of clippy::perf fixes
2022-07-21 18:42:07 +02:00
Matthias Krüger
da18bd18ca
Rollup merge of #99526 - compiler-errors:normalize-arg-spans, r=oli-obk
Normalize the arg spans to be within the call span

Makes more sense to point out the arg's span, and not the expression inside the macro
2022-07-21 18:42:06 +02:00
Matthias Krüger
84a7b23fd7
Rollup merge of #99523 - cuviper:asfd_ptrs-1.64, r=jyn514
Fix the stable version of `AsFd for Arc<T>` and `Box<T>`

These merged in #97437 for 1.64.0, apart from the main `io_safety`
feature that stabilized in 1.63.0.
2022-07-21 18:42:05 +02:00