about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-01-03Rollup merge of #106411 - notriddle:notriddle/font-feature-settings, ↵Michael Goulet-4/+0
r=GuillaumeGomez rustdoc: remove legacy font-feature-settings CSS According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985]. * The last version of Chrome that required a vendor prefix was version 47. The current version is 108. * Firefox 33 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 9.1. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 9.3. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=font-feature-settings [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03Rollup merge of #106381 - aDotInTheVoid:jsondoclint-more-options, r=notriddleMichael Goulet-33/+103
Jsondoclint: Add `--verbose` and `--json-output` options There quite helpful for manually using jsondoclint as a debugging tool, especially on large files (these were written to look into core.json). r? rustdoc
2023-01-03Rollup merge of #106353 - lukas-code:reduce-red-lines-in-my-ide, r=wesleywiserMichael Goulet-26/+12
Reduce spans for `unsafe impl` errors Because huge spans aren't great for IDEs. Prior art: https://github.com/rust-lang/rust/pull/103749
2023-01-03Rollup merge of #106157 - ↵Michael Goulet-0/+21
LeSeulArtichaut:106126-thir-unsafeck-good-path-bug-2, r=compiler-errors Don't trim path for `unsafe_op_in_unsafe_fn` lints Fixes #106126, alternative to #106127. r? `@ghost` for now.
2023-01-03Rollup merge of #104748 - lqd:download_lld, r=jyn514Michael Goulet-10/+26
Ensure `lld` is supported with `download-ci-llvm` This PR: - ensures LLD's step in bootstrap's dist, but it's not strictly necessary since dist will already package it when it's present. - makes bootstrap's `native::LLD` step support using the packaged `ci-llvm/bin/lld`, instead of building it from source (which would most likely not be available today, nor in the future where `download-ci-llvm = if-available` is the default). If I understand correctly, `--enable-full-tools` will also enable `rust.lld`, and this is why LLD is already packaged today in the `rust-dev` component on the main targets (and why `-Zgcc-ld=lld` does work there). That means it's likely that this PR will not be able to land before I've reworked and landed #101792: if LLD is available in `download-ci-llvm`, the `needs-rust-lld` tests should start being executed on the x64 macOS test builders, and CI would fail today. I've tested locally that building with `download-ci-llvm = true` and `lld = true` with the LLVM submodule unregistered was successful, and that `rust-lld` and the various `lld-wrapper`s are present and `-Zgcc-ld=lld` works as well, on a few different platforms: - `x86_64-unknown-linux-gnu` - `aarch64-apple-darwin` - `x86_64-pc-windows-msvc` (with `-Clinker=rust-lld` rather than `-Zgcc-ld=lld`) - `x86_64-apple-darwin`, with the `MACOSX_DEPLOYMENT_TARGET` workaround for #101653 I don't think we really need to bump the `download-ci-llvm-stamp` in this case, since `./build/$triple/ci-llvm/bin/lld` is present on all the above targets already, but have added it mechanically, and it should probably be removed to avoid unnecessary downloads/churn. Fixes #98340 Supersedes #100010
2023-01-03ensure lld's step unconditionally for RustDev componentRémy Rakic-5/+2
2023-01-03bump download-ci-llvm-stampRémy Rakic-1/+1
2023-01-03turn a comment into an actual doc commentRémy Rakic-7/+7
2023-01-03slight cleanupRémy Rakic-2/+1
2023-01-03make the `native::LLD` step able to use an already built lldRémy Rakic-0/+14
Makes the lld step avoid building it from source when possible: when dist has packaged it along the other LLVM binaries for the rust-dev component.
2023-01-03bootstrap dist: ensure LLD's stepRémy Rakic-0/+6
2023-01-03rustdoc: remove legacy font-feature-settings CSSMichael Howell-4/+0
According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985]. * The last version of Chrome that required a vendor prefix was version 47. The current version is 108. * Firefox 33 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 9.1. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 9.3. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=font-feature-settings [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03Rollup merge of #106402 - Rageking8:fix_dupe_word_typos, r=NilstriebMatthias Krüger-1/+1
Fix dupe word typos r? `@Nilstrieb` Thanks!
2023-01-03Rollup merge of #106388 - notriddle:notriddle/box-sizing, r=camelidMatthias Krüger-2/+0
rustdoc: remove legacy box-sizing CSS According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985] * The last version of Chrome that required a vendor prefix was version 9. The current version is 108. * Firefox 28 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 5. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 4. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=box-sizing [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03Rollup merge of #106365 - gimbles:patch-1, r=jyn514Matthias Krüger-10/+10
Grammar : Missing "is" in format specifier diagnostic
2023-01-03Rollup merge of #106356 - aDotInTheVoid:del-ctor-kind, r=jyn514Matthias Krüger-13/+1
clean: Remove `ctor_kind` from `VariantStruct`. It's always `None`. r? `@ghost`
2023-01-03Rollup merge of #106005 - LeSeulArtichaut:if-let-guard-borrowck-test, ↵Matthias Krüger-62/+645
r=Nilstrieb Test the borrowck behavior of if-let guards Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`. This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419. cc `@pnkfelix` are there any other tests that you would want to see? cc tracking issue #51114
2023-01-03Rollup merge of #104552 - DebugSteven:warn-newer-x, r=jyn514Matthias Krüger-3/+79
warn newer available version of the x tool This PR adds a check to `tidy` to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It adds a `--wrapper-version` argument to `x` to determine the version at runtime, . It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.
2023-01-03clean: Remove `ctor_kind` from `VariantStruct`.Nixon Enraght-Moony-13/+1
It's always `None`.
2023-01-03jsondoclint: Add option to dump errors as json.Nixon Enraght-Moony-4/+25
The output looks like: { "errors": [ { "id": "2:2017:1833", "kind": { "NotFound": [ [ {"Field": "index"}, {"Field": "0:0:1571"}, {"Field": "links"}, {"Field": "pointer::read"} ] ] } } ], "path": "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/intra-doc-links/pointer_method/pointer_method.json" }
2023-01-03jsondoclint: Find selector for missing ID when error is created, not reported.Nixon Enraght-Moony-42/+64
This is needed for json output, but even without that, it increases performance massivly. On my machine, in reduces the time to check core.json from 40.190s to 11.333s.
2023-01-03jsondoclint: Add `--verbose` flag.Nixon Enraght-Moony-6/+26
Without verbose: 0:61941:36627 not in index or paths, but refered to at '$.index["0:62007"].inner.for.inner.id' and 12 more With verbose: 0:10808:27206 not in index or paths, but refered to at '$.index["0:10813"].inner.for.inner.id', '$.index["0:52495"].inner.for.inner.id', '$.index["a:0:2666:215-0:10808:27206"].inner.for.inner.id', '$.index["a:0:2680:223-0:10808:27206"].inner.for.inner.id', '$.index["a:0:2730:7845-0:10808:27206"].inner.for.inner.id', '$.index["a:0:7731:21706-0:10808:27206"].inner.for.inner.id', '$.index["a:0:7732:21705-0:10808:27206"].inner.for.inner.id'
2023-01-03jsondoclint: Parse args with clap.Nixon Enraght-Moony-4/+11
2023-01-03Auto merge of #105609 - bjorn3:shrink_rustc_dev, r=jyn514bors-10/+161
Only include metadata for non-dynamic libraries in rustc-dev The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage. Fixes https://github.com/rust-lang/rust/issues/103538
2023-01-03fix dupe word typosRageking8-1/+1
2023-01-03Auto merge of #106371 - RalfJung:no-ret-position-noalias, r=nikicbors-1/+1
do not add noalias in return position `noalias` as a return attribute in LLVM indicates that the returned pointer does not alias anything else that is reachable from the caller, *including things reachable before this function call*. This is clearly not the case with a function like `fn id(Box<T>) -> Box<T>`, so we cannot use this attribute. Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/385 (including an actual miscompilation that `@comex` managed to produce).
2023-01-02no_depsJ Haigh-0/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2023-01-02use cargo_metadata to get x versionDebugSteven-28/+11
2023-01-03Auto merge of #106386 - compiler-errors:rollup-dxjv18b, r=compiler-errorsbors-211/+757
Rollup of 8 pull requests Successful merges: - #95985 (Add PhantomData marker to Context to make Context !Send and !Sync) - #104298 (Add notes and examples about non-intuitive `PathBuf::set_extension` behavior) - #105558 (Reduce HIR debug output) - #106315 (Cleanup `mingw-tidy` docker job) - #106354 (Rustdoc-Json: Report discriminant on all kinds of enum variant.) - #106366 (Fix rustdoc ICE on bad typedef with mismatching types) - #106376 (Update books) - #106383 (Document some of the AST nodes) Failed merges: - #106356 (clean: Remove `ctor_kind` from `VariantStruct`.) r? `@ghost` `@rustbot` modify labels: rollup
2023-01-02Rollup merge of #106376 - rustbot:docs-update, r=ehussMichael Goulet-0/+0
Update books ## rust-lang/book 3 commits in a60f4316ec923a5ac2ed6a2eba6960edb832d855..2bd5d42c9956369132228da6409f0e68da56c51a 2022-12-22 21:37:10 UTC to 2022-12-22 21:36:14 UTC - fix macos installation problem (rust-lang/book#3469) - Update -guessing-game-tutorial incorrect output (rust-lang/book#3462) - FIX: IT repo updated (rust-lang/book#3454) ## rust-lang/nomicon 1 commits in dd37e21ccee43918ed18a71581bb2af537ffe4fc..8ca261268068d80c0969260fff15199bad87b587 2022-12-30 16:32:09 UTC to 2022-12-30 16:32:09 UTC - Discourage the use of transmute to construct invalid values (rust-lang/nomicon#388) ## rust-lang/rust-by-example 6 commits in 995df09b65c582eb6290ab7ea5d9485983eb4c37..8888f9428fe9a48f31de6bd2cef9b9bf80791edc 2023-01-01 12:53:50 UTC to 2022-12-21 10:18:31 UTC - types/alias: use io::{Result,Error} instead of Io{Result,Error} (rust-lang/rust-by-example#1660) - Fix sample code mismatching its comments (rust-lang/rust-by-example#1659) - fix: add missing space (rust-lang/rust-by-example#1658) - diverging: fix issues with example code (rust-lang/rust-by-example#1631) - Update enum.md (rust-lang/rust-by-example#1645) - Clean up Chapter 2 (Primitives) (rust-lang/rust-by-example#1651) ## rust-lang/rustc-dev-guide 5 commits in 8b42eb5f57d3d8ed2257a22d0e850d9db52afed3..b3e2a6e6c8a3aae5b5d950c63046f23bae07096d 2023-01-01 05:20:47 UTC to 2022-12-25 12:11:21 UTC - Add help for when you update a submodule by accident (rust-lang/rustc-dev-guide#1537) - Simplify "how to build and run" section (rust-lang/rustc-dev-guide#1528) - Replace `$TARGET` with `host` (rust-lang/rustc-dev-guide#1514) - Add more rebasing help (rust-lang/rustc-dev-guide#1536) - Fix rustc_borrowck crate name typo (rust-lang/rustc-dev-guide#1535)
2023-01-02Rollup merge of #106366 - ↵Michael Goulet-1/+497
GuillaumeGomez:fix-rustdoc-ice-typedef-type-mismatch, r=notriddle Fix rustdoc ICE on bad typedef with mismatching types Fixes https://github.com/rust-lang/rust/issues/106226. Fixes #105742. Fixes #105737. Fixes #105334. Fixes #96287. In this case, it's ok to replace the panic with `rustc_error::raise` because the compiler provided us with a `Error`. r? `@notriddle`
2023-01-02Rollup merge of #106354 - aDotInTheVoid:rdj-always-discr, r=GuillaumeGomezMichael Goulet-201/+257
Rustdoc-Json: Report discriminant on all kinds of enum variant. Closes https://github.com/rust-lang/rust/issues/106299 Probably easier to review one commit at a time. r? `@GuillaumeGomez`
2023-01-02Rollup merge of #106315 - jyn514:cleanup-mingw-tidy, r=fee1-deadMichael Goulet-3/+2
Cleanup `mingw-tidy` docker job Fixes a couple small regressions from https://github.com/rust-lang/rust/pull/106048 and https://github.com/rust-lang/rust/pull/105714. - Avoid `/checkout/src/ci/run.sh: line 187: [: =: unary operator expected`: https://github.com/rust-lang/rust/actions/runs/3809902408/jobs/6481611301#step:26:1701 - Avoid running `x check` in the tidy test, to get faster feedback. It's already run on the normal `mingw-check` job. r? `@fee1-dead`
2023-01-02Rollup merge of #105558 - Nilstrieb:less-spam-hir-tree, r=cjgillotMichael Goulet-6/+1
Reduce HIR debug output HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by. ``` $ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l 582 $ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l 932 ```
2023-01-02get latest x version from parsing cargo commandDebugSteven-10/+39
2023-01-03Don't trim path for `unsafe_op_in_unsafe_fn` lintsLéo Lanteri Thauvin-0/+21
2023-01-02Auto merge of #106364 - JakobDegen:top-down-inlining, r=cjgillotbors-91/+184
Reenable limited top-down MIR inlining Reverts most of #105119 and uses an alternative strategy to prevent exponential blowup. Specifically, we allow doing top-down inlining up to depth at most five, and for at most one call site per nested body. r? `@cjgillot`
2023-01-02rustdoc: remove legacy box-sizing CSSMichael Howell-2/+0
According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985] * The last version of Chrome that required a vendor prefix was version 9. The current version is 108. * Firefox 28 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 5. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 4. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=box-sizing [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-02Reduce HIR debug outputNilstrieb-6/+1
HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by. ``` $ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l 582 $ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l 932 ```
2023-01-02Auto merge of #106272 - clubby789:codegen-test-103840, r=nikicbors-0/+9
Add codegen test for issue 103840 Closes #103840
2023-01-02Update booksrustbot-0/+0
2023-01-02do not add noalias in return positionRalf Jung-1/+1
2023-01-02Add regression test for #96287Guillaume Gomez-0/+32
2023-01-02Add regression test for #105742Guillaume Gomez-0/+425
2023-01-02Add regression test for #105737Guillaume Gomez-0/+16
2023-01-02Add regression test for #105334Guillaume Gomez-0/+11
2023-01-02Add regression test for #106226Guillaume Gomez-0/+12
2023-01-02Auto merge of #84762 - cjgillot:resolve-span-opt, r=petrochenkovbors-120/+13
Encode spans relative to the enclosing item -- enable on nightly Follow-up to #84373 with the flag `-Zincremental-relative-spans` set by default. This PR seeks to remove one of the main shortcomings of incremental: the handling of spans. Changing the contents of a function may require redoing part of the compilation process for another function in another file because of span information is changed. Within one file: all the spans in HIR change, so typechecking had to be re-done. Between files: spans of associated types/consts/functions change, so type-based resolution needs to be re-done (hygiene information is stored in the span). The flag `-Zincremental-relative-spans` encodes local spans relative to the span of an item, stored inside the `source_span` query. Trap: stashed diagnostics are referenced by the "raw" span, so stealing them requires to remove the span's parent. In order to avoid too much traffic in the span interner, span encoding uses the `ctxt_or_tag` field to encode: - the parent when the `SyntaxContext` is 0; - the `SyntaxContext` when the parent is `None`. Even with this, the PR creates a lot of traffic to the Span interner, when a Span has both a LocalDefId parent and a non-root SyntaxContext. They appear in lowering, when we add a parent to all spans, including those which come from macros, and during inlining when we mark inlined spans. The last commit changes how queries of `LocalDefId` manage their cache. I can put this in a separate PR if required. Possible future directions: - validate that all spans are marked in HIR validation; - mark macro-expanded spans relative to the def-site and not the use-site.
2023-01-02maybegimbles-10/+10
2023-01-02Fix rustdoc ICE on bad typedef with mismatching typesGuillaume Gomez-1/+1