about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-04-04Rollup merge of #109889 - ferrocene:pa-update-books, r=ehussYuki Okushi-0/+0
Update book, rustc-dev-guide, rust-by-example Changes from `rust-lang/book`: * https://github.com/rust-lang/book/pull/3598 Changes from `rust-lang/rust-by-example`: * https://github.com/rust-lang/rust-by-example/pull/1695 * https://github.com/rust-lang/rust-by-example/pull/1694 * https://github.com/rust-lang/rust-by-example/pull/1693 * https://github.com/rust-lang/rust-by-example/pull/1688 * https://github.com/rust-lang/rust-by-example/pull/1696 Changes from `rust-lang/rustc-dev-guide`: * https://github.com/rust-lang/rustc-dev-guide/pull/1655 * https://github.com/rust-lang/rustc-dev-guide/pull/1657 * https://github.com/rust-lang/rustc-dev-guide/pull/1659 * https://github.com/rust-lang/rustc-dev-guide/compare/d436bf134e2262dcd3527877964c9df589bf631c...fca8af6c154c6cde2512f1331cf2704f214a818e r? `@ehuss`
2023-04-03update rust-by-examplePietro Albini-0/+0
2023-04-03update rustc dev guidePietro Albini-0/+0
2023-04-03update bookPietro Albini-0/+0
2023-04-03Auto merge of #109884 - matthiaskrgr:rollup-5wapig9, r=matthiaskrgrbors-6/+66
Rollup of 7 pull requests Successful merges: - #109526 (LIBPATH is used as dylib's path environment variable on AIX) - #109642 (check for missing codegen backeng config) - #109722 (Implement read_buf for RustHermit) - #109856 (fix(middle): emit error rather than delay bug when reaching limit) - #109868 (Improve PR job names in Github Actions preview) - #109871 (Include invocation start times) - #109873 (Move some UI tests into subdirectories) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-03Rollup merge of #109873 - jyn514:subdirectories, r=compiler-errorsMatthias Krüger-1/+1
Move some UI tests into subdirectories
2023-04-03Rollup merge of #109871 - Mark-Simulacrum:metrics-timestamp, r=ozkanonurMatthias Krüger-1/+12
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-03Rollup merge of #109868 - jyn514:ci-names, r=Mark-SimulacrumMatthias Krüger-3/+3
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-03Rollup merge of #109642 - ↵Matthias Krüger-1/+43
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-03Rollup merge of #109526 - bzEq:aix-libpath, r=Mark-SimulacrumMatthias Krüger-0/+7
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-03Auto merge of #108288 - ozkanonur:hotfix-90244, r=Mark-Simulacrumbors-0/+7
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-02Move some UI tests into subdirectoriesjyn-1/+1
to avoid going over the existing limit now that the ui-fulldeps tests have been moved to ui.
2023-04-02Include invocation start timesMark Rousskov-1/+12
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-02Improve job names in Github Actions previewjyn-3/+3
Before: `CI / PR (mingw-check, false, ubuntu-20.04-16core-64gb) (pull_request)` After: `CI / PR - mingw-check (pull_request)`
2023-04-02fix `build --stage 2 compiler/rustc` panicozkanonur-0/+7
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-02Auto merge of #109811 - jyn514:symlink-fixes, r=Mark-Simulacrumbors-11/+12
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-02Replace any existing `build/host` symlinkJynn Nelson-11/+12
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-02Rollup merge of #109844 - matthiaskrgr:clippy2023_04, r=NilstriebNilstrieb-15/+7
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-01Auto merge of #109833 - klensy:bs-tty, r=Mark-Simulacrumbors-38/+42
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-01a couple clippy::complexity fixesMatthias Krüger-15/+7
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-01Update cargoEric Huss-0/+0
2023-04-01bootstrap replace atty with is-terminal, dedupe few depsklensy-38/+42
2023-04-01Auto merge of #109721 - QuinnPainter:armv4t-lld, r=petrochenkovbors-7/+0
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-03-31Auto merge of #109824 - GuillaumeGomez:rollup-i5r4uts, r=GuillaumeGomezbors-183/+269
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-31Rollup merge of #109820 - notriddle:notriddle/help-comma, r=camelidGuillaume Gomez-3/+1
rustdoc-search: update docs for comma in `?` help popover
2023-03-31Rollup merge of #109818 - GuillaumeGomez:test-collapsed-item, r=notriddleGuillaume Gomez-1/+1
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-31Rollup merge of #109443 - GuillaumeGomez:doc-primitive-hard-error, r=notriddleGuillaume Gomez-37/+25
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-31Rollup merge of #109104 - ↵Guillaume Gomez-142/+242
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-31Auto merge of #109010 - compiler-errors:rtn, r=eholkbors-14/+11
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` :heavy_check_mark: 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-31rustdoc-search: update docs for comma in `?` help popoverMichael Howell-3/+1
2023-03-31Update browser-ui-test version to 0.14.6Guillaume Gomez-1/+1
2023-03-31Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obkbors-11/+53
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-30Improve codeGuillaume Gomez-14/+5
2023-03-30Update documentation for rustc_doc_primitiveGuillaume Gomez-3/+3
2023-03-30Replace doc(primitive) with rustc_doc_primitiveGuillaume Gomez-26/+23
2023-03-30Auto merge of #108576 - ↵bors-0/+3
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-30rustdoc: run more HIR validation to mirror rustcPatrik Kårlin-0/+3
2023-03-30Auto merge of #109769 - JohnTitor:rollup-7n2bnpg, r=JohnTitorbors-8/+36
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-30Rollup merge of #109766 - Amanieu:ohos-title, r=JohnTitorYuki Okushi-1/+1
Fix title for openharmony.md
2023-03-30Rollup merge of #109761 - pkubaj:patch-1, r=ozkanonurYuki Okushi-5/+0
Drop binutils on powerpc-unknown-freebsd FreeBSD 13.1 and 13.2 can build Rust with LLD just fine on powerpc.
2023-03-30Rollup merge of #109509 - ehuss:overlapping-tests, r=Mark-SimulacrumYuki Okushi-2/+35
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-30Fix title for openharmony.mdAmanieu d'Antras-1/+1
2023-03-30Auto merge of #105587 - tgross35:once-cell-min, r=m-ou-sebors-9/+6
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-30Drop binutils on powerpc-unknown-freebsdpkubaj-5/+0
FreeBSD 13.1 and 13.2 can build Rust with LLD just fine on powerpc.
2023-03-30Auto merge of #107221 - kleisauke:getentropy-emscripten, r=ChrisDentonbors-2/+2
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-29Stabilize a portion of 'once_cell'Trevor Gross-9/+6
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-29Rollup merge of #109726 - GuillaumeGomez:doc-hidden-crate, r=notriddleMatthias Krüger-2/+7
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-29Don't strip crate moduleGuillaume Gomez-2/+7
2023-03-29Switch to LLD as default linker for {arm,thumb}v4t-none-eabiQuinn Painter-7/+0
2023-03-29Auto merge of #109720 - Dylan-DPC:rollup-u564m8s, r=Dylan-DPCbors-46/+40
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