Commit Graph

240017 Commits

Author SHA1 Message Date
bjorn3
4acaa0284e Feed the output filenames into the TyCtxt
Since the introduction of the crate attribute pre-expansion pass we
don't need access to the TyCtxt to compute it.
2023-11-26 18:02:47 +00:00
bjorn3
98a6eaa7f8 Serialize OutputFilenames into rmeta file
This ensures that linking will use the correct crate name even when
`#![crate_name = "..."]` is used to specify the crate name.
2023-11-26 18:02:42 +00:00
Ryan Mehri
af6b84aaab
don't add redundant help for object safety violations 2023-11-26 09:53:58 -08:00
bjorn3
eacbe65dfe Accept crate name instead of attributes in build_output_filenames 2023-11-26 17:43:49 +00:00
bjorn3
457dbbfc55 Inline and remove pre_configure 2023-11-26 17:43:49 +00:00
Waffle Maybe
41a97888c7
Add my work email to the mailmap 2023-11-26 18:39:38 +01:00
The 8472
bc7dd5fa6d unify read_to_end and io::copy impls for reading into a Vec 2023-11-26 18:13:36 +01:00
bors
3bb0171999 Auto merge of #118319 - GuillaumeGomez:rollup-vte50yq, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #118296 (rustdoc: replace `elemIsInParent` with `Node.contains`)
 - #118302 (Clean dead codes)
 - #118311 (merge `DefKind::Coroutine` into `Defkind::Closure`)
 - #118318 (Remove myself from users on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-26 16:42:32 +00:00
clubby789
4d9344d26e Fix Rustdoc search docs link 2023-11-26 16:22:43 +00:00
onur-ozkan
1017042575 give dev-friendly error message for incorrect config profiles
before this change, an incorrect profile would result in the following error:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    with open(include_path) as included_toml:
         ^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/defaults/config.aaaa.toml'
```

with this change, the error message is now:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    raise Exception("Unrecognized profile '{}'. Check src/bootstrap/defaults"
Exception: Unrecognized profile 'aaaa'. Check src/bootstrap/defaults for available options.
```

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-26 19:05:02 +03:00
Maybe Waffle
e1b4e8a257 Add is_aligned{,_to} convenience methods to NonNull 2023-11-26 16:01:31 +00:00
Maybe Waffle
2bcaa9760e Add align_offset convenience method to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
4cc46df98c Add replace and swap convenience methods to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
4bcdd3bd92 Add offset_from-ish convenience methods to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
ebdc79497f Add offset-ish convenience methods to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
36a587fb62 Add read/write/copy convenience methods to NonNull 2023-11-26 15:57:01 +00:00
onur-ozkan
1a86482c57 skip {tidy,compiletest,rustdoc-gui} based tests for DocTests::Only
As use of `--doc` with `x test` is intended for running doc-tests only, executing
compiletest, tidy or rustdoc-gui based tests considered as an incorrect behavior
from bootstrap. This change fixes that.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-26 18:18:49 +03:00
Maybe Waffle
1a3c5c40ca rustdoc: Remove space from fake-variadic fn ptr impls
before: `for fn (T₁, T₂, …, Tₙ) -> Ret`
after: `for fn(T₁, T₂, …, Tₙ) -> Ret`
2023-11-26 15:01:42 +00:00
Guillaume Gomez
cb04603af4
Rollup merge of #118318 - WaffleLapkin:unvacation-waffle, r=WaffleLapkin
Remove myself from users on vacation

I think I have some capacity for reviews now and recently there were a few PRs with explicit `r? `@WaffleLapkin`` which I'm actually capable to review, so
2023-11-26 15:44:55 +01:00
Guillaume Gomez
c6d20d70b4
Rollup merge of #118311 - bvanjoi:merge_coroutinue_into_closure, r=petrochenkov
merge `DefKind::Coroutine` into `Defkind::Closure`

Related to #118188

We no longer need to be concerned about the precise type whether it's `DefKind::Closure` or `DefKind::Coroutine`.

Furthermore, thanks for the great work done by `@petrochenkov` on investigating https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Why.20does.20it.20hang.20when.20querying.20.EF.BB.BF.60opt_def_kind.60.3F

r? `@petrochenkov`
2023-11-26 15:44:54 +01:00
Guillaume Gomez
c67613bef9
Rollup merge of #118302 - mu001999:dead_code/clean, r=cjgillot
Clean dead codes

Clean dead codes detected by #118257
2023-11-26 15:44:54 +01:00
Guillaume Gomez
bb5bbbf4ea
Rollup merge of #118296 - notriddle:notriddle/main-dom, r=GuillaumeGomez
rustdoc: replace `elemIsInParent` with `Node.contains`

According to [MDN], this function is compatible with:

* Chrome 16 and Edge 12
* Firefox 9
* Safari 1.1 and iOS Safari 1

These browsers are well within our [support matrix], which requires compatibility with Chrome 118, Firefox 115, Safari 17, and Edge 119.

[MDN]: https://developer.mozilla.org/en-US/docs/Web/API/Node/contains#browser_compatibility
[support matrix]: https://browsersl.ist/#q=last+2+Chrome+versions%2C+last+1+Firefox+version%2C+Firefox+ESR%2C+last+1+Safari+version%2C+last+1+iOS+version%2C+last+1+Edge+version%2C+last+1+UCAndroid+version
2023-11-26 15:44:53 +01:00
bors
3dbb4da042 Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin
Call FileEncoder::finish in rmeta encoding

Fixes https://github.com/rust-lang/rust/issues/117254

The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out.

I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths.

I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing.

r? `@WaffleLapkin`
2023-11-26 14:43:02 +00:00
Waffle Maybe
4a22b1aa1c
Remove myself from users on vacation 2023-11-26 15:33:34 +01:00
bohan
f23befe6c1 merge DefKind::Coroutine into DefKind::Closure 2023-11-26 21:05:08 +08:00
Rémy Rakic
f969af2195 move remaining legacy polonius fact generation out of NLL module 2023-11-26 13:03:32 +00:00
Rémy Rakic
96042bc247 merge NLL "constraint generation" into liveness 2023-11-26 13:03:32 +00:00
bors
0b8a61b235 Auto merge of #118267 - compiler-errors:ambiguity-causes, r=spastorino
`AmbiguityCause` should not eagerly format strings

Minor tweak found when working on some coherence diagnostics stuff (towards `-Ztrait-solver=next-coherence` stabilization)
2023-11-26 12:44:38 +00:00
Rémy Rakic
626289a9e3 remove polonius fact generation from NLL constraint generation 2023-11-26 12:32:44 +00:00
Maybe Waffle
234e9500a4 Use usize::repeat_u8 instead of implementing repeat_byte in memchr.rs 2023-11-26 12:27:56 +00:00
Maybe Waffle
865ab921ab Rename {collections=>alloc}{tests,benches} 2023-11-26 12:04:56 +00:00
Rémy Rakic
c976bc114a small polish of loan invalidations fact generation 2023-11-26 12:00:32 +00:00
Rémy Rakic
951901bedc rename polonius constraint generation to what it actually does: emit loan kills 2023-11-26 12:00:32 +00:00
Rémy Rakic
bfd88b0bf1 simplify polonius constraint generation 2023-11-26 12:00:32 +00:00
Rémy Rakic
f53412ab7c remove NLL liveness from polonius constraint generation 2023-11-26 12:00:32 +00:00
Rémy Rakic
9f14698680 extract polonius "constraint generation"
to help review, this duplicates the existing NLL + polonius constraint
generation component, before splitting them up to only do what they
individually need.
2023-11-26 12:00:32 +00:00
Rémy Rakic
49010833e9 another trivial cleanup
fix a comment and move a variable where it's used
2023-11-26 12:00:32 +00:00
Rémy Rakic
16a5da7be2 extract polonius loan invalidations fact generation
and move the polonius module to the borrowck root
2023-11-26 12:00:32 +00:00
Rémy Rakic
459a616c4f extract polonius universal regions fact generation 2023-11-26 12:00:32 +00:00
Rémy Rakic
3de68e074a extract polonius move fact generation 2023-11-26 12:00:32 +00:00
Rémy Rakic
eca2789f57 remove useless local variables 2023-11-26 12:00:32 +00:00
Maybe Waffle
c860ba1994 Improve some comments for non-zero ops 2023-11-26 11:47:08 +00:00
bors
237712fa31 Auto merge of #15967 - lnicola:salsa-fork, r=lnicola
internal: Switch to our own `salsa` fork

This gets rid of `syn` 1, among others.
2023-11-26 11:11:54 +00:00
Laurențiu Nicola
3ccde009cb Switch to our own salsa fork 2023-11-26 13:06:36 +02:00
bors
3acb261e21 Auto merge of #118256 - petrochenkov:nohir, r=compiler-errors
rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` cleanup

Noticed this while working on https://github.com/rust-lang/rust/pull/118188.

The history here is that the method was moved from HIR map to tcx in https://github.com/rust-lang/rust/pull/93373 as a part of incremental compilation work, so it's unlikely to go back.
2023-11-26 10:43:41 +00:00
Vadim Petrochenkov
c697927f44 rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
bors
274b5249eb Auto merge of #117880 - lqd:liveness-values, r=cjgillot
Refactor borrowck liveness values

This PR starts cleaning up `rustc_borrowck`, in particular around liveness values:
- refactors simple names that make no sense anymore: either referring to older structures using region elements, or to bitset containers and values.
- improves comments and fixes others
- removes unused return values and unneeded generic arguments

r? `@matthewjasper`
2023-11-26 08:44:28 +00:00
ouz-a
de2779077a add successors and their formatter 2023-11-26 11:23:28 +03:00
bors
9529a5d265 Auto merge of #110303 - nbdd0121:master, r=Mark-Simulacrum
Add `debug_assert_nounwind` and convert `assert_unsafe_precondition`

`assert_unsafe_precondition` checks non-CTFE-evaluable conditions in runtime and performs no-op in compile time, while many of its current usage can be checked during const eval.
2023-11-26 06:44:03 +00:00
bors
5c97719393 Auto merge of #118250 - petrochenkov:optdefkind, r=compiler-errors
rustc: Make `def_kind` mandatory for all `DefId`s

Prerequisite for https://github.com/rust-lang/rust/pull/118188.
2023-11-26 04:44:20 +00:00