about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-08-03Promote riscv64gc-unknown-linux-musl to tier 2Amanieu d'Antras-2/+13
2024-08-01Auto merge of #128504 - matthiaskrgr:rollup-pawylnk, r=matthiaskrgrbors-417/+500
Rollup of 6 pull requests Successful merges: - #127490 (Add target page for riscv64gc-unknown-linux-gnu) - #128433 (fix(hermit): `deny(unsafe_op_in_unsafe_fn)`) - #128482 (interpret: on a signed deref check, mention the right pointer in the error) - #128496 (Fix removed `box_syntax` diagnostic if source isn't available) - #128497 (fix dropck documentation for `[T;0]` special-case) - #128499 (chore: refactor backtrace formatting) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-01Rollup merge of #128499 - Konippi:refactor-backtrace-formatting, r=tgross35Matthias Krüger-7/+2
chore: refactor backtrace formatting Replace `write_str()` with the `writeln!()` macro, consolidating multiple write operations.
2024-08-01Rollup merge of #128497 - Bryanskiy:fix-dropck-doc, r=lcnrMatthias Krüger-3/+4
fix dropck documentation for `[T;0]` special-case fixes https://github.com/rust-lang/rust/issues/110288. r? ``@lcnr``
2024-08-01Rollup merge of #128496 - clubby789:box-syntax-multipart, r=compiler-errorsMatthias Krüger-17/+28
Fix removed `box_syntax` diagnostic if source isn't available Fix #128442
2024-08-01Rollup merge of #128482 - RalfJung:ptr-signed-offset, r=oli-obkMatthias Krüger-334/+277
interpret: on a signed deref check, mention the right pointer in the error When a negative offset (like `ptr.offset(-10)`) goes out-of-bounds, we currently show an error saying that we expect the *resulting* pointer to be inbounds for 10 bytes. That's confusing, so this PR makes it so that instead we say that we expect the *original* pointer `ptr` to have 10 bytes *to the left*. I also realized I can simplify the pointer arithmetic logic and handling of "staying inbounds of a target `usize`" quite a bit; the second commit does that.
2024-08-01Rollup merge of #128433 - hermit-os:hermit-unsafe_op_in_unsafe_fn, r=joboetMatthias Krüger-55/+58
fix(hermit): `deny(unsafe_op_in_unsafe_fn)` Tracking issue: https://github.com/rust-lang/rust/issues/127747 r? workingjubilee CC: ``@stlankes``
2024-08-01Rollup merge of #127490 - ↵Matthias Krüger-1/+131
ferrocene:hoverbear/add-riscv64gc-unknown-linux-target-page, r=pietroalbini Add target page for riscv64gc-unknown-linux-gnu I was reading https://github.com/rust-lang/rust/issues/113739 and realized I knew most of the information necessary to create the `riscv64gc-unknown-linux-gnu` target page.
2024-08-02chore: refactor backtrace formattingKonippi-7/+2
2024-08-01fix dropck documentation for `[T;0]` special-caseBryanskiy-3/+4
2024-08-01Auto merge of #128490 - lnicola:sync-from-ra, r=lnicolabors-7886/+15238
Subtree update of `rust-analyzer` r? `@ghost`
2024-08-01Fix removed `box_syntax` diagnostic if source isn't availableclubby789-17/+28
2024-08-01fix the way we detect overflow for inbounds arithmetic (and tweak the error ↵Ralf Jung-11/+17
message)
2024-08-01interpret: simplify pointer arithmetic logicRalf Jung-187/+73
2024-08-01on a signed deref check, mention the right pointer in the errorRalf Jung-141/+192
2024-08-01Auto merge of #127543 - carbotaniuman:more_unsafe_attr_verification, ↵bors-92/+471
r=estebank,traviscross More unsafe attr verification This code denies unsafe on attributes such as `#[test]` and `#[ignore]`, while also changing the `MetaItem` parsing so `unsafe` in args like `#[allow(unsafe(dead_code))]` is not accidentally allowed. Tracking: - https://github.com/rust-lang/rust/issues/123757
2024-08-01Auto merge of #17761 - RalfJung:josh-roudntrip-error, r=lnicolabors-1/+4
when josh-proxy screws up the roundtrip, say what the involved commits are Helps debugging https://github.com/rust-lang/rust-analyzer/issues/17733
2024-08-01fix(os/hermit): `deny(unsafe_op_in_unsafe_fn)`Martin Kröning-0/+1
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2024-08-01fix(pal/hermit): `deny(unsafe_op_in_unsafe_fn)`Martin Kröning-20/+40
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2024-08-01refactor(pal/hermit): make `ENV` a non-mutable staticMartin Kröning-19/+15
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2024-08-01when josh-proxy screws up the roundtrip, say what the involved commits areRalf Jung-1/+4
2024-08-01Auto merge of #17756 - Wilfred:fix_adoc_json, r=Veykrilbors-9/+7
docs: Fix JSON example for rust-analyzer.workspace.discoverConfig The user does not specify `{arg}` in their JSON, and be pedantic about commas in JSON sample.
2024-08-01Auto merge of #128481 - matthiaskrgr:rollup-efa706r, r=matthiaskrgrbors-114/+122
Rollup of 6 pull requests Successful merges: - #128416 (android: Remove libstd hacks for unsupported Android APIs) - #128437 (improve bootstrap to allow selecting llvm tools individually) - #128450 (Create COFF archives for non-LLVM backends) - #128458 (Emit an error if `#[optimize]` is applied to an incompatible item) - #128477 (Finish blessing `coverage/mcdc` tests after LLVM 19 upgrade) - #128478 (Ignore `use` declaration reformatting in `.git-blame-ignore-revs`.) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-01Rollup merge of #128478 - nnethercote:update-git-blame-ignore-revs, r=jieyouxuMatthias Krüger-0/+2
Ignore `use` declaration reformatting in `.git-blame-ignore-revs`. The reformatting was done in #125443. r? `@lcnr`
2024-08-01Rollup merge of #128477 - Zalathar:bless-mcdc-19, r=cuviperMatthias Krüger-0/+5
Finish blessing `coverage/mcdc` tests after LLVM 19 upgrade Context: https://github.com/rust-lang/rust/pull/127513#issuecomment-2260887708 These changes aren't needed for Rust CI, because after the LLVM 19 upgrade we have no jobs that run these tests in `coverage-run` mode against LLVM 18. But they might help external builds. The longer-term plan is to completely drop (unstable) MC/DC support on LLVM 18, as part of getting it working on LLVM 19 in #126733. cc `@cuviper`
2024-08-01Rollup merge of #128458 - clubby789:optimize-unused-attr, r=compiler-errorsMatthias Krüger-0/+78
Emit an error if `#[optimize]` is applied to an incompatible item #54882 The RFC specifies that this should emit a lint. I used the same allow logic as the `coverage` attribute (also allowing modules and impl blocks) - this should possibly be changed depending on if it's decided to allow 'propogation' of the attribute.
2024-08-01Rollup merge of #128450 - dpaoliello:coff, r=bjorn3Matthias Krüger-5/+1
Create COFF archives for non-LLVM backends `ar_archive_writer` now supports creating COFF archives, so enable them for the non-LLVM backends when requested. r? ``@bjorn3``
2024-08-01Rollup merge of #128437 - onur-ozkan:handle-llvm-tools-properly, ↵Matthias Krüger-3/+34
r=albertlarsan68,Kobzol improve bootstrap to allow selecting llvm tools individually Everything works as before, + now bootstrap allows for individually selecting LLVM tools (e.g., `x dist opt llvm-dis`) to include in the dist artifact.
2024-08-01Rollup merge of #128416 - maurer:remove-android-hack, r=tgross35Matthias Krüger-106/+2
android: Remove libstd hacks for unsupported Android APIs Our minimum supported API version is 21, remove hacks to support older Android APIs. try-job: arm-android r? tgross35
2024-08-01Auto merge of #127060 - Oneirical:testificate, r=jieyouxubors-124/+188
Migrate `symbol-visibility` `run-make` test to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Pretty scary! - The expected number of symbols on each check has been changed slightly to reflect the differences between `llvm_readobj` and `nm`, as I think the former will print hidden symbols once and visible symbols twice, while the latter will only print visible symbols. - The original test ran the same exact checks on `cdylib` twice, for seemingly no reason. I have removed it. - This may be possible to optimize some more? `llvm_readobj` could get called only once for each library type, and the regex could avoid being created repeatedly. I am not sure if these kinds of considerations are important for a `run-make` test. Demands a Windows try-job. try-job: x86_64-mingw
2024-08-01Ignore `use` declaration reformatting in `.git-blame-ignore-revs`.Nicholas Nethercote-0/+2
2024-08-01Finish blessing `coverage/mcdc` tests after LLVM 19 upgradeZalathar-0/+5
2024-08-01Auto merge of #128461 - matthiaskrgr:rollup-3dpp11g, r=matthiaskrgrbors-1332/+1590
Rollup of 7 pull requests Successful merges: - #123813 (Add `REDUNDANT_IMPORTS` lint for new redundant import detection) - #126697 ([RFC] mbe: consider the `_` in 2024 an expression) - #127159 (match lowering: Hide `Candidate` from outside the lowering algorithm) - #128244 (Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck, remove some hacks) - #128431 (Add myself as VxWorks target maintainer for reference) - #128438 (Add special-case for [T, 0] in dropck_outlives) - #128457 (Fix docs for OnceLock::get_mut_or_init) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-01Auto merge of #128469 - matthiaskrgr:rollup-00svite, r=matthiaskrgrbors-212/+488
Rollup of 6 pull requests Successful merges: - #127567 (std: implement the `once_wait` feature) - #128162 (Cleanup sys module to match house style) - #128296 (Update target-spec metadata for loongarch64 targets) - #128443 (Properly mark loop as diverging if it has no breaks) - #128449 (Temporarily switch `ambiguous_negative_literals` lint to allow) - #128452 (derive(SmartPointer): require pointee to be maybe sized) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-31docs: Fix JSON example for rust-analyzer.workspace.discoverConfigWilfred Hughes-9/+7
The user does not specify `{arg}` in their JSON, and be pedantic about commas in JSON sample.
2024-08-01Rollup merge of #128452 - dingxiangfei2009:smart-ptr-require-maybe-sized, ↵Matthias Krüger-37/+69
r=compiler-errors derive(SmartPointer): require pointee to be maybe sized cc ``@Darksonn`` So `#[pointee]` has to be `?Sized` in order for deriving `SmartPointer` to be meaningful. cc ``@compiler-errors`` for suggestions in #127681
2024-08-01Rollup merge of #128449 - Urgau:tmp-allow-negative-lit-lint, r=compiler-errorsMatthias Krüger-13/+20
Temporarily switch `ambiguous_negative_literals` lint to allow This PR temporarily switch the `ambiguous_negative_literals` lint to `allow-by-default`, as asked by T-lang in https://github.com/rust-lang/rust/issues/128287#issuecomment-2260902036.
2024-08-01Rollup merge of #128443 - compiler-errors:async-unreachable, r=fmeaseMatthias Krüger-21/+67
Properly mark loop as diverging if it has no breaks Due to specifics about the desugaring of the `.await` operator, HIR typeck doesn't recognize that `.await`ing an `impl Future<Output = !>` will diverge in the same way as calling a `fn() -> !`. This is because the await operator desugars to approximately: ```rust loop { match future.poll(...) { Poll::Ready(x) => break x, Poll::Pending => {} } } ``` We know that the value of `x` is `!`, however since `break` is a coercion site, we coerce `!` to some `?0` (the type of the loop expression). Then since the type of the `loop {...}` expression is `?0`, we will not detect the loop as diverging like we do with other expressions that evaluate to `!`: https://github.com/rust-lang/rust/blob/0b5eb7ba7bd796fb39c8bb6acd9ef6c140f28b65/compiler/rustc_hir_typeck/src/expr.rs#L240-L243 We can technically fix this in two ways: 1. Make coercion of loop exprs more eagerly result in a type of `!` when the only break expressions have type `!`. 2. Make loops understand that all of that if they have only diverging break values, then the loop diverges as well. (1.) likely has negative effects on inference, and seems like a weird special case to drill into coercion. However, it turns out that (2.) is very easy to implement, we already record whether a loop has any break expressions, and when we do so, we actually skip over any break expressions with diverging values!: https://github.com/rust-lang/rust/blob/0b5eb7ba7bd796fb39c8bb6acd9ef6c140f28b65/compiler/rustc_hir_typeck/src/expr.rs#L713-L716 Thus, we can consider the loop as diverging if we see that it has no breaks, which is the change implemented in this PR. This is not usually a problem in regular code for two reasons: 1. In regular code, we already mark `break diverging()` as unreachable if `diverging()` is unreachable. We don't do this for `.await`, since we suppress unreachable errors within `.await` (#64930). Un-suppressing this code will result in spurious unreachable expression errors pointing to internal await machinery. 3. In loops that truly have no breaks (e.g. `loop {}`), we already evaluate the type of the loop to `!`, so this special case is kinda moot. This only affects loops that have `break`s with values of type `!`. Thus, this seems like a change that may affect more code than just `.await`, but it likely does not in meaningful ways; if it does, it's certainly correct to apply. Fixes #128434
2024-08-01Rollup merge of #128296 - heiher:update-metadata, r=UrgauMatthias Krüger-6/+6
Update target-spec metadata for loongarch64 targets
2024-08-01Rollup merge of #128162 - ChrisDenton:cleanup, r=joboetMatthias Krüger-41/+28
Cleanup sys module to match house style This moves a test file out of sys as it's just testing std types. Also cleans up some assorted bits including making the `use` statements match the house style.
2024-08-01Rollup merge of #127567 - joboet:once_wait, r=AmanieuMatthias Krüger-94/+298
std: implement the `once_wait` feature Tracking issue: #127527 This additionally adds a `wait_force` method to `Once` that doesn't panic on poison. I also took the opportunity and cleaned up up the code of the queue-based implementation a bit.
2024-07-31Rollup merge of #128457 - juntyr:once-lock-docs, r=tgross35Matthias Krüger-3/+3
Fix docs for OnceLock::get_mut_or_init Removes an incorrect statment about concurrency from the `OnceLock::get_mut_or_init` (tracked in #121641) docs. Fixes #128429
2024-07-31Rollup merge of #128438 - Bryanskiy:empty-array-dropck, r=lcnrMatthias Krüger-2/+32
Add special-case for [T, 0] in dropck_outlives implements/fixes #110288. r? `@lcnr`
2024-07-31Rollup merge of #128431 - biabbas:master, r=UrgauMatthias Krüger-6/+58
Add myself as VxWorks target maintainer for reference Hi, would be working on VxWorks regularly, thus adding myself as a target maintainer. r? ```@workingjubilee```
2024-07-31Rollup merge of #128244 - compiler-errors:move-clone-sugg, r=estebankMatthias Krüger-351/+111
Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck, remove some hacks Also remove a heck of a lot of weird hacks in `suggest_cloning` that I don't think we should have around. I know this regresses tests, but I don't believe most of these suggestions were accurate, b/c: 1. They either produced type errors (e.g. turning `&x` into `x.clone()`) 2. They don't fix the issue 3. They fix the issue ostensibly, but introduce logic errors (e.g. cloning a `&mut Option<T>` to then `Option::take` out...) Most of the suggestions are still wrong, but they're not particularly *less* wrong IMO. Stacked on top of #128241, which is an "obviously worth landing" subset of this PR. r? estebank
2024-07-31Rollup merge of #127159 - Nadrieril:hide-candidate, r=matthewjasperMatthias Krüger-907/+971
match lowering: Hide `Candidate` from outside the lowering algorithm The internals of `Candidate` are tricky and a source of confusion. This PR makes it so we don't expose `Candidate`s outside the lowering algorithm. Now: - false edges are handled in `lower_match_tree`; - `lower_match_tree` takes a list of patterns as input; - `lower_match_tree` returns a flat datastructure that contains only the necessary information. r? ```@matthewjasper```
2024-07-31Rollup merge of #126697 - vincenzopalazzo:macros/find_the_expression_tok, ↵Matthias Krüger-1/+83
r=eholk,compiler-errors [RFC] mbe: consider the `_` in 2024 an expression This commit is adding the possibility to parse the `_` as an expression inside the esition 2024. Link: https://rust-lang.zulipchat.com/#narrow/stream/404510-wg-macros/topic/supporting.20.60_.60.20expressions Issue https://github.com/rust-lang/rust/issues/123742 r? `@eholk`
2024-07-31Rollup merge of #123813 - compiler-errors:redundant-lint, r=petrochenkovMatthias Krüger-62/+332
Add `REDUNDANT_IMPORTS` lint for new redundant import detection Defaults to Allow for now. Stacked on #123744 to avoid merge conflict, but much easier to review all as one. r? petrochenkov
2024-07-31Emit an error if `#[optimize]` is applied to an incompatible itemclubby789-0/+78
2024-07-31tweak comment on `NonterminalKind::Expr`Michael Goulet-1/+1
Co-authored-by: Eric Holk <eric@theincredibleholk.org>