Commit Graph

211679 Commits

Author SHA1 Message Date
Nicholas Nethercote
b788cb0071 Add Nicholas Nethercote to .mailmap.
Before:
```
$ git shortlog -se | grep Nethercote
   517	Nicholas Nethercote <n.nethercote@gmail.com>
     2	Nicholas Nethercote <nnethercote@apple.com>
   560	Nicholas Nethercote <nnethercote@mozilla.com>
```
After
```
$ git shortlog -se | grep Nethercote
  1079	Nicholas Nethercote <n.nethercote@gmail.com>
```
2022-11-30 08:54:11 +11:00
Matthias Krüger
a5ca67b951
Rollup merge of #105068 - jneem:master, r=jyn514
Run patchelf also on rust-analyzer-proc-macro-srv.

On NixOS, `rust-analyzer-proc-macro-srv` needs to be `patchelf`ed just like all the other libs and binaries.

With this fix, I am able to use the language server configuration recommended in [the guide](https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc).
2022-11-29 22:43:22 +01:00
Matthias Krüger
08a6c939a5
Rollup merge of #105066 - lcnr:mv-candidate_from_obligation, r=compiler-errors
move `candidate_from_obligation` out of assembly

it doesn't belong there as it also does winnowing

r? `@compiler-errors`
2022-11-29 22:43:22 +01:00
Matthias Krüger
5726f1f3ac
Rollup merge of #105062 - notriddle:notriddle/rustdoc-toggle-background, r=GuillaumeGomez
rustdoc: use shorthand background for rustdoc toggle CSS
2022-11-29 22:43:21 +01:00
Matthias Krüger
776e4a36c7
Rollup merge of #105051 - WaffleLapkin:unmacro, r=oli-obk
Replace a macro with a function

🌸
2022-11-29 22:43:21 +01:00
Matthias Krüger
aa674eefda
Rollup merge of #105049 - mkroening:hermit-fixes, r=jyn514
Hermit: Minor build fixes

These changes are necessary to build for the hermit targets.

CC: ``@stlankes``
2022-11-29 22:43:20 +01:00
Matthias Krüger
b596d6be7f
Rollup merge of #105045 - WaffleLapkin:deref-ahhhh~, r=compiler-errors
`rustc_ast_{passes,pretty}`: remove `ref` patterns

r? `@compiler-errors`
Previous PR: https://github.com/rust-lang/rust/pull/104721
2022-11-29 22:43:19 +01:00
Matthias Krüger
581ca3e836
Rollup merge of #105023 - tmiasko:asm-sym-static-reachable, r=wesleywiser
Statics used in reachable function's inline asm are reachable

Fixes #104925.
2022-11-29 22:43:19 +01:00
Matthias Krüger
804fa66a02
Rollup merge of #105002 - zertosh:acp-140, r=dtolnay
Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`

Implements rust-lang/libs-team#140 (tracking issue #105021).
2022-11-29 22:43:18 +01:00
Matthias Krüger
ca8f4c8d72
Rollup merge of #104911 - spastorino:inferred_outlives_crate-return-clause, r=oli-obk
Make inferred_outlives_crate return Clause

r? ``@oli-obk``
2022-11-29 22:43:18 +01:00
Matthias Krüger
3539cf9344
Rollup merge of #104627 - calebzulawski:print-target-features, r=compiler-errors
Print all features with --print target-features

This fixes `rustc --print target-features` with respect to aliases and tied features.

Before this change, the print command assumed that each LLVM feature corresponds exactly to one rustc feature.  In the case of aliases and tied features, this assumption failed and some features (such as aarch64's "pacg") were missing.  With this change, every target feature is listed.
2022-11-29 22:43:17 +01:00
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
Santiago Pastorino
537488efd6
Make inferred_outlives_crate return Clause 2022-11-29 12:01:58 -03: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
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
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
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
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
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