about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-11-03compiler: Remove unused rustc_target from Cargo.tomlsJubilee Young-5/+0
2024-11-03compiler: Replace rustc_target with abi in symbol_manglingJubilee Young-6/+3
2024-11-03compiler: Directly use rustc_abi in sessionJubilee Young-2/+2
2024-11-03compiler: Directly use rustc_abi in lintsJubilee Young-7/+6
2024-11-03compiler: Directly use rustc_abi in ty_utilsJubilee Young-21/+19
2024-11-03compiler: Directly use rustc_abi in smir againJubilee Young-58/+58
2024-11-03compiler: Directly use rustc_abi in mir_transformJubilee Young-44/+45
2024-11-03compiler: Directly use rustc_abi in metadata and middleJubilee Young-102/+93
Stop reexporting ReprOptions from middle::ty
2024-11-03compiler: Directly use rustc_abi in hir_{analysis,typeck}Jubilee Young-56/+58
2024-11-03compiler: Directly use rustc_abi in const_evalJubilee Young-32/+29
2024-11-03compiler: Directly use rustc_abi in codegenJubilee Young-52/+50
2024-11-03Auto merge of #132542 - RalfJung:const_panic, r=tgross35bors-129/+142
add const_panic macro to make it easier to fall back to non-formatting panic in const Suggested by `@tgross35` r? `@tgross35`
2024-11-03Auto merge of #132555 - matthiaskrgr:rollup-2d79661, r=matthiaskrgrbors-99/+524
Rollup of 15 pull requests Successful merges: - #129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`) - #131377 (Add LowerExp and UpperExp implementations to NonZero) - #132393 (Docs: added brief colon explanation) - #132437 (coverage: Regression test for inlining into an uninstrumented crate) - #132499 (unicode_data.rs: show command for generating file) - #132503 (better test for const HashMap; remove const_hash leftovers) - #132511 (stabilize const_arguments_as_str) - #132520 (NFC add known bug nr to test) - #132522 (make codegen help output more consistent) - #132523 (Added regression test for generics index out of bounds) - #132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion) - #132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d) - #132540 (Do not format generic consts) - #132543 (add and update some crashtests) - #132550 (compiler: Continue introducing rustc_abi to the compiler) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-03Auto merge of #132514 - Zalathar:print-target-cpus, r=jieyouxubors-90/+131
Port most of `--print=target-cpus` to Rust The logic and formatting needed by `--print=target-cpus` has historically been carried out in C++ code. Originally it used `printf` to write directly to the console, but later it switched over to writing to a `std::ostringstream` and then passing its buffer to a callback function pointer. This PR replaces that C++ code with a very simple function that writes a list of CPU names to a `&RustString`, with the rest of the logic and formatting being handled by ordinary safe Rust code.
2024-11-03Rollup merge of #132550 - ↵Matthias Krüger-30/+35
workingjubilee:rustc-abi-selects-borrowck-for-mono-sans, r=compiler-errors compiler: Continue introducing rustc_abi to the compiler Some crates have not heard of rustc_abi before, so arrange introductions. Encourage some crates to go further and leave rustc_target behind: it was no good for them.
2024-11-03Rollup merge of #132543 - cyrgani:master, r=compiler-errorsMatthias Krüger-12/+28
add and update some crashtests Adds tests for #126268 and #132126, updates it for #131050.
2024-11-03Rollup merge of #132540 - compiler-errors:gc, r=calebcartwrightMatthias Krüger-6/+52
Do not format generic consts We introduced **nightly support** for generic const items in #113522, but formatting of consts was not modified. Making them format *correctly* is hard, so let's just bail formatting them so we don't accidentally strip their generics and where clauses. This is essentially no-op formatting for generic const items. r? `````@calebcartwright````` or `````@ytmimi`````
2024-11-03Rollup merge of #132537 - durin42:llvm-20-prelinklto, r=DianQKMatthias Krüger-7/+6
PassWrapper: adapt for llvm/llvm-project@5445edb5d As with ab5583ed1e75869b765a90386dac9119992f8ed7, we had been explicitly passing defaults whose type have changed. Rather than do an ifdef, we simply rely on the defaults. ````@rustbot```` label: +llvm-main
2024-11-03Rollup merge of #132528 - compiler-errors:fallback-sugg-opt, r=jieyouxuMatthias Krüger-3/+17
Use `*_opt` typeck results fns to not ICE in fallback suggestion Self-explanatory. Fixes #132517.
2024-11-03Rollup merge of #132523 - ranger-ross:test-issue-117446, r=compiler-errorsMatthias Krüger-0/+57
Added regression test for generics index out of bounds Added a regression test for #117446 This ICE was fixed in Rust 1.75 but a regression test was never added. This PR adds a UI test with a reduced version of the original bug report that does not rely on external crates.
2024-11-03Rollup merge of #132522 - senekor:consistenst-codegen-help, r=compiler-errorsMatthias Krüger-1/+1
make codegen help output more consistent The output of `rustc -C help` generally has one option per line. There was one exception because of a (presumably) forgotten line continuation escape.
2024-11-03Rollup merge of #132520 - matthiaskrgr:knobu, r=jieyouxuMatthias Krüger-1/+1
NFC add known bug nr to test r? ```````@jieyouxu```````
2024-11-03Rollup merge of #132511 - RalfJung:const_arguments_as_str, r=dtolnayMatthias Krüger-5/+2
stabilize const_arguments_as_str FCP passed in the [tracking issue](https://github.com/rust-lang/rust/issues/103900#issuecomment-2397096659).
2024-11-03Rollup merge of #132503 - RalfJung:const-hash-map, r=AmanieuMatthias Krüger-16/+29
better test for const HashMap; remove const_hash leftovers The existing `const_with_hasher` test is kind of silly since the HashMap it constructs can never contain any elements. So this adjusts the test to construct a usable HashMap, which is a bit non-trivial since the default hash builder cannot be built in `const`. `BuildHasherDefault::new()` helps but is unstable (https://github.com/rust-lang/rust/issues/123197), so we also have a test that does not involve that type. The second commit removes the last remnants of https://github.com/rust-lang/rust/issues/104061, since they aren't actually useful -- without const traits, you can't do any hashing in `const`. Cc ``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval`` Closes #104061 Related to https://github.com/rust-lang/rust/issues/102575
2024-11-03Rollup merge of #132499 - RalfJung:unicode_data.rs, r=tgross35Matthias Krüger-2/+2
unicode_data.rs: show command for generating file https://github.com/rust-lang/rust/pull/131647 made this an easily runnable tool, now we just have to mention that in the comment. :) Fixes https://github.com/rust-lang/rust/issues/131640.
2024-11-03Rollup merge of #132437 - Zalathar:inline-mixed-regression, r=jieyouxuMatthias Krüger-0/+32
coverage: Regression test for inlining into an uninstrumented crate Regression test for #132395, after I was able to figure out a simple way to reproduce it. See also #132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
2024-11-03Rollup merge of #132393 - zedddie16:issue-131865-fix, r=tgross35Matthias Krüger-0/+10
Docs: added brief colon explanation https://github.com/rust-lang/rust/issues/131865 (this is my first attempt at contributing, feedback is welcome)
2024-11-03Rollup merge of #131377 - rick-de-water:nonzero-exp, r=dtolnayMatthias Krüger-16/+41
Add LowerExp and UpperExp implementations to NonZero Adds `LowerExp` and `UpperExp` trait implementations to `NonZero`, as discussed in rust-lang/libs-team#458. I had to modify the macro to mark the new impls with a different rust version. Let me know if this is the right way to do it (first timer here!)
2024-11-03Rollup merge of #129329 - eduardosm:rc-from-mut-slice, r=dtolnayMatthias Krüger-0/+211
Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>` ACP: https://github.com/rust-lang/libs-team/issues/424 New API: ```rust impl<T: Clone> From<&mut [T]> for Box<[T]> impl From<&mut str> for Box<str> impl From<&mut CStr> for Box<CStr> impl From<&mut OsStr> for Box<OsStr> impl From<&mut Path> for Box<Path> impl<T: Clone> From<&mut [T]> for Rc<[T]> impl From<&mut str> for Rc<str> impl From<&mut CStr> for Rc<CStr> impl From<&mut OsStr> for Rc<OsStr> impl From<&mut Path> for Rc<Path> impl<T: Clone> From<&mut [T]> for Arc<[T]> impl From<&mut str> for Arc<str> impl From<&mut CStr> for Arc<CStr> impl From<&mut OsStr> for Arc<OsStr> impl From<&mut Path> for Arc<Path> ``` Since they are trait implementations, I think these are insta-stable. As mentioned in https://github.com/rust-lang/libs-team/issues/424#issuecomment-2299415749, a crater run might be needed.
2024-11-03Auto merge of #132419 - durin42:llvm-20-type-test-thing, r=cuviperbors-3/+3
PassWrapper: adapt for llvm/llvm-project@b01e2a8b5620466c3b A boolean turned into an enum. None matches the old behavior of false, so we pass that. `@rustbot` label: +llvm-main
2024-11-03add const_panic macro to make it easier to fall back to non-formatting panic ↵Ralf Jung-129/+142
in const
2024-11-03stabilize const_arguments_as_strRalf Jung-5/+2
2024-11-03Auto merge of #132526 - bjorn3:sync_cg_clif-2024-11-02, r=bjorn3bors-269/+167
Subtree sync for rustc_codegen_cranelift The highlight this time is an update to Cranelift 0.113, r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-11-02compiler: Add rustc_abi to _sanitizersJubilee Young-6/+7
2024-11-02compiler: Add rustc_abi to _monomorphizeJubilee Young-1/+3
2024-11-02compiler: Replace rustc_target with _abi in _trait_selectionJubilee Young-10/+10
2024-11-02compiler: Replace rustc_target with _abi in _hirJubilee Young-5/+7
2024-11-02compiler: Replace rustc_target with _abi in _borrowckJubilee Young-8/+8
2024-11-03Auto merge of #132458 - RalfJung:rustc-const-unstable, r=Amanieubors-106/+0
get rid of a whole bunch of unnecessary rustc_const_unstable attributes In general, when a `const fn` is still unstable, it doesn't need a `#[rustc_const_unstable]` attribute. The only exception is functions that internally use things that can't be used in stable const fn yet. So this gets rid of a whole bunch of `#[rustc_const_unstable]` in libcore.
2024-11-02Auto merge of #125579 - Noratrieb:print-host, r=davidtwcobors-171/+180
Add `--print host-tuple` to print host target tuple People often parse `-vV` output to get to the host tuple, which is annoying to do. It's easier to just get it directly. I called it "host-tuple" instead of "host" because it's clearer that it's just the target name. I'm open to different names, but I think this one is fine. a quick GitHub search for `'^host` reveals many instances of people doing the parsing, for example: https://github.com/japaric/xargo/blob/68e0ca57cd90837fe02f262f074182f9cfeb6227/README.md?plain=1#L369 https://github.com/taiki-e/setup-cross-toolchain-action/blob/0e38473b0c562d6db19a98d3ec20a80f7ac189ae/main.sh#L96 https://github.com/taiki-e/cargo-llvm-cov/blob/8a3553b86551eabf9c30c060b1f72a5bbccb98c6/README.md?plain=1#L625 https://github.com/SiliconLabs/cpc-nvm3/blob/43f3ec39709b30700ef7f39d91fa647974323bf1/do.sh#L35 needs a compiler FCP. I could also do an MCP but I think just an FCP here makes the most sense.
2024-11-02add and update some crashtestscyrgani-12/+28
2024-11-02Add `--print host-triple`Noratrieb-3/+13
People often parse `-vV` output to get to the host triple, which is annoying to do. It's easier to just get it directly.
2024-11-02Rename target triple to target tuple in many places in the compilerNoratrieb-168/+167
This changes the naming to the new naming, used by `--print target-tuple`. It does not change all locations, but many.
2024-11-02move deployment-target tests to print-requestNilstrieb-0/+0
2024-11-02Do not format generic constsMichael Goulet-6/+52
2024-11-02Auto merge of #132147 - estebank:long-types-2, r=davidtwcobors-227/+487
Tweak E0277 output when a candidate is available *Follow up to #132086.* Go from ``` error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ the trait `chumsky::private::ParserSealed<'_, &str, (), chumsky::extra::Full<EmptyErr, (), ()>>` is not implemented for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>`, which is required by `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` | = help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>` = help: for that trait implementation, expected `((), ())`, found `()` = note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console ``` to ``` error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound ... 11 | ws.then(parser.map(|_| ())) | --------------------------- return type was inferred to be `Then<Ignored<..., ...>, ..., ..., ..., ...>` here | = help: the trait `ParserSealed<'_, &_, (), Full<_, _, _>>` is not implemented for `Then<Ignored<..., ...>, ..., ..., ..., ...>` but trait `ParserSealed<'_, &'a _, ((), ()), Full<_, _, _>>` is implemented for it = help: for that trait implementation, expected `((), ())`, found `()` = note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-df9d52be87eada65.long-type-1337037744507305372.txt' = note: consider using `--verbose` to print the full type name to the console ``` * Remove redundant wording * Introduce trait diff highlighting logic and use it * Fix incorrect "long type written to path" logic (can be split off) * Point at tail expression in more cases in E0277 * Avoid long primary span labels in E0277 by moving them to a `help` Fix #132013. There are individual commits that can be their own PR. If the review load is too big, happy to split them off.
2024-11-02PassWrapper: adapt for llvm/llvm-project@5445edb5dAugie Fackler-7/+6
As with ab5583ed1e75869b765a90386dac9119992f8ed7, we had been explicitly passing defaults whose type have changed. Rather than do an ifdef, we simply rely on the defaults. @rustbot label: +llvm-main
2024-11-02Rustdoc: added brief colon explanationtuturuu-0/+10
2024-11-02PassWrapper: adapt for ↵Augie Fackler-3/+3
llvm/llvm-project@b01e2a8b5620466c3b80cc6f049efbc90b9d103a We don't see a reason to explicitly pass the default here, so just use the default instead of explicitly passing it and needing an ifdef. @rustbot label: +llvm-main
2024-11-02fix testsEsteban Küber-10/+11
Paths in CI can be longer than in devs' machines.