about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-05-24Properly deal with missing/placeholder types inside GACsLeón Orell Valerian Liehr-4/+58
2024-05-21Auto merge of #124417 - Xiretza:translate-early-lints, r=fmeasebors-900/+2107
Make early lints translatable <del>Requires https://github.com/projectfluent/fluent-rs/pull/353.</del> https://github.com/rust-lang/rust/commit/5134a04eaa32b168cf5998a6ec13199356e2e017 r? diagnostics
2024-05-21Rename buffer_lint_with_diagnostic to buffer_lintXiretza-57/+57
2024-05-21Fix typo in deprecation lint messageXiretza-6/+6
2024-05-21Make early lints translatableXiretza-550/+1176
2024-05-21Convert uses of BuiltinLintDiag::Normal to custom variantsXiretza-173/+295
This ensures all diagnostic messages are created at diagnostic emission time, making them translatable.
2024-05-21Port DeprecatedMacro to diag structsXiretza-96/+152
2024-05-21Generate lint diagnostic message from BuiltinLintDiagXiretza-130/+212
Translation of the lint message happens when the actual diagnostic is created, not when the lint is buffered. Generating the message from BuiltinLintDiag ensures that all required data to construct the message is preserved in the LintBuffer, eventually allowing the messages to be moved to fluent. Remove the `msg` field from BufferedEarlyLint, it is either generated from the data in the BuiltinLintDiag or stored inside BuiltinLintDiag::Normal.
2024-05-21Convert unexpected_cfg_{name,value} to struct diagnosticsXiretza-188/+472
2024-05-21Convert NAMED_ASM_LABELS lint to diag structXiretza-20/+14
2024-05-21Fix subdiagnostic-only enum variants not generating codeXiretza-2/+2
2024-05-21Add note_once/help_once to diagnostic derivesXiretza-4/+30
2024-05-21Implement IntoDiagArg for RustcVersionXiretza-1/+12
2024-05-21Implement IntoDiagArg for hir NamespaceXiretza-0/+6
2024-05-21Auto merge of #125379 - matthiaskrgr:rollup-6149w01, r=matthiaskrgrbors-97/+308
Rollup of 6 pull requests Successful merges: - #123122 (Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.) - #123492 (add pull request template asking for relevant tracking issues) - #125276 (Fix parsing of erroneously placed semicolons) - #125310 (Move ~100 tests from tests/ui to subdirs) - #125357 (Migrate `run-make/rustdoc-scrape-examples-multiple` to `rmake.rs`) - #125369 (Don't do cc detection for synthetic targets) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-21Rollup merge of #125369 - saethlin:synthetic-targets-dont-cc, r=onur-ozkanMatthias Krüger-4/+1
Don't do cc detection for synthetic targets Fixes https://github.com/rust-lang/rust/issues/125365 Synthetic targets only exist for mir-opt tests, and the mir-opt test suite is in general designed to avoid any use of a C compiler. We don't need to do CC detection. It's unclear to me how this code didn't cause issues before.
2024-05-21Rollup merge of #125357 - ↵Matthias Krüger-27/+6
GuillaumeGomez:migrate-rustdoc-scrape-examples-multiple, r=jieyouxu Migrate `run-make/rustdoc-scrape-examples-multiple` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? ```@jieyouxu```
2024-05-21Rollup merge of #125310 - workingjubilee:muck-out-the-test-stables, r=NilstriebMatthias Krüger-45/+42
Move ~100 tests from tests/ui to subdirs new dirs for some, the rest in old sweep tests up before they turn cold to stop our code from growing mold
2024-05-21Rollup merge of #125276 - dev-ardi:no-main-diag, r=fmeaseMatthias Krüger-7/+42
Fix parsing of erroneously placed semicolons This closes https://github.com/rust-lang/rust/issues/124935, is a continuation of https://github.com/rust-lang/rust/pull/125245 after rebasing https://github.com/rust-lang/rust/pull/125117. Thanks ```@gurry``` for your code and sorry for making it confusing :P r? fmease
2024-05-21Rollup merge of #123492 - lcnr:master, r=davidtwcoMatthias Krüger-0/+10
add pull request template asking for relevant tracking issues As mentioned at RustNation, I would like to remind PR authors to link to relevant tracking issues when opening PRs as it is otherwise very easy to forget doing so. There's a certain amount of conflict between making the template as small as possible while still being clear for new contributors. I am very much open to changes here but really want to try this out. Also unsure how much formal buy-in we need here. Maybe merge this pinging t-compiler and t-libs, and then ask how people feel about this on zulip in a few weeks? r? `@davidtwco`
2024-05-21Rollup merge of #123122 - surechen:fix_122714, r=fmeaseMatthias Krüger-14/+207
Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses. For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`. We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes fixes #122714
2024-05-21Auto merge of #124676 - djkoloski:relax_multiple_sanitizers, r=cuviper,rcvallebors-22/+44
Relax restrictions on multiple sanitizers Most combinations of LLVM sanitizers are legal-enough to enable simultaneously. This change will allow simultaneously enabling ASAN and shadow call stacks on supported platforms. I used this python script to generate the mutually-exclusive sanitizer combinations: ```python #!/usr/bin/python3 import subprocess flags = [ ["-fsanitize=address"], ["-fsanitize=leak"], ["-fsanitize=memory"], ["-fsanitize=thread"], ["-fsanitize=hwaddress"], ["-fsanitize=cfi", "-flto", "-fvisibility=hidden"], ["-fsanitize=memtag", "--target=aarch64-linux-android", "-march=armv8a+memtag"], ["-fsanitize=shadow-call-stack"], ["-fsanitize=kcfi", "-flto", "-fvisibility=hidden"], ["-fsanitize=kernel-address"], ["-fsanitize=safe-stack"], ["-fsanitize=dataflow"], ] for i in range(len(flags)): for j in range(i): command = ["clang++"] + flags[i] + flags[j] + ["-o", "main.o", "-c", "main.cpp"] completed = subprocess.run(command, stderr=subprocess.DEVNULL) if completed.returncode != 0: first = flags[i][0][11:].replace('-', '').upper() second = flags[j][0][11:].replace('-', '').upper() print(f"(SanitizerSet::{first}, SanitizerSet::{second}),") ```
2024-05-21Don't do cc detection for synthetic targetsBen Kimock-4/+1
2024-05-21Auto merge of #125358 - matthiaskrgr:rollup-mx841tg, r=matthiaskrgrbors-439/+680
Rollup of 7 pull requests Successful merges: - #124570 (Miscellaneous cleanups) - #124772 (Refactor documentation for Apple targets) - #125011 (Add opt-for-size core lib feature flag) - #125218 (Migrate `run-make/no-intermediate-extras` to new `rmake.rs`) - #125225 (Use functions from `crt_externs.h` on iOS/tvOS/watchOS/visionOS) - #125266 (compiler: add simd_ctpop intrinsic) - #125348 (Small fixes to `std::path::absolute` docs) Failed merges: - #125296 (Fix `unexpected_cfgs` lint on std) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-21Rollup merge of #125348 - tbu-:pr_doc_path_absolute, r=jhprattMatthias Krüger-3/+6
Small fixes to `std::path::absolute` docs
2024-05-21Rollup merge of #125266 - workingjubilee:stream-plastic-love, r=RalfJung,nikicMatthias Krüger-40/+95
compiler: add simd_ctpop intrinsic Fairly straightforward addition. cc `@rust-lang/opsem` new (extremely boring) intrinsic
2024-05-21Rollup merge of #125225 - madsmtm:ios-crt_externs.h, r=workingjubileeMatthias Krüger-150/+127
Use functions from `crt_externs.h` on iOS/tvOS/watchOS/visionOS Use `_NSGetEnviron`, `_NSGetArgc` and `_NSGetArgv` on iOS/tvOS/watchOS/visionOS, see each commit and the code comments for details. This allows us to unify more code with the macOS implementation, as well as avoiding linking to the `Foundation` framework (which is good for startup performance). The biggest problem with doing this would be if it lead to App Store rejections. After doing a bunch of research on this, while [it did happen once in 2009](https://blog.unity.com/engine-platform/unity-app-store-submissions-problem-solved), I find it fairly unlikely to happen nowadays, especially considering that Apple has later _added_ `crt_externs.h` to the iOS/tvOS/watchOS/visionOS SDKs, strongly signifying the functions therein is indeed supported on those platforms (even though they lack an availability attribute). That we've been overly cautious here has also been noted by `@thomcc` in https://github.com/rust-lang/rust/pull/117910#issuecomment-1903372350. r? `@workingjubilee` `@rustbot` label O-apple
2024-05-21Rollup merge of #125218 - Oneirical:easy-test-the-third, r=jieyouxuMatthias Krüger-9/+17
Migrate `run-make/no-intermediate-extras` to new `rmake.rs` Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2024-05-21Rollup merge of #125011 - diondokter:opt-for-size, r=Amanieu,kobzolMatthias Krüger-1/+12
Add opt-for-size core lib feature flag Adds a feature flag to the core library that enables the possibility to have smaller implementations for certain algorithms. So far, the core lib has traded performance for binary size. This is likely what most people want since they have big simd-capable machines. However, people on small machines, like embedded devices, don't enjoy the potential speedup of the bigger algorithms, but do have to pay for them. These microcontrollers often only have 16-1024kB of flash memory. This PR is the result of some talks with project members like `@Amanieu` at RustNL. There are some open questions of how this is eventually stabilized, but it's a similar question as with the existing `panic_immediate_abort` feature. Speaking as someone from the embedded side, we'd rather have this unstable for a while as opposed to not having it at all. In the meantime we can try to use it and also add additional PRs to the core lib that uses the feature flag in areas where we find benefit. Open questions from my side: - Is this a good feature name? - `panic_immediate_abort` is fairly verbose, so I went with something equally verbose - It's easy to refactor later - I've added the feature to `std` and `alloc` as well as they might benefit too. Do we agree? - I expect these to get less usage out of the flag since most size-constraint projects don't use these libraries often.
2024-05-21Rollup merge of #124772 - madsmtm:apple-platform-support-docs, r=oli-obkMatthias Krüger-177/+376
Refactor documentation for Apple targets Refactor the documentation for Apple targets in `rustc`'s platform support page to make it clear what the supported OS version is and which environment variables are being read (`*_DEPLOYMENT_TARGET` and `SDKROOT`). This fixes https://github.com/rust-lang/rust/issues/124215. Note that I've expanded the `aarch64-apple-ios-sim` maintainers `@badboy` and `@deg4uss3r` to include being maintainer of all `*-apple-ios-*` targets. If you do not wish to be so, please state that, then I'll explicitly note that in the docs. Additionally, I've added myself as co-maintainer of most of these targets. r? `@thomcc` I think the documentation you've previously written on tvOS is great, have mostly modified it to have a more consistent formatting with the rest of the Apple target. I recognize that there's quite a few changes here, feel free to ask about any of them! --- CC `@simlay` `@Nilstrieb` `@rustbot` label O-apple
2024-05-21Rollup merge of #124570 - nnethercote:misc-cleanups, r=michaelwoeristerMatthias Krüger-59/+47
Miscellaneous cleanups A mix of small cleanups made while looking at various things. r? `@wesleywiser`
2024-05-21Auto merge of #124097 - compiler-errors:box-into-iter, r=WaffleLapkinbors-247/+688
Add `IntoIterator` for `Box<[T]>` + edition 2024-specific lints * Adds a similar method probe opt-out mechanism to the `[T;N]: IntoIterator` implementation for edition 2021. * Adjusts the relevant lints (shadowed `.into_iter()` calls, new source of method ambiguity). * Adds some tests. * Took the liberty to rework the logic in the `ARRAY_INTO_ITER` lint, since it was kind of confusing. Based mostly off of #116607. ACP: rust-lang/libs-team#263 References #59878 Tracking for Rust 2024: https://github.com/rust-lang/rust/issues/123759 Crater run was done here: https://github.com/rust-lang/rust/pull/116607#issuecomment-1770293013 Consensus afaict was that there is too much breakage, so let's do this in an edition-dependent way much like `[T; N]: IntoIterator`.
2024-05-21Migrate `run-make/rustdoc-scrape-examples-multiple` to `rmake.rs`Guillaume Gomez-27/+6
2024-05-21Auto merge of #123812 - compiler-errors:additional-fixes, r=fmeasebors-173/+170
Follow-up fixes to `report_return_mismatched_types` Some renames, simplifications, fixes, etc. Follow-ups to #123804. I don't think it totally disentangles this code, but it does remove some of the worst offenders on the "I am so confused" scale (e.g. `get_node_fn_decl`).
2024-05-21Auto merge of #125298 - tesuji:arrcmp, r=nikicbors-0/+18
Add codegen test for array comparision opt Fixed since rust 1.55 closes #62531
2024-05-21Sort `rustc_middle` attributes.Nicholas Nethercote-19/+21
As is already done in several other crates, such as `rustc_errors`.
2024-05-21Remove unused features from `rustc_middle`.Nicholas Nethercote-3/+1
2024-05-21Remove erroneous comment.Nicholas Nethercote-6/+0
The comment was originally in `src/librustc_mir/lib.rs`, but now that it's in `compiler/rustc_const_eval/src/lib.rs` it's no longer appropriate.
2024-05-21Minor `pub` and whitespace cleanups.Nicholas Nethercote-8/+6
2024-05-21Reorder some `use` items.Nicholas Nethercote-15/+10
2024-05-21Reorder top-level attributes.Nicholas Nethercote-8/+9
And remove an unnecessary `feature(try_blocks)`.
2024-05-20Move 100 entries from tests/ui into subdirsJubilee Young-45/+42
- Move super-fast-paren-parsing test into ui/parser - Move stmt_expr_attrs test into ui/feature-gates - Move macro tests into ui/macros - Move global_asm tests into ui/asm - Move env tests into ui/process - Move xcrate tests into ui/cross-crate - Move unop tests into ui/unop - Move backtrace tests into ui/backtrace - Move check-static tests into ui/statics - Move expr tests into ui/expr - Move optimization fuel tests into ui/fuel - Move ffi attribute tests into ui/ffi-attrs - Move suggestion tests into ui/suggestions - Move main tests into ui/fn-main - Move lint tests into ui/lint - Move repr tests into ui/repr - Move intrinsics tests into ui/intrinsics - Move tool lint tests into ui/tool-attributes - Move return tests into ui/return - Move pattern tests into ui/patttern - Move range tests into ui/range - Move foreign-fn tests into ui/foreign - Move orphan-check tests into ui/coherence - Move inference tests into ui/inference - Reduce ROOT_ENTRY_LIMIT
2024-05-21Auto merge of #125284 - compiler-errors:uplift-misc, r=lcnrbors-238/+309
Uplift `RegionVid`, `TermKind` to `rustc_type_ir`, and `EagerResolver` to `rustc_next_trait_solver` - Uplift `RegionVid`. This was complicated due to the fact that we implement `polonius_engine::Atom` for `RegionVid` -- but I just separated that into `PoloniusRegionVid`, and added `From`/`Into` impls so it can be defined in `rustc_borrowck` separately. Coherence 😵 - Change `InferCtxtLike` to expose `opportunistically_resolve_{ty,ct,lt,int,float}_var` so that we can uplift `EagerResolver` for use in the canonicalization methods. - Uplift `TermKind` much like `GenericArgKind` All of this is miscellaneous dependencies for making more `EvalCtxt` methods generic.
2024-05-20simplifyOneirical-9/+4
2024-05-21Auto merge of #125349 - matthiaskrgr:rollup-p2mbdxi, r=matthiaskrgrbors-357/+772
Rollup of 8 pull requests Successful merges: - #124050 (Remove libc from MSVC targets) - #124283 (Note for E0599 if shadowed bindings has the method.) - #125123 (Fix `read_exact` and `read_buf_exact` for `&[u8]` and `io:Cursor`) - #125158 (hir pretty: fix block indent) - #125308 (track cycle participants per root) - #125332 (Update books) - #125333 (switch to the default implementation of `write_vectored`) - #125346 (Remove some `Path::to_str` from `rustc_codegen_llvm`) Failed merges: - #125310 (Move ~100 tests from tests/ui to subdirs) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-20Inline get_node_fn_decl into get_fn_decl, simplify/explain logic in ↵Michael Goulet-120/+123
report_return_mismatched_types
2024-05-21Add codegen test for array comparision optLzu Tao-0/+18
2024-05-20Rename confusing function nameMichael Goulet-9/+9
2024-05-20Remove redundant blk_id parameterMichael Goulet-25/+32
2024-05-20No need to pass parent of block for BlockTailExpressionMichael Goulet-2/+1