Commit Graph

212110 Commits

Author SHA1 Message Date
Matthias Krüger
3e9a2233d0
Rollup merge of #104523 - flba-eb:fix_nto_target_name, r=wesleywiser
Don't use periods in target names

Using a period in the target name can cause issues in e.g. cargo, see also https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Running.20tests.20on.20remote.20target
2022-11-29 22:43:17 +01:00
Matthias Krüger
e4d1fe7b15
Rollup merge of #104436 - ismailmaj:add-slice-to-stack-allocated-string-comment, r=Mark-Simulacrum
Add slice to the stack allocated string comment

Precise that the "stack allocated string" is not a string but a string slice.

``@rustbot`` label +A-docs
2022-11-29 22:43:16 +01:00
Matthias Krüger
d88699f9f5
Rollup merge of #104427 - compiler-errors:rematch-impl-may-fail-actually, r=lcnr
Explain why `rematch_impl` fails to be infallible

Fixes #104395

r? `@lcnr`
2022-11-29 22:43:16 +01:00
Matthias Krüger
3617adfaee
Rollup merge of #103876 - oli-obk:tait_implications, r=lcnr
type alias impl trait: add tests showing that hidden type only outlives lifetimes that occur in bounds

fixes #103642

https://github.com/rust-lang/rust/pull/102417 only made sure that hidden types cannot outlive lifetimes other than the ones mentioned on bounds, but didn't allow us to actually infer anything from that.

cc `@aliemjay`
2022-11-29 22:43:15 +01:00
bors
bddad597fe Auto merge of #94487 - oli-obk:stable_hash_ty, r=fee1-dead
Also cache the stable hash of interned Predicates

continuation of https://github.com/rust-lang/rust/pull/94299

This is a small perf improvement and shares more code between `Ty` and `Predicate`
2022-11-29 21:35:02 +00:00
Joe Neeman
66180dfad8 Run patchelf also on rust-analyzer-proc-macro-srv. 2022-11-29 14:36:52 -06:00
lcnr
bb982df771 move candidate_from_obligation out of assembly
it doesn't belong there as it also does winnowing
2022-11-29 20:32:48 +00:00
Michael Howell
43f5d2b910 rustdoc: add comment to confusing CSS main { min-width: 0 }
This CSS was added in cad0fce205, but the
reason why it was necessary was unclear. This comment makes it clear.
2022-11-29 13:22:01 -07:00
Michael Goulet
9512446a00 Explain why rematch_impl fails to be infallible 2022-11-29 19:02:40 +00:00
Camille GILLOT
6477fd8fc3 Make TyCtxtFeed::def_id private. 2022-11-29 18:50:29 +00:00
Camille GILLOT
a0c38807cf Feedable queries must allow hashing. 2022-11-29 18:46:06 +00:00
Camille GILLOT
731c002b27 Only allow feeding a value to newly created definitions. 2022-11-29 18:43:00 +00:00
Camille GILLOT
9f2c6b0b09 Sanity check computed value for feeable queries. 2022-11-29 18:42:23 +00:00
Camille GILLOT
ee7a9a8641 Expand hash check. 2022-11-29 18:41:55 +00:00
Camille GILLOT
5471381349 Allow to set a query's result as a side effect. 2022-11-29 18:40:59 +00:00
Camille GILLOT
ca42dd6716 Sanity check fingerprints in the dep-graph. 2022-11-29 18:39:03 +00:00
Camille GILLOT
7c45772bc9 Make verbose query description more useful. 2022-11-29 18:36:53 +00:00
Nixon Enraght-Moony
928622812c Don't assume that core::fmt::Debug will always have one item. 2022-11-29 18:27:16 +00:00
Michael Howell
edf5cce5a4 rustdoc: use shorthand background for rustdoc toggle CSS 2022-11-29 11:13:44 -07:00
Waffle Maybe
1b4012e304
add FIXME: where it belongs
suggestion from a friend!! 🐸

Co-authored-by: Michael Goulet <michael@errs.io>
2022-11-29 22:01:49 +04:00
Maybe Waffle
8c0951511b rename {max=>largest}_max_leb128_len 2022-11-29 17:58:09 +00:00
klensy
ceee880b31 update cpufeatures, swap difference to dissimilar 2022-11-29 19:59:37 +03:00
Santiago Pastorino
537488efd6
Make inferred_outlives_crate return Clause 2022-11-29 12:01:58 -03:00
Ben Kimock
906c3601fa Adjust inlining attributes around panic_immediate_abort 2022-11-29 09:24:01 -05:00
bors
3cf2c17e53 Auto merge of #9985 - ehuss:triagebot-autolabel, r=xFrednet
Add S-waiting-on-review autolabel.

This adds the S-waiting-on-review autolabel feature for new PRs.  This was previously handled by highfive, but I neglected to include it in #9963.

changelog: none
2022-11-29 13:30:15 +00:00
bors
e0098a5cc3 Auto merge of #105012 - WaffleLapkin:into, r=oli-obk
Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`)

r? `@oli-obk` you've asked for this >:)
2022-11-29 13:28:44 +00:00
Eric Huss
8759f33bb3 Add S-waiting-on-review autolabel. 2022-11-29 05:18:43 -08:00
Maybe Waffle
050cee48f8 Replace a macro with a function 2022-11-29 11:52:48 +00:00
Martin Kröning
0a4e5efe6f hermit: Remove unused exports 2022-11-29 12:25:35 +01:00
Martin Kröning
c8f3203c46 hermit: Fix fuzzy_provenance_casts 2022-11-29 12:25:35 +01:00
bors
bfb973f1c7 Auto merge of #9975 - xFrednet:0000-refutable-slice-pedantic, r=llogiq
Move `index_refutable_slice` to `pedantic`

During the creation, I out this lint into the nursery group to let it run in the wild before moving it to a commonly used group. This move never happened until now, though. It should be safe, as Clippy and I have been using it for months and there are no open issues for is :)

---

changelog: Move `index_refutable_slice` to `pedantic` (Now warn-by-default)
[#9975](https://github.com/rust-lang/rust-clippy/pull/9975)
2022-11-29 11:16:01 +00:00
bors
c372b14701 Auto merge of #104947 - cjgillot:verify-hir-nest, r=oli-obk
Verify that HIR parenting and Def parenting match.

This relationship is relied upon for `tcx.hir_owner_parent` query to return an accurate result.
2022-11-29 10:34:19 +00:00
David Rheinsberg
7b9e1a95f0 test/codegen: test inter-crate linkage with static relocation
Add a codegen-test that verifies inter-crate linkage with the static
relocation model. We expect all symbols that are part of a rust
compilation to end up in the same DSO, thus we expect `dso_local`
annotations.
2022-11-29 11:21:16 +01:00
David Rheinsberg
a0771bdabb codegen-llvm: never combine DSOLocal and DllImport
Prevent DllImport from being attached to DSOLocal definitions in the
LLVM IR. The combination makes no sense, since definitions local to the
compilation unit will never be imported from external objects.

Additionally, LLVM will refuse the IR if it encounters the
combination (introduced in [1]):

  if (GV.hasDLLImportStorageClass())
    Assert(!GV.isDSOLocal(),
           "GlobalValue with DLLImport Storage is dso_local!", &GV);

Right now, codegen-llvm will only apply DllImport to constants and rely
on call-stubs for functions. Hence, we simply extend the codegen of
constants to skip DllImport for any local definitions.

This was discovered when switching the EFI targets to the static
relocation model [2]. With this fixed, we can start another attempt at
this.

[1] 509132b368
[2] https://github.com/rust-lang/rust/issues/101656
2022-11-29 10:57:25 +01:00
bors
4cda21dc42 Auto merge of #9981 - Jarcho:issue_9954, r=flip1995
Don't lint `unnecessary_operation` in mixed macro contexts

fixes #9954

changelog: `unnecessary_operation`: Don't lint in mixed macro contexts.
2022-11-29 09:49:46 +00:00
bors
e9a8b8c2f3 Auto merge of #9980 - Jarcho:issue_9960, r=xFrednet
Don't lint `unnecessary_cast` in mixed macro context

fixes #9960

Time to start making a dent in this onslaught.

changelog: `unnecessary_cast`: Don't lint when the identifiers context differs from its binding's context for locals
2022-11-29 09:10:14 +00:00
Scott McMurray
a964a37211 Send VecDeque::from_iter via Vec::from_iter
Since it's O(1) to convert between them now, might as well reuse the logic.

Mostly for the various specializations it does, but might also save some monomorphization work if, say, people collect slice iterators into both `Vec`s and `VecDeque`s.
2022-11-29 00:24:15 -08:00
Maybe Waffle
56ae9a1746 rustc_ast_pretty: remove ref patterns 2022-11-29 08:10:59 +00:00
Maybe Waffle
07b86a94c7 rustc_ast_passes: remove ref patterns 2022-11-29 08:09:57 +00:00
Nicholas Nethercote
ba1751a201 Avoid more MetaItem-to-Attribute conversions.
There is code for converting `Attribute` (syntactic) to `MetaItem`
(semantic). There is also code for the reverse direction. The reverse
direction isn't really necessary; it's currently only used when
generating attributes, e.g. in `derive` code.

This commit adds some new functions for creating `Attributes`s directly,
without involving `MetaItem`s: `mk_attr_word`, `mk_attr_name_value_str`,
`mk_attr_nested_word`, and
`ExtCtxt::attr_{word,name_value_str,nested_word}`.

These new methods replace the old functions for creating `Attribute`s:
`mk_attr_inner`, `mk_attr_outer`, and `ExtCtxt::attribute`. Those
functions took `MetaItem`s as input, and relied on many other functions
that created `MetaItems`, which are also removed: `mk_name_value_item`,
`mk_list_item`, `mk_word_item`, `mk_nested_word_item`,
`{MetaItem,MetaItemKind,NestedMetaItem}::token_trees`,
`MetaItemKind::attr_args`, `MetaItemLit::{from_lit_kind,to_token}`,
`ExtCtxt::meta_word`.

Overall this cuts more than 100 lines of code and makes thing simpler.
2022-11-29 18:43:53 +11:00
Nicholas Nethercote
d1b61a31c5 Inline and remove MetaItemLit::from_lit_kind.
It has a single call site.
2022-11-29 18:42:40 +11:00
bors
0c6b88dbba Auto merge of #105041 - matthiaskrgr:rollup-7ffry90, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #104465 (Document more settings for building rustc for Fuchsia)
 - #104951 (Simplify checking for `GeneratorKind::Async`)
 - #104959 (Revert #104269 (to avoid spurious hang/test failure in CI))
 - #104978 (notify the rust-analyzer team on changes to the rust-analyzer subtree)
 - #105010 (Fix documentation of asymptotic complexity for rustc_data_structures::SortedMap)
 - #105016 (Add sentence when rustdoc search is running)
 - #105020 (rustdoc: merge background-image rules in rustdoc-toggle CSS)
 - #105024 (rustdoc: remove `fnname` CSS class that's styled exactly like `fn`)
 - #105027 (Rustdoc-Json: Add tests for linking to foreign variants.)
 - #105038 (Clean up pr 104954)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-29 07:04:01 +00:00
Tommy Chiang (oToToT)
382dba52ee v8a as default aarch64 target
After https://github.com/llvm/llvm-project/commit/8689f5e landed, LLVM takes the intersection of v8a and v8r as default.
This commit brings back v8a support by explicitly specifying v8a in the feature list.

This should solve #97724.
2022-11-29 14:25:46 +08:00
Nicholas Nethercote
ac7a7499df Remove an out-of-date comment.
This comment dates back to at least 2013, and is no longer relevant.
(There used to be an `allow` attribute, but that's no longer present.)
2022-11-29 17:13:38 +11:00
Jason Newcomb
f44b7aa81e Don't lint unnecessary_cast in mixed macro context 2022-11-28 23:58:02 -05:00
Jason Newcomb
0893322e54 Don't lint unnecessary_operation in mixed macro contexts 2022-11-28 23:56:02 -05:00
yukang
3980945ab1 fix #104884, Avoid Invalid code suggested when encountering unsatisfied trait bounds in derive macro code 2022-11-29 12:38:39 +08:00
Matthias Krüger
789b70dc2a
Rollup merge of #105038 - Rageking8:clean-up-pr-104954, r=compiler-errors
Clean up pr 104954

UI test filename typo fix and a simple comment rewording. Thanks.

CC `@vincenzopalazzo` (you spelled your name wrongly in the FIXME)

r? `@estebank`
2022-11-29 05:24:25 +01:00
Matthias Krüger
f6e5448361
Rollup merge of #105027 - aDotInTheVoid:rdj-foreign-variant-test, r=GuillaumeGomez
Rustdoc-Json: Add tests for linking to foreign variants.

I initially taught these would be bugs, but it turn out they work perfectly, and the variant is added to paths.

Most of the work is done by jsondoclint checking all the ID's resolve (although this wont happen for links until #105015, which in turn is blocked on removing foreign traits), but we do check that neither the enum nor the variant is inlined, so it must be resolved correctly through paths.

r? ``@GuillaumeGomez``
2022-11-29 05:24:25 +01:00
Matthias Krüger
0e7f15947e
Rollup merge of #105024 - notriddle:notriddle/fnname, r=jyn514
rustdoc: remove `fnname` CSS class that's styled exactly like `fn`

It's not obvious why this was ever a separate class name, since even in c4219a4783 when it was first added, it was styled identically to regular `fn` links.
2022-11-29 05:24:24 +01:00