about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2024-03-05[AIX] Remove AixLinker's debuginfo() implementationKai Luo-10/+1
`-s` option doesn't perfectly fit into debuginfo()'s semantics and may unexpectedly remove metadata in shared libraries. Remove the implementation and suggest user to use `strip` utility instead.
2024-03-05Auto merge of #121780 - nnethercote:diag-renaming2, r=davidtwcobors-602/+566
Diagnostic renaming 2 A sequel to #121489. r? `@davidtwco`
2024-03-05Adjust `Diag::new` signature.Nicholas Nethercote-1/+1
Make it use `impl Into<DiagMessage>` like all the other methods nearby.
2024-03-05Rename `DiagnosticMetadata` as `DiagMetadata`.Nicholas Nethercote-92/+86
2024-03-05Rename `StructuredDiagnostic` as `StructuredDiag`.Nicholas Nethercote-12/+10
2024-03-05Rename `BuiltinLintDiagnostics` as `BuiltinLintDiag`.Nicholas Nethercote-113/+105
Not the dropping of the trailing `s` -- this type describes a single diagnostic and its name should be singular.
2024-03-05Rename `DiagnosticMode` as `DiagMode`.Nicholas Nethercote-22/+19
2024-03-05Rename `SubdiagnosticMessageOp` as `SubdiagMessageOp`.Nicholas Nethercote-54/+52
2024-03-05Rename `SubdiagnosticMessage` as `SubdiagMessage`.Nicholas Nethercote-78/+76
2024-03-05Fix some out-of-date comments.Nicholas Nethercote-4/+4
2024-03-05Rename `DiagnosticMessage` as `DiagMessage`.Nicholas Nethercote-241/+228
2024-03-05Auto merge of #120675 - oli-obk:intrinsics3.0, r=pnkfelixbors-47/+134
Add a scheme for moving away from `extern "rust-intrinsic"` entirely All `rust-intrinsic`s can become free functions now, either with a fallback body, or with a dummy body and an attribute, requiring backends to actually implement the intrinsic. This PR demonstrates the dummy-body scheme with the `vtable_size` intrinsic. cc https://github.com/rust-lang/rust/issues/63585 follow-up to #120500 MCP at https://github.com/rust-lang/compiler-team/issues/720
2024-03-04Auto merge of #121998 - matthiaskrgr:rollup-l7lzwpb, r=matthiaskrgrbors-635/+627
Rollup of 10 pull requests Successful merges: - #120976 (constify a couple thread_local statics) - #121683 (Fix LVI tests after frame pointers are enabled by default) - #121703 (Add a way to add constructors for `rustc_type_ir` types) - #121732 (Improve assert_matches! documentation) - #121928 (Extract an arguments struct for `Builder::then_else_break`) - #121939 (Small enhancement to description of From trait) - #121968 (Don't run test_get_os_named_thread on win7) - #121969 (`ParseSess` cleanups) - #121977 (Doc: Fix incorrect reference to integer in Atomic{Ptr,Bool}::as_ptr.) - #121994 (Update platform-support.md with supported musl version) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-04Rollup merge of #121969 - nnethercote:ParseSess-cleanups, r=wesleywiserMatthias Krüger-531/+499
`ParseSess` cleanups The main change here is to rename all `ParseSess` values as `psess`. Plus a few other small cleanups. r? `@wesleywiser`
2024-03-04Rollup merge of #121928 - Zalathar:then-else-args, r=NadrierilMatthias Krüger-66/+72
Extract an arguments struct for `Builder::then_else_break` Most of this method's arguments are usually or always forwarded as-is to recursive invocations. Wrapping them in a dedicated struct allows us to document each struct field, and lets us use struct-update syntax to indicate which arguments are being modified when making a recursive call. --- While trying to understand the lowering of `if` expressions, I found it difficult to keep track of the half-dozen arguments passed through to every call to `then_else_break`. I tried switching over to an arguments struct, and I found that it really helps to make sense of what each argument does, and how each call is modifying the arguments. I have some further ideas for how to streamline these recursive calls, but I've kept those out of this PR so that it's a pure refactoring with no behavioural changes.
2024-03-04Rollup merge of #121703 - compiler-errors:new, r=lcnrMatthias Krüger-35/+53
Add a way to add constructors for `rustc_type_ir` types Introduces a module called `rustc_type_ir`, in which we can place traits which are named `Ty`/`Region`/`Const`/etc. which expose constructors for the `rustc_type_ir` types. This means we can construct things `Interner::Ty` with `Ty::new_x(...)`, which is needed to uplift the new trait solver into an interner-agnostic crate. These traits are placed into a *separate* module because they're only intended to be used in interner-agnostic code, and they should mirror the constructors that are provided by the inherent constructor methods in `rustc_middle`. Putting this up for vibe-check mostly. I haven't copied over any of the type constructors, except for one to create bound types for use in the canonicalizer. r? lcnr
2024-03-04Rollup merge of #120976 - matthiaskrgr:constify_TL_statics, r=lcnrMatthias Krüger-3/+3
constify a couple thread_local statics
2024-03-05Rename all `ParseSess` variables/fields/lifetimes as `psess`.Nicholas Nethercote-508/+489
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
2024-03-04Auto merge of #120468 - alexcrichton:start-wasm32-wasi-rename, r=wesleywiserbors-114/+64
Add a new `wasm32-wasip1` target to rustc This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-04make `intrinsic` query legal for any `DefId`Oli Scherer-11/+11
2024-03-04Remove some depgraph edges on the HIR by invoking the intrinsic query ↵Oli Scherer-6/+5
instead of checking the attribute
2024-03-04Avoid some boolean argument footgunsOli Scherer-10/+26
2024-03-04Add a scheme for moving away from `extern "rust-intrinsic"` entirelyOli Scherer-5/+59
2024-03-04Return a struct from `query intrinsic` to be able to add another field in ↵Oli Scherer-26/+33
the next commit
2024-03-04Add `is_intrinsic` helperOli Scherer-3/+14
2024-03-04Allow a way to add constructors for rustc_type_ir typesMichael Goulet-35/+53
2024-03-04Auto merge of #121964 - matthiaskrgr:rollup-rtcju5m, r=matthiaskrgrbors-37/+81
Rollup of 3 pull requests Successful merges: - #121130 (Suggest moving definition if non-found macro_rules! is defined later) - #121912 (Properly deal with GATs when looking for method chains to point at) - #121927 (Add a proper `with_no_queries` to printing) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-04Extract an arguments struct for `Builder::then_else_break`Zalathar-66/+72
Most of this method's arguments are usually or always forwarded as-is to recursive invocations. Wrapping them in a dedicated struct allows us to document each struct field, and lets us use struct-update syntax to indicate which arguments are being modified when making a recursive call.
2024-03-04Rollup merge of #121927 - Zoxc:print-no-query, r=estebankMatthias Krüger-20/+23
Add a proper `with_no_queries` to printing
2024-03-04Rollup merge of #121912 - fmease:diag-method-chains-gat, ↵Matthias Krüger-16/+14
r=compiler-errors,estebank Properly deal with GATs when looking for method chains to point at Fixes #121898. ~~While it prevents an ICE and the structured suggestion is correct, the method chain diagnostic notes are weird / useless / incorrect judging by a quick look. I guess I should improve that in this PR.~~ Sufficiently taken care of. r? estebank or compiler-errors (#105332, #105674).
2024-03-04Rollup merge of #121130 - chenyukang:yukang-fix-121061-macro-later, ↵Matthias Krüger-1/+44
r=matthiaskrgr Suggest moving definition if non-found macro_rules! is defined later Fixes #121061
2024-03-04Rename a misnamed `Session` parameter.Nicholas Nethercote-4/+4
2024-03-04Auto merge of #121900 - chenyukang:yukang-fix-121425-repr-pack-error, ↵bors-15/+57
r=compiler-errors Fix misleading message in struct repr alignment and packed Fixes #121425 By the way, fix the spans for the argument in the second commit.
2024-03-04Move `sess` function and use it more.Nicholas Nethercote-10/+8
2024-03-04Remove `file_path_mapping` param from `ParseSess::new`.Nicholas Nethercote-15/+7
It's always empty.
2024-03-04Tweak `parse_asm_args`.Nicholas Nethercote-5/+2
It doesn't need a `Parser` and a `ParseSess`, because the former contains the latter.
2024-03-04Auto merge of #121955 - matthiaskrgr:rollup-1i3lo0j, r=matthiaskrgrbors-22/+29
Rollup of 5 pull requests Successful merges: - #121248 (Move some tests) - #121528 (Consider middle segments of paths in `unused_qualifications`) - #121749 (Don't lint on executable crates with `non_snake_case` names) - #121935 (library/ptr: mention that ptr::without_provenance is equivalent to deriving from the null ptr) - #121945 (Run some ui-fulldeps tests on stage 1 again) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-03Auto merge of #121665 - erikdesjardins:ptradd, r=nikicbors-183/+86
Always generate GEP i8 / ptradd for struct offsets This implements #98615, and goes a bit further to remove `struct_gep` entirely. Upstream LLVM is in the beginning stages of [migrating to `ptradd`](https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699). LLVM 19 will [canonicalize](https://github.com/llvm/llvm-project/pull/68882) all constant-offset GEPs to i8, which has roughly the same effect as this change. Fixes #121719. Split out from #121577. r? `@nikic`
2024-03-03Rollup merge of #121749 - jieyouxu:issue-45127-fix, r=petrochenkovMatthias Krüger-0/+5
Don't lint on executable crates with `non_snake_case` names Revives #111130, cc `@GilShoshan94.` Closes #45127.
2024-03-03Rollup merge of #121528 - Alexendoo:unused_qualifications, r=petrochenkovMatthias Krüger-22/+24
Consider middle segments of paths in `unused_qualifications` Currently `unused_qualifications` looks at the last segment of a path to see if it can be trimmed, this PR extends the check to the middle segments also ```rust // currently linted use std::env::args(); std::env::args(); // Removes `std::env::` ``` ```rust // newly linted use std::env; std::env::args(); // Removes `std::` ``` Paths with generics in them are now linted as long as the part being trimmed is before any generic args, e.g. it will now suggest trimming `std::vec::` from `std::vec::Vec<usize>` Paths with any segments that are from an expansion are no longer linted Fixes #100979 Fixes #96698
2024-03-03Add a proper `with_no_queries` to printingJohn Kåre Alsaker-20/+23
2024-03-03Auto merge of #121763 - clubby789:llvm-old-comment, r=cjgillotbors-6/+3
Update outdated LLVM comment The first path no longer exists, but the second does.
2024-03-03Consider middle segments of paths in `unused_qualifications`Alex Macleod-22/+24
2024-03-03Auto merge of #121937 - GuillaumeGomez:rollup-9684vg3, r=GuillaumeGomezbors-7/+74
Rollup of 3 pull requests Successful merges: - #121917 (Add new `pattern_complexity` attribute to add possibility to limit and check recursion in pattern matching) - #121933 (Add missing get_name for wasm::thread.) - #121934 (rustc_log: expose tracing-tree "wraparound" in an env var) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-03Rollup merge of #121934 - RalfJung:tree-wraparound, r=oli-obkGuillaume Gomez-1/+18
rustc_log: expose tracing-tree "wraparound" in an env var This would be RUSTC_LOG_WRAPTREE, but I am open to other names. r? `@oli-obk`
2024-03-03Rollup merge of #121917 - GuillaumeGomez:pattern-complexity_limit.rs, ↵Guillaume Gomez-6/+56
r=Nadrieril Add new `pattern_complexity` attribute to add possibility to limit and check recursion in pattern matching Needed for https://github.com/rust-lang/rust-analyzer/issues/9528. This PR adds a new attribute only available when running rust testsuite called `pattern_complexity` which allows to set the maximum recursion for the pattern matching. It is quite useful to ensure the complexity doesn't grow, like in `tests/ui/pattern/usefulness/issue-118437-exponential-time-on-diagonal-match.rs`. r? `@Nadrieril`
2024-03-03Add new `pattern_complexity` attribute to add possibility to limit and check ↵Guillaume Gomez-6/+56
recursion in pattern matching
2024-03-03Auto merge of #121903 - Nilstrieb:rename-qnx-file, r=WaffleLapkinbors-1/+1
Remove underscore from QNX target file name For consistency with the other QNX targets and the actual target names.
2024-03-03rustc_log: expose tracing-tree "wraparound" in an env varRalf Jung-1/+18
2024-03-03fix spans of arguments in diagnosticyukang-5/+12