about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-10-02Auto merge of #100557 - dawnofmidnight:tarball-commit-info, r=Mark-Simulacrumbors-47/+121
fix: use git-commit-info for version information Fixes #33286. Fixes #86587. This PR changes the current `git-commit-hash` file that `./x.py` dist puts in the `rustc-{version}-src.tar.{x,g}z` to contain the hash, the short hash, and the commit date from which the tarball was created, assuming git was available when it was. It uses this for reading the version so that rustc has all the appropriate metadata. # Testing Testing this is kind of a pain. I did it with something like ```sh ./x.py dist # ensure that `ignore-git` is `false` in config.toml cp ./build/dist/rustc-1.65.0-dev-src.tar.gz ../rustc-1.65.0-dev-src.tar.gz cd .. && tar -xzf rustc-1.65.0-dev-src && cd rustc-1.65.0-dev-src ./x.py build ``` Then, the output of `rustc -vV` with the stage1 compiler should have the `commit-hash` and `commit-date` fields filled, rather than be `unknown`. To be completely sure, you can use `rustc --sysroot` with the stdlib that the original `./x.py dist` made, which will require that the metadata matches.
2022-10-02Auto merge of #102530 - cuviper:upgrade-i586-gnu, r=pietroalbinibors-7/+798
Upgrade dist-i586-gnu-i586-i686-musl to ubuntu:22.04 The system GCC 5 in ubuntu:16.04 will be too old to compile LLVM 16, so we need an upgrade. To avoid raising the minimum glibc requirements for `i586-unknown-linux-gnu`, this target is converted to a crosstool-ng toolchain, *relaxing* it to the same Linux 3.2 / glibc 2.17 minimum we use elsewhere. The musl targets still use Ubuntu's system toolchain, but this doesn't have the same compatibility concerns.
2022-10-02Auto merge of #102586 - Dylan-DPC:rollup-g107h6z, r=Dylan-DPCbors-3/+48
Rollup of 5 pull requests Successful merges: - #100451 (Do not panic when a test function returns Result::Err.) - #102098 (Use fetch_update in sync::Weak::upgrade) - #102538 (Give `def_span` the same SyntaxContext as `span_with_body`.) - #102556 (Make `feature(const_btree_len)` implied by `feature(const_btree_new)`) - #102566 (Add a known-bug test for #102498) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-02Rollup merge of #102566 - compiler-errors:test-102498, r=Mark-SimulacrumDylan DPC-0/+39
Add a known-bug test for #102498 Self-explanatory
2022-10-02Rollup merge of #102556 - WaffleLapkin:implied_by_btree_new, r=Mark-SimulacrumDylan DPC-1/+3
Make `feature(const_btree_len)` implied by `feature(const_btree_new)` ...this should fix code that used the old feature that was changed in #102197 cc ```@davidtwco``` it seems like tidy doesn't check `implied_by`, should it?
2022-10-02Rollup merge of #100451 - hovinen:no-panic-on-result-err-in-test, ↵Dylan DPC-2/+6
r=Mark-Simulacrum Do not panic when a test function returns Result::Err. Rust's test library allows test functions to return a `Result`, so that the test is deemed to have failed if the function returns a `Result::Err` variant. Currently, this works by having `Result` implement the `Termination` trait and asserting in assert_test_result that `Termination::report()` indicates successful completion. This turns a `Result::Err` into a panic, which is caught and unwound in the test library. This approach is problematic in certain environments where one wishes to save on both binary size and compute resources when running tests by: * Compiling all code with `--panic=abort` to avoid having to generate unwinding tables, and * Running most tests in-process to avoid the overhead of spawning new processes. This change removes the intermediate panic step and passes a `Result::Err` directly through to the test runner. To do this, it modifies `assert_test_result` to return a `Result<(), String>` where the `Err` variant holds what was previously the panic message. It changes the types in the `TestFn` enum to return `Result<(), String>`. This tries to minimise the changes to benchmark tests, so it calls `unwrap()` on the `Result` returned by `assert_test_result`, effectively keeping the same behaviour as before. Some questions for reviewers: * Does the change to the return types in the enum `TestFn` constitute a breaking change for the library API? Namely, the enum definition is public but the test library indicates that "Currently, not much of this is meant for users" and most of the library API appears to be marked unstable. * Is there a way to test this change, i.e., to test that no panic occurs if a test returns `Result::Err`? * Is there a shorter, more idiomatic way to fold `Result<Result<T,E>,E>` into a `Result<T,E>` than the `fold_err` function I added?
2022-10-02Auto merge of #98354 - camsteffen:is-some-and-by-value, r=m-ou-sebors-2/+2
Change `is_some_and` to take by value Consistent with other function-accepting `Option` methods. Tracking issue: #93050 r? `@m-ou-se`
2022-10-02Auto merge of #102535 - scottmcm:optimize-split-at-partition-point, r=thomccbors-0/+20
Tell LLVM that `partition_point` returns a valid fencepost This was already done for a successful `binary_search`, but this way `partition_point` can get similar optimizations. Demonstration that nightly can't do this optimization today, and leaves in the panicking path: <https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=e1074cd2faf5f68e49cffd728ded243a> r? `@thomcc`
2022-10-02Add a known-bug test for #102498Michael Goulet-0/+39
2022-10-02Auto merge of #102424 - sunfishcode:sunfishcode/hidden-main, r=nagisabors-1/+1
Declare `main` as visibility hidden on targets that default to hidden. On targets with `default_hidden_visibility` set, which is currrently just WebAssembly, declare the generated `main` function with visibility hidden. This makes it consistent with clang's WebAssembly target, where `main` is just a user function that gets the same visibility as any other user function, which is hidden on WebAssembly unless explicitly overridden. This will help simplify use cases which in the future may want to automatically wasm-export all visibility-"default" symbols. `main` isn't intended to be wasm-exported, and marking it hidden prevents it from being wasm-exported in that scenario.
2022-10-02Auto merge of #102558 - matthiaskrgr:rollup-0odec1c, r=matthiaskrgrbors-10/+55
Rollup of 6 pull requests Successful merges: - #102195 (Improve the COPYRIGHT file) - #102313 (Update docs so that deprecated method points to relevant method) - #102353 (Allow passing rustix_use_libc cfg using RUSTFLAGS) - #102405 (Remove a FIXME whose code got moved away in #62883.) - #102525 (rustdoc: remove orphaned link on array bracket) - #102557 (fix issue with x.py setup running into explicit panic) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-02Rollup merge of #102557 - Joshument:master, r=jyn514Matthias Krüger-2/+3
fix issue with x.py setup running into explicit panic Fixes problem with [Issue #102555](https://github.com/rust-lang/rust/issues/102555) causing `x.py` setup to fail. Simply requires `rustfmt` be downloaded a little later.
2022-10-02Rollup merge of #102525 - notriddle:notriddle/array-link, r=GuillaumeGomez,jshaMatthias Krüger-8/+50
rustdoc: remove orphaned link on array bracket This is #98069, but for arrays instead. For non-generics, this retains links to the array page, but instead of trying to link it all, it only links the length part, which distinguishes arrays from slices. For generics, the entire thing becomes a link, just like slices. | Type | Before | After | |--|--|--| | u32 | <code>pub fn alpha() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a><a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">; 1]</a></code> | <code>pub fn alpha() -&gt; &amp;'static [<a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>; <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">1</a>]</code> | generic | <code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[</a>T<a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">; 1]</a></code> | <code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[T; 1]</a></code>
2022-10-02Rollup merge of #102353 - bjorn3:allow_rustix_use_libc, r=Mark-SimulacrumMatthias Krüger-0/+2
Allow passing rustix_use_libc cfg using RUSTFLAGS Before this would error with ``` error: unexpected `rustix_use_libc` as condition name | = note: `-D unexpected-cfgs` implied by `-D warnings` = help: was set with `--cfg` but isn't in the `--check-cfg` expected names ``` I'm setting rustix_use_libc when testing bootstrapping rustc with cg_clif as I'm disabling inline asm here.
2022-10-01fix issue with x.py setup running into explicit panicJoshument-2/+3
2022-10-01Auto merge of #102193 - ferrocene:pa-remote-test-server-improvements, ↵bors-17/+33
r=Mark-Simulacrum Change argument handling in `remote-test-server` and add new flags This PR updates `remote-test-server` to add two new flags: * `--sequential` disables parallel test execution, accepting one connection at the time instead. We need this for Ferrocene as one of our emulators occasionally deadlocks when running multiple tests in parallel. * `--bind <ip:port>` allows customizing the IP and port `remote-test-server` binds to, rather than using the default value. While I was changing the flags, and [after chatting on what to do on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/remote-test-server.20flags), I took this opportunity to cleanup argument handling in `remote-test-server`, which is a breaking change: * The `verbose` argument has been renamed to the `--verbose` flag. * The `remote` argument has been removed in favor of the `--bind 0.0.0.0:12345` flag. The only thing the argument did was to change the bound IP to 0.0.0.0, which can easily be replicated with `--bind` and also is not secure as our "remote" default. I'm also open to keep the old arguments with deprecation warnings. r? `@Mark-Simulacrum`
2022-10-01make tidy accept multi-line `rustc_const_unstable` attributesMaybe Waffle-1/+3
2022-10-01fix: use git-commit-info for version informationdawnofmidnight-47/+121
This PR adds support for fetching version information from the `git-commit-info` file when building the compiler from a source tarball.
2022-10-01Auto merge of #102236 - cjgillot:compute_lint_levels_by_def, r=oli-obkbors-8/+8
Compute lint levels by definition Second attempt to https://github.com/rust-lang/rust/pull/101620. I think that I have removed the perf regression.
2022-10-01Auto merge of #102545 - matthiaskrgr:rollup-13i3tc3, r=matthiaskrgrbors-1/+0
Rollup of 3 pull requests Successful merges: - #101675 (Improve `File::set_times` error handling) - #102500 (Remove `expr_parentheses_needed` from `ParseSess`) - #102533 (rustdoc: remove unused CSS selector `a.source`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-01Change feature name to is_some_andCameron Steffen-1/+1
2022-10-01Change is_some_and to take by valueCameron Steffen-1/+1
2022-10-01Rollup merge of #102533 - notriddle:notriddle/a-source, r=Dylan-DPCMatthias Krüger-1/+0
rustdoc: remove unused CSS selector `a.source` The link with this class attribute was removed in https://github.com/rust-lang/rust/commit/4d16de01d0beb84dc4a351022ea5cb587b4ab557#diff-3fe025bd3bd6b48044d0bd8d8c3122de5ecdb1dcd72a9dbe3c24430883595012L1281-R1324
2022-10-01Auto merge of #102519 - Alexendoo:format-args-macro-str, r=m-ou-sebors-14/+108
Fix `format_args` capture for macro expanded format strings Since #100996 `format_args` capture for macro expanded strings aren't prevented when the span of the expansion points to a string literal, e.g. ```rust // not a terribly realistic example, but also happens for proc_macros that set // the span of the output to an input str literal, such as indoc macro_rules! x { ($e:expr) => { $e } } fn main() { let a = 1; println!(x!("{a}")); } ``` The tests didn't catch it as the span of `concat!()` points to the macro invocation r? `@m-ou-se`
2022-10-01Compute `lint_levels` by definitionDeadbeef-8/+8
2022-10-01Auto merge of #101986 - WaffleLapkin:move_lint_note_to_the_bottom, r=estebankbors-1627/+1607
Move lint level source explanation to the bottom So, uhhhhh r? `@estebank` ## User-facing change "note: `#[warn(...)]` on by default" and such are moved to the bottom of the diagnostic: ```diff - = note: `#[warn(unsupported_calling_conventions)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678> + = note: `#[warn(unsupported_calling_conventions)]` on by default ``` Why warning is enabled is the least important thing, so it shouldn't be the first note the user reads, IMO. ## Developer-facing change `struct_span_lint` and similar methods have a different signature. Before: `..., impl for<'a> FnOnce(LintDiagnosticBuilder<'a, ()>)` After: `..., impl Into<DiagnosticMessage>, impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>) -> &'b mut DiagnosticBuilder<'a, ()>` The reason for this is that `struct_span_lint` needs to edit the diagnostic _after_ `decorate` closure is called. This also makes lint code a little bit nicer in my opinion. Another option is to use `impl for<'a> FnOnce(LintDiagnosticBuilder<'a, ()>) -> DiagnosticBuilder<'a, ()>` altough I don't _really_ see reasons to do `let lint = lint.build(message)` everywhere. ## Subtle problem By moving the message outside of the closure (that may not be called if the lint is disabled) `format!(...)` is executed earlier, possibly formatting `Ty` which may call a query that trims paths that crashes the compiler if there were no warnings... I don't think it's that big of a deal, considering that we move from `format!(...)` to `fluent` (which is lazy by-default) anyway, however this required adding a workaround which is unfortunate. ## P.S. I'm sorry, I do not how to make this PR smaller/easier to review. Changes to the lint API affect SO MUCH 😢
2022-10-01`ui-fulldeps`: adopt to the new rustc lint APIMaybe Waffle-39/+43
2022-10-01bless rustdoc-uiMaybe Waffle-48/+48
2022-10-01bless a miri testMaybe Waffle-1/+1
2022-10-01bless clippyMaybe Waffle-231/+231
2022-10-01bless ui testsMaybe Waffle-1194/+1194
2022-10-01rustdoc: adopt to the new lint APIMaybe Waffle-78/+61
2022-10-01clippy: adopt to the new lint APIMaybe Waffle-36/+29
2022-10-01Auto merge of #102237 - GuillaumeGomez:sidebar-links-color, r=notriddlebors-63/+247
Migrate sidebar links color to CSS variables and unify themes with ayu Part of https://github.com/rust-lang/rust/pull/98460. This PR does two things: 1. Migrate more theme CSS rules toward CSS variables. 2. Remove `a.current` specific colors depending on the kind of the item behind the link. The `ayu` theme was already doing it this way and I think it makes much more sense like this. You can test it [here](https://rustdoc.crud.net/imperio/sidebar-links-color/lib2/struct.Foo.html) by hovering other module's items in the sidebar (or check the selector `a.current`). cc `@jsha` r? `@notriddle`
2022-09-30Tell LLVM that `partition_point` returns a valid fencepostScott McMurray-0/+20
This was already done for a successful `binary_search`, but this way `partition_point` can get similar optimizations.
2022-09-30rustdoc: remove unused CSS selector `a.source`Michael Howell-1/+0
The link with this class attribute was removed in 4d16de01d0beb84dc4a351022ea5cb587b4ab557.
2022-10-01Auto merge of #102526 - matthiaskrgr:rollup-9o6p98c, r=matthiaskrgrbors-22/+129
Rollup of 7 pull requests Successful merges: - #102361 (Fix ICE in const_trait check code) - #102373 (Flush delayed bugs before codegen) - #102483 (create def ids for impl traits during ast lowering) - #102490 (Generate synthetic region from `impl` even in closure body within an associated fn) - #102492 (Don't lower assoc bindings just to deny them) - #102493 (Group together more size assertions.) - #102521 (rustdoc: add missing margin to no-docblock methods) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-01Auto merge of #101969 - reez12g:issue-101306, r=reez12gbors-0/+2
Make fmt downloaded on every invocation of bootstrap Fixes https://github.com/rust-lang/rust/issues/101306
2022-09-30Upgrade dist-i586-gnu-i586-i686-musl to ubuntu:22.04Josh Stone-7/+798
The system GCC 5 in ubuntu:16.04 will be too old to compile LLVM 16, so we need an upgrade. To avoid raising the minimum glibc requirements for `i586-unknown-linux-gnu`, this target is converted to a crosstool-ng toolchain, *relaxing* it to the same Linux 3.2 / glibc 2.17 minimum we use elsewhere. The musl targets still use Ubuntu's system toolchain, but this doesn't have the same compatibility concerns.
2022-10-01Add a comment to downloading fmt statementRento Ezoe-0/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2022-09-30Allow `hidden` in src/test/codegen/abi-main-signature-32bit-c-int.rsDan Gohman-1/+1
2022-09-30Rollup merge of #102521 - notriddle:notriddle/impl-items-section, ↵Matthias Krüger-14/+37
r=GuillaumeGomez rustdoc: add missing margin to no-docblock methods Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, this time fixing the appearance of methods that have no docblock (we didn't notice this one because libstd docs *always* have docblocks). See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/enum.Type.html#implementations <details> # Before ![image](https://user-images.githubusercontent.com/1593513/193318777-2bc082fb-6579-4bd8-a0e3-d23a32b4820f.png) # After ![image](https://user-images.githubusercontent.com/1593513/193318968-b6ccacad-940b-4ed3-a0ae-dcf2079c2bae.png) </details> See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html <details> # Before ![image](https://user-images.githubusercontent.com/1593513/193319636-7ff9c99e-0208-462c-99de-7672e92ce4d6.png) # After ![image](https://user-images.githubusercontent.com/1593513/193322675-403bd165-7394-43e2-8ab4-d1f364666093.png) </details>
2022-09-30Rollup merge of #102490 - compiler-errors:closure-body-impl-lifetime, r=cjgillotMatthias Krüger-0/+50
Generate synthetic region from `impl` even in closure body within an associated fn Fixes #102209
2022-09-30Rollup merge of #102483 - spastorino:create-defs-on-lowering, r=cjgillotMatthias Krüger-8/+8
create def ids for impl traits during ast lowering r? `@cjgillot`
2022-09-30Rollup merge of #102361 - fee1-dead-contrib:fix-102156, r=eholkMatthias Krüger-0/+34
Fix ICE in const_trait check code This fixes #102156.
2022-09-30rustdoc: remove orphaned link on array bracketMichael Howell-8/+50
This is 682889fb06591c4245422b73b005c5d8ae2d0cad, but for arrays instead. For non-generics, this retains links to the array page, but instead of trying to link it all, it only links the length part, which distinguishes arrays from slices. For generics, the entire thing becomes a link, just like slices.
2022-09-30Auto merge of #102517 - nikic:update-llvm-8, r=cuviperbors-0/+0
Update LLVM submodule This merges in the current upstream release/15.x branch. Fixes #102402.
2022-09-30rustdoc: update test cases for `<section>` tags in traitsMichael Howell-11/+11
2022-09-30create def ids for impl traits during ast loweringSantiago Pastorino-8/+8
2022-09-30rustdoc: add gui test for no-docblock marginsMichael Howell-0/+20