Commit Graph

140677 Commits

Author SHA1 Message Date
Pietro Albini
4e2a98268a
include pretty reason why ignore-FOO matched 2023-04-03 09:24:00 +02:00
Pietro Albini
123cc413bd
include eventual comment in the compiletest ignore reason 2023-04-03 09:23:57 +02:00
Matthias Krüger
22df7107bd
Rollup merge of #109873 - jyn514:subdirectories, r=compiler-errors
Move some UI tests into subdirectories
2023-04-03 08:58:55 +02:00
Matthias Krüger
41cd454228
Rollup merge of #109871 - Mark-Simulacrum:metrics-timestamp, r=ozkanonur
Include invocation start times

For multi-invocation builders (e.g., dist-x86_64-linux) this timestamp is necessary to correlate the data in the metrics JSON with other data sources (e.g., logs, cpu-usage CSV, etc.). Such correlation may not be perfect but is sometimes helpful and awkward to do otherwise.
2023-04-03 08:58:54 +02:00
Matthias Krüger
9007ee9f1c
Rollup merge of #109868 - jyn514:ci-names, r=Mark-Simulacrum
Improve PR job names in Github Actions preview

Fixes https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/PR.20CI.20job.20names.

Before: `CI / PR (mingw-check, false, ubuntu-20.04-16core-64gb) (pull_request)`
After:  `CI / PR - mingw-check (pull_request)`

r? ``@jyn514``
2023-04-03 08:58:54 +02:00
Matthias Krüger
cc6a279f05
Rollup merge of #109642 - lenko-d:rust_codegen-backends_interacts_confusingly_with_paths, r=Mark-Simulacrum
check for missing codegen backeng config

Fixes [#109610](https://github.com/rust-lang/rust/issues/109610)
2023-04-03 08:58:52 +02:00
Matthias Krüger
7192ef3efd
Rollup merge of #109526 - bzEq:aix-libpath, r=Mark-Simulacrum
LIBPATH is used as dylib's path environment variable on AIX

See https://4js.com/online_documentation/fjs-fgl-3.00.05-manual-html/c_fgl_installation_017.html.
2023-04-03 08:58:52 +02:00
bors
d0eed58a1e Auto merge of #108288 - ozkanonur:hotfix-90244, r=Mark-Simulacrum
fix `build --stage 2 compiler/rustc` panic

Skip assembling(which causes panic due to not found `.librustc.stamp` file) process
for stage3(since it has problems with sysroot) if full-bootstrap isn't used.

Resolves #90244
2023-04-03 04:54:02 +00:00
Jacob Hoffman-Andrews
d9edb05d44 rustdoc: fix quadratic time in intra-doc link pass
In the collect_intra_doc_links pass, links to a given item that occurred
repeatedly were getting inserted into a Vec<clean::ItemLink> repeatedly.
This led to n^2 behavior (where n = the number of pages generated), particularly
for the intra-doc link on the `Into<U> for T where U: From<T>` blanket
implementation, since that link appears on every single struct page.
2023-04-02 20:46:02 -07:00
jyn
01b75e20f2 Move some UI tests into subdirectories
to avoid going over the existing limit now that the ui-fulldeps tests have
been moved to ui.
2023-04-02 19:42:30 -04:00
Mark Rousskov
dd85271ef5 Include invocation start times
For multi-invocation builders (e.g., dist-x86_64-linux) this timestamp
is necessary to correlate the data in the metrics JSON with other data
sources (e.g., logs, cpu-usage CSV, etc.). Such correlation may not be
perfect but is sometimes helpful and awkward to do otherwise.
2023-04-02 19:28:52 -04:00
jyn
423e76f1dd Improve job names in Github Actions preview
Before: `CI / PR (mingw-check, false, ubuntu-20.04-16core-64gb) (pull_request)`
After: `CI / PR - mingw-check (pull_request)`
2023-04-02 17:58:08 -04:00
ozkanonur
5d1ee66abe fix build --stage 2 compiler/rustc panic
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-02 19:00:00 +03:00
bors
3a8a131e95 Auto merge of #109811 - jyn514:symlink-fixes, r=Mark-Simulacrum
Replace any existing `build/host` symlink

This has two advantages:
1. If `build.build` changes between runs, the symlink is no longer silently wrong.
2. If the entire build directory is moved, the symlink is no longer broken because it points to the wrong absolute path.
2023-04-02 14:54:31 +00:00
Jynn Nelson
28b7e6abff Replace any existing build/host symlink
This has two advantages:
1. If `build.build` changes between runs, the symlink is no longer
   silently wrong.
2. If the entire build directory is moved, the symlink is no longer
   broken because it points to the wrong absolute path.
2023-04-02 07:57:05 -05:00
Nilstrieb
e2ffe151a3
Rollup merge of #109844 - matthiaskrgr:clippy2023_04, r=Nilstrieb
a couple clippy::complexity fixes

map_identity
filter_next
option_as_ref_deref
unnecessary_find_map
redundant_slicing
unnecessary_unwrap
bool_comparison
derivable_impls
manual_flatten
needless_borrowed_reference
2023-04-02 10:08:34 +02:00
bors
0f6312f643 Auto merge of #109833 - klensy:bs-tty, r=Mark-Simulacrum
bootstrap: replace `atty` with `is-terminal`, dedupe deps

`atty` reported as [unsound](https://rustsec.org/advisories/RUSTSEC-2021-0145), so replaced with `is-terminal`, also updated few crates to reduce dupes

fd-lock v3.0.8 -> v3.0.11 (https://github.com/yoshuawuyts/fd-lock/compare/v3.0.8...v3.0.11, https://github.com/yoshuawuyts/fd-lock/pull/38)
2023-04-01 22:51:10 +00:00
Matthias Krüger
8ef3bf29fe a couple clippy::complexity fixes
map_identity
filter_next
option_as_ref_deref
unnecessary_find_map
redundant_slicing
unnecessary_unwrap
bool_comparison
derivable_impls
manual_flatten
needless_borrowed_reference
2023-04-01 23:16:33 +02:00
Eric Huss
6e29862fd2 Update cargo 2023-04-01 08:49:20 -07:00
klensy
1f3ee276e5 bootstrap replace atty with is-terminal, dedupe few deps 2023-04-01 17:54:52 +03:00
bors
87e6b621a2 Auto merge of #109721 - QuinnPainter:armv4t-lld, r=petrochenkov
Switch to LLD as default linker for {arm,thumb}v4t-none-eabi

The LLVM 16 update brought ARMv4t support to LLD. We should use it by default so users don't need to install an external linker.

cc `@Lokathor`
2023-04-01 01:55:16 +00:00
bors
5e1d3299a2 Auto merge of #109824 - GuillaumeGomez:rollup-i5r4uts, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #109104 (rustdoc: Fix invalid suggestions on ambiguous intra doc links v2)
 - #109443 (Move `doc(primitive)` future incompat warning to `invalid_doc_attributes`)
 - #109680 (Fix subslice capture in closure)
 - #109798 (fluent_messages macro: don't emit the OS error in a note)
 - #109805 (Source map cleanups)
 - #109818 (rustdoc: Add GUI test for jump to collapsed item)
 - #109820 (rustdoc-search: update docs for comma in `?` help popover)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-31 20:38:06 +00:00
Guillaume Gomez
083c128ae1
Rollup merge of #109820 - notriddle:notriddle/help-comma, r=camelid
rustdoc-search: update docs for comma in `?` help popover
2023-03-31 22:32:51 +02:00
Guillaume Gomez
32842e87b1
Rollup merge of #109818 - GuillaumeGomez:test-collapsed-item, r=notriddle
rustdoc: Add GUI test for jump to collapsed item

Part of https://github.com/rust-lang/rust/issues/66181.

I updated `browser-ui-test` version because I needed to add a new command `property`: https://github.com/GuillaumeGomez/browser-UI-test/pull/452.

r? `@notriddle`
2023-03-31 22:32:51 +02:00
Guillaume Gomez
6c93c63771
Rollup merge of #109443 - GuillaumeGomez:doc-primitive-hard-error, r=notriddle
Move `doc(primitive)` future incompat warning to `invalid_doc_attributes`

Fixes #88070.

It's been a while since this was turned into a "future incompatible lint" so I think we can now turn it into a hard error without problem.

r? `@jyn514`
2023-03-31 22:32:49 +02:00
Guillaume Gomez
8fe5b56b66
Rollup merge of #109104 - GuillaumeGomez:fix-invalid-suggestion-ambiguous-intra-doc2, r=oli-obk,notriddle
rustdoc: Fix invalid suggestions on ambiguous intra doc links v2

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

This is another approach to fixing the same issue. This time, we keep the computed information around instead of re-computing it.

Strangely enough, the order for ambiguities seem to have been changed. Not an issue but it creates a lot of diff...

So which version do you prefer?

r? `@notriddle`
2023-03-31 22:32:48 +02:00
bors
7402519c63 Auto merge of #109010 - compiler-errors:rtn, r=eholk
Initial support for return type notation (RTN)

See: https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/

1. Only supports `T: Trait<method(): Send>` style bounds, not `<T as Trait>::method(): Send`. Checking validity and injecting an implicit binder for all of the late-bound method generics is harder to do for the latter.
    * I'd add this in a follow-up.
3. ~Doesn't support RTN in general type position, i.e. no `let x: <T as Trait>::method() = ...`~
    * I don't think we actually want this.
5. Doesn't add syntax for "eliding" the function args -- i.e. for now, we write `method(): Send` instead of `method(..): Send`.
    * May be a hazard if we try to add it in the future. I'll probably add it in a follow-up later, with a structured suggestion to change `method()` to `method(..)` once we add it.
7. ~I'm not in love with the feature gate name 😺~
    * I renamed it to `return_type_notation` ✔️

Follow-up PRs will probably add support for `where T::method(): Send` bounds. I'm not sure if we ever want to support return-type-notation in arbitrary type positions. I may also make the bounds require `..` in the args list later.

r? `@ghost`
2023-03-31 18:04:12 +00:00
Michael Howell
54ef3a4786 rustdoc-search: update docs for comma in ? help popover 2023-03-31 10:18:44 -07:00
Guillaume Gomez
aab9e32094 Update browser-ui-test version to 0.14.6 2023-03-31 16:02:22 +02:00
Julia Tatz
7b453b9f5a More in-depth documentation for the new debuginfo options 2023-03-31 07:28:39 -04:00
Julia Tatz
0504a33383 Preserve, clarify, and extend debug information
`-Cdebuginfo=1` was never line tables only and
can't be due to backwards compatibility issues.
This was clarified and an option for line tables only
was added. Additionally an option for line info
directives only was added, which is well needed for
some targets. The debug info options should now
behave the same as clang's debug info options.
2023-03-31 07:28:39 -04:00
bors
22a7a19f93 Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obk
Insert alignment checks for pointer dereferences when debug assertions are enabled

Closes https://github.com/rust-lang/rust/issues/54915

- [x] Jake tells me this sounds like a place to use `MirPatch`, but I can't figure out how to insert a new basic block with a new terminator in the middle of an existing basic block, using `MirPatch`. (if nobody else backs up this point I'm checking this as "not actually a good idea" because the code looks pretty clean to me after rearranging it a bit)
- [x] Using `CastKind::PointerExposeAddress` is definitely wrong, we don't want to expose. Calling a function to get the pointer address seems quite excessive. ~I'll see if I can add a new `CastKind`.~ `CastKind::Transmute` to the rescue!
- [x] Implement a more helpful panic message like slice bounds checking.

r? `@oli-obk`
2023-03-31 08:50:35 +00:00
Guillaume Gomez
bcf8a8b58c Improve code 2023-03-30 22:56:52 +02:00
Guillaume Gomez
48f7148fca Update documentation for rustc_doc_primitive 2023-03-30 22:56:52 +02:00
Guillaume Gomez
364e961417 Replace doc(primitive) with rustc_doc_primitive 2023-03-30 22:56:52 +02:00
bors
789ee5e433 Auto merge of #108576 - megakorre:rustdock_additional_typecheck_before_clean, r=GuillaumeGomez
rustdoc: run more HIR validation to mirror rustc

# Explanation

While investigating these issues: https://github.com/rust-lang/rust/issues/107093, https://github.com/rust-lang/rust/issues/106079
I thought it maybe would be useful to test running `rustdoc` on all rust files under `tests/ui` grepping for files that causes any ICEs.
And these are the files I found would cause ICEs.
```
// These are handled by this fix.
tests/ui/late-bound-lifetimes/mismatched_arg_count.rs
tests/ui/associated-consts/issue-102335-const.rs
tests/ui/const-generics/generic_const_exprs/issue-102768.rs
tests/ui/const-generics/const-arg-type-arg-misordered.rs
tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
tests/ui/typeck/issue-88643.rs
tests/ui/typeck/issue-75889.rs
tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs
// These are not they will still produce a ICE after this change
tests/ui/limits/issue-56762.rs
tests/ui/union/projection-as-union-type-error-2.rs
tests/ui/union/projection-as-union-type-error.rs
```

I reduces the issues handled by this PR down to the tests added in the PR. That includes the linked issues.
But the 3 files that are not handled I will leave for a future PR.

This PR adds the `type_collecting` step from `hir_analysis::check_crate` to the rustdoc typechecks.
It had the following comment on it.
```
// this ensures that later parts of type checking can assume that items
// have valid types and not error
```
Adding the check report the same errors as rustc does for these input.
And not ICE when the lint checker walks the HIR or when in the `rustdoc::clean` pass.

This PR updates the expected errors of some existing rustdoc-ui tests (some now report less errors).
These new reported errors does mirror the errors reported by rustc.

# Performance
It does more checking so it will probably regress. We should run ``@bors` try `@rust-timer` queue` and see.

# Discussion

Maybe instead of calling a subset of the checks in `hir_analysis::check_crate` and having comments that say they should be kept in sync. We could instead call `check_crate` directly and pass in some flag. Maybe `check_toplevel_signatures_only` or something like that. That flag would have to skip most of the checks in that function tough.
2023-03-30 15:21:22 +00:00
Patrik Kårlin
9b5115f92b
rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
bors
516a6d3202 Auto merge of #109769 - JohnTitor:rollup-7n2bnpg, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #106985 (Enhanced doucmentation of binary search methods for `slice` and `VecDeque` for unsorted instances)
 - #109509 (compiletest: Don't allow tests with overlapping prefix names)
 - #109719 (RELEASES: Add "Only support Android NDK 25 or newer" to 1.68.0)
 - #109748 (Don't ICE on `DiscriminantKind` projection in new solver)
 - #109749 (Canonicalize float var as float in new solver)
 - #109761 (Drop binutils on powerpc-unknown-freebsd)
 - #109766 (Fix title for openharmony.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-30 12:44:25 +00:00
Yuki Okushi
6519ca462f
Rollup merge of #109766 - Amanieu:ohos-title, r=JohnTitor
Fix title for openharmony.md
2023-03-30 21:07:04 +09:00
Yuki Okushi
33ff1c9331
Rollup merge of #109761 - pkubaj:patch-1, r=ozkanonur
Drop binutils on powerpc-unknown-freebsd

FreeBSD 13.1 and 13.2 can build Rust with LLD just fine on powerpc.
2023-03-30 21:07:03 +09:00
Yuki Okushi
2981d7781c
Rollup merge of #109509 - ehuss:overlapping-tests, r=Mark-Simulacrum
compiletest: Don't allow tests with overlapping prefix names

Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path, or otherwise clash with it while the two tests are trying to create/delete/modify the same directory.

In practice, this manifested as a random error on macOS where two tests were trying to create/delete/create `rustdoc/primitive` and `rustdoc/primitive/no_std`, which resulted in an EINVAL (InvalidInput) error.

This renames some of the offending tests, adds `compiletest-ignore-dir` to prevent compiletest from processing some files, and adds a check to prevent this from happening in the future.

Fixes #109397
2023-03-30 21:07:00 +09:00
Amanieu d'Antras
4b7f14149b Fix title for openharmony.md 2023-03-30 12:06:07 +01:00
bors
8a7ca936e6 Auto merge of #105587 - tgross35:once-cell-min, r=m-ou-se
Partial stabilization of `once_cell`

This PR aims to stabilize a portion of the `once_cell` feature:

- `core::cell::OnceCell`
- `std::cell::OnceCell` (re-export of the above)
- `std::sync::OnceLock`

This will leave `LazyCell` and `LazyLock` unstabilized, which have been moved to the `lazy_cell` feature flag.

Tracking issue: https://github.com/rust-lang/rust/issues/74465 (does not fully close, but it may make sense to move to a new issue)

Future steps for separate PRs:
- ~~Add `#[inline]` to many methods~~ #105651
- Update cranelift usage of the `once_cell` crate
- Update rust-analyzer usage of the `once_cell` crate
- Update error messages discussing once_cell

## To be stabilized API summary

```rust
// core::cell (in core/cell/once.rs)

pub struct OnceCell<T> { .. }

impl<T> OnceCell<T> {
    pub const fn new() -> OnceCell<T>;
    pub fn get(&self) -> Option<&T>;
    pub fn get_mut(&mut self) -> Option<&mut T>;
    pub fn set(&self, value: T) -> Result<(), T>;
    pub fn get_or_init<F>(&self, f: F) -> &T where F: FnOnce() -> T;
    pub fn into_inner(self) -> Option<T>;
    pub fn take(&mut self) -> Option<T>;
}

impl<T: Clone> Clone for OnceCell<T>;
impl<T: Debug> Debug for OnceCell<T>
impl<T> Default for OnceCell<T>;
impl<T> From<T> for OnceCell<T>;
impl<T: PartialEq> PartialEq for OnceCell<T>;
impl<T: Eq> Eq for OnceCell<T>;
```

```rust
// std::sync (in std/sync/once_lock.rs)

impl<T> OnceLock<T> {
    pub const fn new() -> OnceLock<T>;
    pub fn get(&self) -> Option<&T>;
    pub fn get_mut(&mut self) -> Option<&mut T>;
    pub fn set(&self, value: T) -> Result<(), T>;
    pub fn get_or_init<F>(&self, f: F) -> &T where F: FnOnce() -> T;
    pub fn into_inner(self) -> Option<T>;
    pub fn take(&mut self) -> Option<T>;
}

impl<T: Clone> Clone for OnceLock<T>;
impl<T: Debug> Debug for OnceLock<T>;
impl<T> Default for OnceLock<T>;
impl<#[may_dangle] T> Drop for OnceLock<T>;
impl<T> From<T> for OnceLock<T>;
impl<T: PartialEq> PartialEq for OnceLock<T>
impl<T: Eq> Eq for OnceLock<T>;
impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceLock<T>;
unsafe impl<T: Send> Send for OnceLock<T>;
unsafe impl<T: Sync + Send> Sync for OnceLock<T>;
impl<T: UnwindSafe> UnwindSafe for OnceLock<T>;
```

No longer planned as part of this PR, and moved to the `rust_cell_try` feature gate:

```rust
impl<T> OnceCell<T> {
    pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> where F: FnOnce() -> Result<T, E>;
}

impl<T> OnceLock<T> {
    pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> where F: FnOnce() -> Result<T, E>;
}
```

I am new to this process so would appreciate mentorship wherever needed.
2023-03-30 10:12:23 +00:00
pkubaj
ad60b99835
Drop binutils on powerpc-unknown-freebsd
FreeBSD 13.1 and 13.2 can build Rust with LLD just fine on powerpc.
2023-03-30 07:05:24 +00:00
bors
10338571cf Auto merge of #107221 - kleisauke:getentropy-emscripten, r=ChrisDenton
Use `getentropy()` instead of `/dev/urandom` on Emscripten

`/dev/urandom` is usually available on Emscripten, except when using
the special `NODERAWFS` filesystem backend, which replaces all normal
filesystem access with direct Node.js operations.

Since this filesystem backend directly access the filesystem on the
OS, it is not recommended to depend on `/dev/urandom`, especially
when trying to run the Wasm binary on OSes that are not Unix-based.

This can be considered a non-functional change, since Emscripten
implements `/dev/urandom` in the same way as `getentropy()` when not
linking with `-sNODERAWFS`.
2023-03-30 00:25:41 +00:00
Trevor Gross
dc4ba57566 Stabilize a portion of 'once_cell'
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-29 18:04:44 -04:00
Matthias Krüger
02cb4da896
Rollup merge of #109726 - GuillaumeGomez:doc-hidden-crate, r=notriddle
rustdoc: Don't strip crate module

Until we decide something for https://github.com/rust-lang/rust/issues/109695, rustdoc won't crash anymore because the crate folder doesn't exist.

r? `@notriddle`
2023-03-29 21:19:51 +02:00
Guillaume Gomez
71ff7ef17c Don't strip crate module 2023-03-29 16:17:45 +02:00
Quinn Painter
3811275f09 Switch to LLD as default linker for {arm,thumb}v4t-none-eabi 2023-03-29 12:51:11 +01:00
bors
cf32b9de1e Auto merge of #109720 - Dylan-DPC:rollup-u564m8s, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #108335 (rustdoc + rustdoc-json support for `feature(non_lifetime_binders)`)
 - #109534 (rustdoc: Unsupport importing `doc(primitive)` and `doc(keyword)` modules)
 - #109659 (llvm-wrapper: adapt for LLVM API change)
 - #109664 (Use span of placeholders in format_args!() expansion.)
 - #109683 (Check for overflow in `assemble_candidates_after_normalizing_self_ty`)
 - #109713 (Fix mismatched punctuation in Debug impl of AttrId)
 - #109718 (Rename `IndexVec::last` → `last_index`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-29 09:45:26 +00:00
Kleis Auke Wolthuizen
7b40eb71a9 Update Emscripten on CI to 2.0.5
`getentropy()` is available since Emscripten 2.0.5.

See:
https://github.com/emscripten-core/emscripten/pull/12240
2023-03-29 11:26:58 +02:00
Dylan DPC
1db9eae033
Rollup merge of #109534 - petrochenkov:noprimuse, r=GuillaumeGomez
rustdoc: Unsupport importing `doc(primitive)` and `doc(keyword)` modules

These are internal features used for a specific purpose, and modules without imports are enough for that purpose.
2023-03-29 14:07:27 +05:30
Dylan DPC
777df024b1
Rollup merge of #108335 - compiler-errors:non_lifetime_binders-rustdoc, r=GuillaumeGomez
rustdoc + rustdoc-json support for `feature(non_lifetime_binders)`

Makes `for<T> T: Trait` and `for<const N: usize> ..` in where clause operate correctly.

Fixes #108158
2023-03-29 14:07:26 +05:30
bors
f346fb0bc6 Auto merge of #108792 - Amanieu:ohos, r=petrochenkov
Add OpenHarmony targets

- `aarch64-unknown-linux-ohos`
- `armv7-unknown-linux-ohos`

Compiler team MCP: https://github.com/rust-lang/compiler-team/issues/568
2023-03-29 07:16:16 +00:00
Kai Luo
d3cc2f7646 Use LIBPATH in compiletest 2023-03-29 14:55:30 +08:00
Michael Goulet
be9fd75d32 rustdoc + rustdoc-json support for non_lifetime_binders 2023-03-28 16:50:49 +00:00
Amanieu d'Antras
e3968be331 Add OpenHarmony targets
- `aarch64-unknown-linux-ohos`
- `armv7-unknown-linux-ohos`
2023-03-28 16:01:13 +01:00
Vadim Petrochenkov
52b15b4bf9 rustdoc: Unsupport importing doc(primitive) and doc(keyword) modules
These are internal features used for a specific purpose, and modules without imports are enough for that purpose.
2023-03-28 17:31:39 +04:00
nils
857b631616
Rollup merge of #91793 - devnexen:anc_data_fbsd, r=ChrisDenton
socket ancillary data implementation for FreeBSD (from 13 and above).

introducing new build config as well.
2023-03-28 12:51:10 +02:00
bors
f418859d8a Auto merge of #109690 - matthiaskrgr:rollup-6p5m0es, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #108548 (Clarify the 'use a constant in a pattern' error message)
 - #109565 (Improve documentation for E0223)
 - #109661 (Fix LVI test post LLVM 16 update)
 - #109667 (Always set `RUSTC_BOOTSTRAP` with `x doc`)
 - #109669 (Update books)
 - #109678 (Don't shadow the `dep_node` var in `incremental_verify_ich_failed`)
 - #109682 (Add `#[inline]` to CStr trait implementations)
 - #109685 (Make doc comment a little bit more accurate)
 - #109687 (Document the heuristics IsTerminal uses on Windows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-28 07:02:21 +00:00
Matthias Krüger
c1ed1180f7
Rollup merge of #109669 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/nomicon

1 commits in 1f3e4cd4fd88b5b5d45feb86a11b6d2f93e5a974..b5f7500fc40775096c2bbd204eae096612cf9047
2023-03-27 13:47:36 UTC to 2023-03-27 13:47:36 UTC

- Fix typo in 3.8 Subtyping and Variance (rust-lang/nomicon#395)

## rust-lang/reference

4 commits in 24c87f6663aed55b05d2cc286878f28f21918825..3c47807a3131b3c7cacb508f52632078d253cd0a
2023-03-26 18:42:43 UTC to 2023-03-14 18:28:23 UTC

- Relax ordering rules for `asm!` operands (rust-lang/reference#1323)
- Improve labeled blocks documentation (rust-lang/reference#1342)
- Inline assembly: Fix repeated and unordered items in guaranteed directives (rust-lang/reference#1341)
- Clarify that free constants are always evaluated at compile time (rust-lang/reference#1328)

## rust-lang/rust-by-example

7 commits in af0998b7473839ca75563ba3d3e7fd0160bef235..cfbfd648ce33926c3490f24de9a5b56cce404b88
2023-03-21 12:05:17 UTC to 2023-03-21 11:58:20 UTC

- Fix two typos in the asm chapter (rust-lang/rust-by-example#1692)
- Change `runtime` error to `compile time` error (rust-lang/rust-by-example#1690)
- Fix tests running on non-x86 platforms. (rust-lang/rust-by-example#1687)
- Remove trailing semicolon from macro expression (rust-lang/rust-by-example#1683)
- Explained why it should not work in Chapter 4.1 (rust-lang/rust-by-example#1682)
- Fix comment to mention the correct type of error (rust-lang/rust-by-example#1680)
- Improve the content for `read_lines` (rust-lang/rust-by-example#1679)

## rust-lang/rustc-dev-guide

9 commits in b1b6d693cd1461e53de4132c1b183ace31cd36e5..d08baa166b463537229eeb737c4ccadabd83cf78
2023-03-26 17:55:53 UTC to 2023-03-14 03:50:20 UTC

- Add locale_resources (rust-lang/rustc-dev-guide#1651)
- Don't require $GITHUB_TOKEN to build locally (rust-lang/rustc-dev-guide#1652)
- bootsrapping stages overview list (rust-lang/rustc-dev-guide#1555)
- Update labels overview (rust-lang/rustc-dev-guide#1639)
- first mention of type, and add a link (rust-lang/rustc-dev-guide#1643)
- Add SIP solution for macOS users (rust-lang/rustc-dev-guide#1636)
- Add chapter on fuzzing (rust-lang/rustc-dev-guide#1646)
- Fix "Crate disambiguator" in libs-and-metadata.md (rust-lang/rustc-dev-guide#1648)
- Update rustdoc-internals.md (rust-lang/rustc-dev-guide#1644)
2023-03-28 07:01:10 +02:00
Matthias Krüger
1af75b1e96
Rollup merge of #109667 - clubby789:fix-stage0-doc, r=ozkanonur
Always set `RUSTC_BOOTSTRAP` with `x doc`

Fixes #100060

Note that there is still a warning - the `unused_allocation` lint does not fire in stage 0, but that's just a matter of waiting for #104363 to land in beta
2023-03-28 07:01:10 +02:00
Matthias Krüger
a7c07cf731
Rollup merge of #108548 - jamen:master, r=compiler-errors
Clarify the 'use a constant in a pattern' error message

```rs
use std::borrow::Cow;

const ERROR_CODE: Cow<'_, str> = Cow::Borrowed("23505");

fn main() {
    let x = Cow::from("23505");

    match x {
        ERROR_CODE => {}
    }
}
```
```
error: to use a constant of type `Cow` in a pattern, `Cow` must be annotated with `#[derive(PartialEq, Eq)]`
 --> src/main.rs:9:9
  |
9 |         ERROR_CODE => {}
  |         ^^^^^^^^^^

error: could not compile `playground` due to previous error
```

It seems helpful to link to StructuralEq in this message. I was a little confused, because `Cow<'_, str>` implements PartialEq and Eq, but they're not derived, which I learned is necessary for structural equality and using constants in patterns (thanks to the Rust community Discord server)

For tests, should I update every occurrence of this message? I see tests where this is still a warning and I'm not sure if I should update those.
2023-03-28 07:01:08 +02:00
bors
cbc064b341 Auto merge of #109577 - jonhoo:long-tar-names, r=Mark-Simulacrum
[rust-installer] Allow long link names in tar files

Without this, users trying to run `x.py dist` under a sufficiently long path run into problems when we build the resulting tarballs due to length limits in the original tar spec. The error looks like:

        Finished release [optimized + debuginfo] target(s) in 0.34s
    Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-musl)
    Building stage0 tool rust-installer (x86_64-unknown-linux-gnu)
        Finished release [optimized] target(s) in 0.35s
    Dist rust-std-1.67.1-x86_64-unknown-linux-musl
    Error: failed to generate installer

    Caused by:
        0: failed to tar file '/home/AAAAAAAAAAAAAA/BBBBBB/CCCC/DDD/EEEEE/FFFFFFFFFFFF/GGGGGGGGGGGGGGGG/HHHHHHHHHH/IIIIIIIIIIIIIII/JJJJJ/KKKKKKK/src/build/tmp/tarball/rust-std/x86_64-unknown-linux-musl/rust-std-1.67.1-x86_64-unknown-linux-musl/rust-std-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/libc.a'
        1: provided value is too long when setting link name for
    Build completed unsuccessfully in 0:00:03

The fix is to make use of the widely-supported GNU tar extensions which lift this restriction. Switching to [`tar::Builder::append_link`] takes care of that for us. See also alexcrichton/tar-rs#273.

[`tar::Builder::append_link`]: https://docs.rs/tar/0.4.38/tar/struct.Builder.html#method.append_link
2023-03-28 04:24:24 +00:00
Kai Luo
b56fcb173b Set LIBPATH 2023-03-28 10:59:45 +08:00
Michael Goulet
8b592db27a Add (..) syntax for RTN 2023-03-28 01:14:28 +00:00
bors
5ce70ed8da Auto merge of #109561 - raphamorim:master, r=cuviper
Use llvm 16.0.0 instead of 16.0.0-rc4 for build-clang.sh

Ref: https://github.com/rust-lang/rust/pull/107224

This PR doesn't make any update on LLVM submodule used by Rust repo, but would be super keen to update it, if necessary (https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html). LLVM 16.0.0 has been [released](https://discourse.llvm.org/t/llvm-16-0-0-release/69326) on March 18, while Rust 1.70 will become stable on June 1.

- https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html
2023-03-28 01:03:27 +00:00
bors
5bf139e360 Auto merge of #109440 - WaffleLapkin:make_tidy_slower, r=jyn514
Don't skip all directories when tidy-checking

This fixes a regression from https://github.com/rust-lang/rust/pull/108772 which basically made it that tidy style checks only `README.md` and `COMPILER_TESTS.md`.
2023-03-27 22:19:56 +00:00
Maybe Waffle
904dd2c398 Bless tidy 2023-03-27 18:58:07 +00:00
Maybe Waffle
8af42f695d Remove useless Clone bounds 2023-03-27 18:52:47 +00:00
Maybe Waffle
436afdf1fe Don't skip all directories when tidy-checking 2023-03-27 18:52:47 +00:00
rustbot
7cba12c5a9 Update books 2023-03-27 13:00:59 -04:00
Guillaume Gomez
df453d9528
Rollup merge of #109445 - Teapot4195:issue-109407-fix, r=ozkanonur
Allow passing the --nocapture flag to compiletest

closes #109407
2023-03-27 18:56:20 +02:00
Guillaume Gomez
b1e8be783f
Rollup merge of #109354 - Swatinem:rm-closureid, r=compiler-errors
Remove the `NodeId` of `ast::ExprKind::Async`

This is a followup to https://github.com/rust-lang/rust/pull/104833#pullrequestreview-1314537416.

In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`.
It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
2023-03-27 18:56:19 +02:00
Guillaume Gomez
52c8084f91
Rollup merge of #109330 - GuillaumeGomez:intermediate-reexport-intra-doc-ice, r=petrochenkov
rustdoc: Fix ICE for intra-doc link on intermediate re-export

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

This PR is based on #109266 as it includes its commit to make this work.

`@petrochenkov:` It was exactly as you predicted, adding the `DefId` to the attributes fixed the error for intermediate re-exports as well. Thanks a lot!

r? `@petrochenkov`
2023-03-27 18:56:19 +02:00
clubby789
9fc7eca935 Always set RUSTC_BOOTSTRAP with x doc 2023-03-27 17:12:18 +01:00
David CARLIER
ed5c0f66ac socket ancillary data implementation for FreeBSD (from 13 and above).
introducing new build config as well.
2023-03-27 16:48:41 +01:00
Jamen Marz
73c34cbaf7 Add notes to non-structural const in pattern error message 2023-03-27 11:08:11 -04:00
Matthias Krüger
297e3a1dae
Rollup merge of #109656 - weihanglo:update-cargo, r=weihanglo
Update cargo

9 commits in 15d090969743630bff549a1b068bcaa8174e5ee3..145219a9f089f8b57c09f40525374fbade1e34ae 2023-03-21 17:54:28 +0000 to 2023-03-27 01:56:36 +0000
- doc(contrib): missing quotation mark (rust-lang/cargo#11894)
- Update changelog for 1.68.2 (rust-lang/cargo#11893)
- Add the old github keys as revoked (rust-lang/cargo#11889)
- Update proptest (rust-lang/cargo#11886)
- Added new GitHub RSA Host Key (rust-lang/cargo#11883)
- doc: Fix registries.name.index for sparse (rust-lang/cargo#11880)
- docs(contrib): Replace architecture with redirects (rust-lang/cargo#11876)
- docs: fix typos in `cargo_compile/mod.rs` (rust-lang/cargo#11874)
- docs(contrub): Remove unused file (rust-lang/cargo#11873)

r? `@ghost`
2023-03-27 15:32:43 +02:00
Matthias Krüger
3917644b0e
Rollup merge of #109418 - rohaquinlop:108240-rename-native.rs-to-llvm.rs, r=Mark-Simulacrum
Rename 'src/bootstrap/native.rs' to llvm.rs

Fixed #108240

Renamed 'native.rs' to 'llvm.rs', also moved `TestHelpers` to `test.rs`. Replaced all the `native.rs` occurrences at `src/bootstrap` files to `llvm.rs`
2023-03-27 15:32:41 +02:00
Matthias Krüger
84a7540a83
Rollup merge of #108625 - jyn514:config-toml-cleanups, r=albertlarsan68
More config.toml.example cleanups

- Link to more documentation
- Move `changelog-seen` into the "Global Settings" section
- Update incorrect comments on `llvm.link-shared` and `rust.debug-assertions`
- Use the correct default in the commented-out example more often
- Clarify that `docs` and `compiler-docs` only control the default, they're not a hard-off switch.
- Document `-vvv` and `local-rebuild`
- Minor improvements to doc-comments in config.toml.example

This also sets `download-rustc = false`; that was already the default, but it will be helpful in case the default changes (https://jyn.dev/2023/01/12/Bootstrapping-Rust-in-2023.html).
2023-03-27 15:32:40 +02:00
Joshua Nelson
20ca24e3c5 More config.toml.example cleanups
- Link to more documentation
- Move `changelog-seen` into the "Global Settings" section
- Update incorrect comments on `llvm.link-shared` and
  `rust.debug-assertions`
- Use the correct default in the commented-out example more often
- Clarify that `docs` and `compiler-docs` only control the default,
  they're not a hard-off switch.
- Document `-vvv` and `local-rebuild`
- Minor improvements to doc-comments in config.toml.example

This also sets `download-rustc = false`; that was already the default,
but it will be helpful in case the default changes
(https://jyn.dev/2023/01/12/Bootstrapping-Rust-in-2023.html).
2023-03-27 07:07:49 -05:00
Weihang Lo
24369232cc
Update cargo
9 commits in 15d090969743630bff549a1b068bcaa8174e5ee3..145219a9f089f8b57c09f40525374fbade1e34ae
2023-03-21 17:54:28 +0000 to 2023-03-27 01:56:36 +0000
- doc(contrib): missing quotation mark (rust-lang/cargo#11894)
- Update changelog for 1.68.2 (rust-lang/cargo#11893)
- Add the old github keys as revoked (rust-lang/cargo#11889)
- Update proptest (rust-lang/cargo#11886)
- Added new GitHub RSA Host Key (rust-lang/cargo#11883)
- doc: Fix registries.name.index for sparse (rust-lang/cargo#11880)
- docs(contrib): Replace architecture with redirects (rust-lang/cargo#11876)
- docs: fix typos in `cargo_compile/mod.rs` (rust-lang/cargo#11874)
- docs(contrub): Remove unused file (rust-lang/cargo#11873)
2023-03-27 16:06:25 +08:00
Matthias Krüger
6535e66fa5
Rollup merge of #109641 - compiler-errors:dont-elaborate-non-obl, r=oli-obk
Don't elaborate non-obligations into obligations

It's suspicious to elaborate a `PolyTraitRef` or `Predicate` into an `Obligation`, since the former does not have a param-env associated with it, but the latter does. This is a footgun that, while not being misused *currently* in the compiler, easily could be misused by someone less familiar with the elaborator's inner workings.

This PR just changes the API -- ideally, the elaborator wouldn't even have to deal with obligations if we're not elaborating obligations, but that would require a bit more abstraction than I could be bothered with today.
2023-03-27 08:46:55 +02:00
Matthias Krüger
b39db705f5
Rollup merge of #109633 - GuillaumeGomez:fix-go-to-only-setting, r=notriddle
Fix "Directly go to item in search if there is only one result" setting

Part of #66181.

The setting was actually broken, so I fixed it when I added the GUI test.

r? `@notriddle`
2023-03-27 08:46:53 +02:00
Lenko Donchev
88b3ae9690 check for missing codegen backeng config 2023-03-26 23:46:09 -05:00
Nikita Popov
dd7db8b1df Limit to one job on mingw builders
This is another attempt to work around
https://github.com/rust-lang/rust/issues/108227.

By limiting to one link job, we should be able to avoid file name
clashes in mkstemp().
2023-03-26 23:52:59 +02:00
Michael Goulet
1ce4b37900 Don't elaborate non-obligations into obligations 2023-03-26 20:33:54 +00:00
Guillaume Gomez
28982a1e47 Fix "Directly go to item in search if there is only one result" setting 2023-03-26 17:50:09 +02:00
Alex Huang
2fe4cad77f Allow passing the --nocapture flag to compiletest 2023-03-26 09:45:53 -04:00
bors
89c2e3d3d7 Auto merge of #109626 - matthiaskrgr:rollup-k0y7bdd, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #109007 (rustdoc: skip `// some variants omitted` if enum is `#[non_exhaustive]`)
 - #109593 (Rustdoc Book refer to rustdoc::missing_doc_code_examples. Fixes #109592.)
 - #109595 (Improve "Auto-hide trait implementation documentation" GUI test)
 - #109619 (Still-further-specializable projections are ambiguous in new solver)
 - #109620 (Correct typo (`back_box` -> `black_box`))
 - #109621 (Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-26 12:05:38 +00:00
Matthias Krüger
623c4c8881
Rollup merge of #109593 - coop-rs:missing_doc_code_examples, r=GuillaumeGomez
Rustdoc Book refer to rustdoc::missing_doc_code_examples. Fixes #109592.

Fixes #109592. But, please see a related question at #109592 (item `2.`).
2023-03-26 08:39:26 +02:00
bors
2420bd34ba Auto merge of #106428 - saethlin:inline-diverging-functions, r=cjgillot
Permit the MIR inliner to inline diverging functions

This heuristic prevents inlining of `hint::unreachable_unchecked`, which in turn makes `Option/Result::unwrap_unchecked` a bad inlining candidate. I looked through the changes to `core`, `alloc`, `std`, and `hashbrown` by hand and they all seem reasonable. Let's see how this looks in perf...

---

Based on rustc-perf it looks like this regresses ctfe-stress, and the cachegrind diff indicates that this regression is in `InterpCx::statement`. I don't know how to do any deeper analysis because that function is _enormous_ in the try toolchain, which has no debuginfo in it. And a local build produces significantly different codegen for that function, even with LTO.
2023-03-26 05:55:32 +00:00
Ezra Shaw
e0ec9c0b9c
rustdoc: tweak some variants omitted
Don't display `// some variants omitted` if enum is marked
`#[non_exhaustive]`
2023-03-26 18:05:42 +13:00
bors
0c61c7a978 Auto merge of #109474 - nikic:llvm-16-again, r=cuviper
Upgrade to LLVM 16, again

Relative to the previous attempt in https://github.com/rust-lang/rust/pull/107224:
 * Update to GCC 8.5 on dist-x86_64-linux, to avoid std::optional ABI-incompatibility between libstdc++ 7 and 8.
 * Cherry-pick 96df79af02.
 * Cherry-pick 6fc670e5e3.

r? `@cuviper`
2023-03-25 19:55:10 +00:00
Peter Kehl
1491c6f311 Rustdoc Book refer to rustdoc::missing_doc_code_examples. Fixes #109592. 2023-03-25 06:19:52 -07:00
Matthias Krüger
31df7f1ecd
Rollup merge of #109568 - RalfJung:miri-raw-ptr-dyn, r=oli-obk
miri: fix raw pointer dyn receivers

r? `@oli-obk`
Fixes https://github.com/rust-lang/miri/issues/2786
2023-03-25 03:37:12 +01:00
Matthias Krüger
8c8305843b
Rollup merge of #109542 - notriddle:notriddle/storage-js, r=GuillaumeGomez
rustdoc: clean up `storage.js`
2023-03-25 03:37:11 +01:00
Matthias Krüger
65220b5ba9
Rollup merge of #109484 - fortanix:raoul/bugfix_libtest_json_output, r=pietroalbini
Bugfix: avoid panic on invalid json output from libtest

#108659 introduces a custom test display implementation. It does so by using libtest to output json. The stdout is read and parsed; The code trims the line read and checks whether it starts with a `{` and ends with a `}`. If so, it concludes that it must be a json encoded `Message`. Unfortunately, this does not work in all cases:

- This assumes that tests running with `--nocapture` will never start and end lines with `{` and `}` characters
- Output is generated by issuing multiple `write_message` [statements](https://github.com/rust-lang/rust/blob/master/library/test/src/formatters/json.rs#L33-L60). Where only the last one issues a `\n`. This likely results in a race condition as we see multiple json outputs on the same line when running tests for the `x86_64-fortanix-unknown-sgx` target:
```
10:21:04      Running tests/run-time-detect.rs (build/x86_64-unknown-linux-gnu/stage1-std/x86_64-fortanix-unknown-sgx/release/deps/run_time_detect-8c66026bd4b1871a)
10:21:04
10:21:04 running 1 tests
10:21:04 test x86_all ... ok
10:21:04      Running tests/thread.rs (build/x86_64-unknown-linux-gnu/stage1-std/x86_64-fortanix-unknown-sgx/release/deps/thread-ed5456a7d80a6193)
10:21:04 thread 'main' panicked at 'failed to parse libtest json output; error: trailing characters at line 1 column 135, line: "{ \"type\": \"suite\", \"event\": \"ok\", \"passed\": 1, \"failed\": 0, \"ignored\": 0, \"measured\": 0, \"filtered_out\": 0, \"exec_time\": 0.000725911 }{ \"type\": \"suite\", \"event\": \"started\", \"test_count\": 1 }\n"', render_tests.rs:108:25
```

This PR implements a partial fix by being much more conservative of what it asserts is a valid json encoded `Message`. This prevents panics, but still does not resolve the race condition. A discussion is needed where this race condition comes from exactly and how it best can be avoided.

cc: `@jethrogb,` `@pietroalbini`
2023-03-25 03:37:10 +01:00
Jon Gjengset
4d5501037a Allow long link names in tar files
Without this, users trying to run `x.py dist` under a sufficiently long
path run into problems when we build the resulting tarballs due to
length limits in the original tar spec. The error looks like:

        Finished release [optimized + debuginfo] target(s) in 0.34s
    Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-musl)
    Building stage0 tool rust-installer (x86_64-unknown-linux-gnu)
        Finished release [optimized] target(s) in 0.35s
    Dist rust-std-1.67.1-x86_64-unknown-linux-musl
    Error: failed to generate installer

    Caused by:
        0: failed to tar file '/home/AAAAAAAAAAAAAA/BBBBBB/CCCC/DDD/EEEEE/FFFFFFFFFFFF/GGGGGGGGGGGGGGGG/HHHHHHHHHH/IIIIIIIIIIIIIII/JJJJJ/KKKKKKK/src/build/tmp/tarball/rust-std/x86_64-unknown-linux-musl/rust-std-1.67.1-x86_64-unknown-linux-musl/rust-std-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/libc.a'
        1: provided value is too long when setting link name for
    Build completed unsuccessfully in 0:00:03

The fix is to make use of the widely-supported GNU tar extensions which
lift this restriction. Switching to [`tar::Builder::append_link`] takes
care of that for us. See also alexcrichton/tar-rs#273.

[`tar::Builder::append_link`]: https://docs.rs/tar/0.4.38/tar/struct.Builder.html#method.append_link
2023-03-24 17:44:32 -07:00