about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-06-25platform-support.md: remove references to not-yet upstreamed targets.Havard Eidnes-2/+0
2023-06-25SUMMARY.md: add entry for NetBSD.Havard Eidnes-0/+1
2023-06-22Remove extra trailing newlineWesley Wiser-1/+0
2023-05-26platform-support.md: document the various NetBSD targets.Havard Eidnes-6/+117
This is slightly patterned after what OpenBSD has done. This is a step along the path to reduce the number and amount of diffs that pkgsrc carries around for rust, and this documents also some parts which have not yet been upstreamed (mipsel-*).
2023-05-07Add support for NetBSD/aarch64-be (big-endian arm64).Havard Eidnes-0/+19
2023-05-07Auto merge of #111222 - scottmcm:constify-is_ascii, r=thomccbors-15/+96
Constify `[u8]::is_ascii` (unstably) UTF-8 checking in `const fn`-stabilized back in 1.63 (#97367), but apparently somehow ASCII checking was never const-ified, despite being simpler. New constness-tracking issue for `is_ascii`: #111090 I noticed this working on `ascii::Char`: #110998
2023-05-07Auto merge of #111161 - compiler-errors:rtn-super, r=cjgillotbors-50/+210
Support return-type bounds on associated methods from supertraits Support `T: Trait<method(): Bound>` when `method` comes from a supertrait, aligning it with the behavior of associated type bounds (both equality and trait bounds). The only wrinkle is that I have to extend `super_predicates_that_define_assoc_type` to look for *all* items, not just `AssocKind::Ty`. This will also be needed to support `feature(associated_const_equality)` as well, which is subtly broken when it comes to supertraits, though this PR does not fix those yet. There's a slight chance there's a perf regression here, in which case I guess I could split it out into a separate query.
2023-05-07Auto merge of #111125 - xfix:inline-socketaddr-methods, r=Mark-Simulacrumbors-0/+27
Inline SocketAddr methods
2023-05-06Tune the `is_ascii` implementation used for short slicesScott McMurray-10/+58
2023-05-07Auto merge of #111311 - JohnTitor:rollup-vfpjm0d, r=JohnTitorbors-74/+113
Rollup of 7 pull requests Successful merges: - #105583 (Operand::extract_field: only cast llval if it's a pointer and replace bitcast w/ pointercast.) - #110094 (clean up `transmute`s in `core`) - #111150 (added TraitAlias to check_item() for missing_docs) - #111293 (rustc --explain E0726 - grammar fixing (it's => its + add a `the` where it felt right to do so)) - #111300 (Emit while_true lint spanning the entire loop condition) - #111301 (Remove calls to `mem::forget` and `mem::replace` in `Option::get_or_insert_with`.) - #111303 (update Rust Unstable Book docs for `--extern force`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-07Rollup merge of #111303 - mhammerly:extern-force-docs, r=JohnTitorYuki Okushi-0/+2
update Rust Unstable Book docs for `--extern force` Options for `--extern` are documented in [The Rust Unstable Book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/extern-options.html). https://github.com/rust-lang/rust/pull/109421 added a new `force` option and this PR updates the documentation accordingly.
2023-05-07Rollup merge of #111301 - JohnBobbo96:cleanup_option_insert_methods, r=scottmcmYuki Okushi-4/+2
Remove calls to `mem::forget` and `mem::replace` in `Option::get_or_insert_with`. This removes the unneeded calls to `mem::forget` and `mem::replace` in `Option::get_or_insert_with`.
2023-05-07Rollup merge of #111300 - Flying-Toast:while_true_span_condition, ↵Yuki Okushi-2/+1
r=compiler-errors Emit while_true lint spanning the entire loop condition The lint that suggests `loop {}` instead of `while true {}` has functionality to 'pierce' parenthesis in cases like `while (true) {}`. In these cases, the emitted span only went to the hi of the `true` itself, not spanning the entire loop condition. Before: ``` warning: denote infinite loops with `loop { ... }` --> /tmp/foobar.rs:2:5 | 2 | while ((((((true)))))) {} | ^^^^^^^^^^^^^^^^ help: use `loop` | = note: `#[warn(while_true)]` on by default ``` After: ``` warning: denote infinite loops with `loop { ... }` --> /tmp/foobar.rs:2:5 | 2 | while ((((((true)))))) {} | ^^^^^^^^^^^^^^^^^^^^^^ help: use `loop` | = note: `#[warn(while_true)]` on by default ``` This is especially a problem for rustfix.
2023-05-07Rollup merge of #111293 - Astroide:patch-1, r=compiler-errorsYuki Okushi-2/+2
rustc --explain E0726 - grammar fixing (it's => its + add a `the` where it felt right to do so) Very small fix
2023-05-07Rollup merge of #111150 - mj10021:issue-111025-fix, r=petrochenkovYuki Okushi-49/+39
added TraitAlias to check_item() for missing_docs As in issue #111025 the `missing_docs` was not being triggered for trait aliases. I added `TraitAlias` to the pattern match for check_item(), and the lint seems to be behaving appropriately
2023-05-07Rollup merge of #110094 - lukas-code:less-transmute, r=thomccYuki Okushi-13/+9
clean up `transmute`s in `core` * Use `transmute_unchecked` instead of `transmute_copy` for `MaybeUninit::transpose`. * Use manual transmute for `Option<Ordering>` → `i8`.
2023-05-07Rollup merge of #105583 - luqmana:bitcast-immediates, r=oli-obkYuki Okushi-4/+58
Operand::extract_field: only cast llval if it's a pointer and replace bitcast w/ pointercast. Fixes #105439. Also cc `@erikdesjardins,` looks like another place to cleanup as part of #105545
2023-05-07Auto merge of #110693 - clubby789:x-clap-take-2, r=Mark-Simulacrumbors-730/+481
Migrate bootstrap to Clap-based argument parsing Supercedes #108083 I chose to re-do the work rather than rebase the onto the large changes since the original PR. If it's preferred I can instead force-push the original PR to this version. cc `@jyn514` `@albertlarsan68`
2023-05-06Auto merge of #111304 - matthiaskrgr:rollup-b9twh7l, r=matthiaskrgrbors-127/+264
Rollup of 7 pull requests Successful merges: - #111002 (Fix the test directories suggested by `./x.py suggest`) - #111077 (Make more ConstProp tests unit.) - #111151 (check bootstrap scripts syntax) - #111203 (Output LLVM optimization remark kind in `-Cremark` output) - #111237 (asm: loongarch64: Implementation of clobber_abi) - #111274 (Expand the LLVM coverage of `--print target-cpus`) - #111289 (Check arguments length in trivial diagnostic lint) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-06Update compiler/rustc_error_codes/src/error_codes/E0726.mdAstroide-1/+1
Co-authored-by: Michael Goulet <michael@errs.io>
2023-05-06delete whitelist and add checks to check_item() for missing_docsJames Dietz-49/+39
add test and bless
2023-05-06Remove unneeded calls to `mem::forget`John Bobbo-4/+2
and `mem::replace` in `Option::get_or_insert_with`.
2023-05-06Rollup merge of #111289 - clubby789:fix-111280, r=jyn514Matthias Krüger-2/+27
Check arguments length in trivial diagnostic lint Fixes #111280
2023-05-06Rollup merge of #111274 - cuviper:print-target-cpus, r=Mark-SimulacrumMatthias Krüger-14/+16
Expand the LLVM coverage of `--print target-cpus` We've been relying on a custom patch to add `MCSubtargetInfo::getCPUTable` for `rustc --print target-cpus`, and just printing that it's not supported on external LLVM builds. LLVM `main` now has `getAllProcessorDescriptions` that can replace ours, so now we try to use that. In addition, the fallback path can at least print the native and default cpu options. There were also some mismatches in the function signatures here between `LLVM_RUSTLLVM` and otherwise; this is now mitigated by sharing these functions and only using cpp to adjust the function bodies.
2023-05-06Rollup merge of #111237 - loongarch-rs:clobber-abi, r=AmanieuMatthias Krüger-0/+20
asm: loongarch64: Implementation of clobber_abi r? ```@Amanieu```
2023-05-06Rollup merge of #111203 - Kobzol:remark-print-kind, r=tmiaskoMatthias Krüger-2/+13
Output LLVM optimization remark kind in `-Cremark` output Since https://github.com/rust-lang/rust/pull/90833, the optimization remark kind has not been printed. Therefore it wasn't possible to easily determine from the log (in a programmatic way) which remark kind was produced. I think that the most interesting remarks are the missed ones, which can lead users to some code optimization. Maybe we could also change the format closer to the "old" one: ``` note: optimization remark for tailcallelim at /checkout/src/libcore/num/mod.rs:1:0: marked this call a tail call candidate ``` I wanted to programatically parse the remarks so that they could work e.g. with https://github.com/OfekShilon/optview2. However, now that I think about it, probably the proper solution is to tell rustc to output them to YAML and then use the YAML as input for the opt remark visualization tools. The flag for enabling this does not seem to work though (https://github.com/rust-lang/rust/issues/96705#issuecomment-1117632322). Still I think that it's good to output the remark kind anyway, it's an important piece of information. r? ```@tmiasko```
2023-05-06Rollup merge of #111151 - ozkanonur:syntax-check-on-bootstrap-scripts, ↵Matthias Krüger-1/+9
r=Mark-Simulacrum check bootstrap scripts syntax Fails bootstrapping if `x`/`x.ps1` scripts are not valid. Currently, it keeps executing lines until the invalid one.
2023-05-06Rollup merge of #111077 - cjgillot:const-prop-unit, r=Mark-SimulacrumMatthias Krüger-106/+177
Make more ConstProp tests unit.
2023-05-06Rollup merge of #111002 - Zalathar:x-suggest-dirs, r=Mark-SimulacrumMatthias Krüger-2/+2
Fix the test directories suggested by `./x.py suggest` It seems that these paths were correct when #106249 was being written, but since then #106458 has been merged (moving `src/test/` to `tests/`), making the tool's suggestions incorrect.
2023-05-06Migrate bootstrap to Clap-based argumentsclubby789-730/+481
2023-05-06Auto merge of #110972 - ehuss:remove-awscli, r=pietroalbinibors-51/+6
Remove aws cli install. All runner images have the AWS CLI 2 installed, so there isn't a really strong reason to install our own version anymore. The version we were installing was 1.27.122. The runner images currently have 2.11.x (the exact version varies by image). I do not have the means to really test if the new version has any issues. I looked at all the `aws` commands, and none of them seem to be doing anything unusual. The page at https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html contains a list of all the breaking changes, and I didn't see anything that looked important.
2023-05-06Emit while_true lint spanning the entire loop conditionFlying-Toast-2/+1
The lint that suggests `loop {}` instead of `while true {}` has functionality to 'pierce' parenthesis in cases like `while (true) {}`. In these cases, the emitted span only went to the hi of the `true` itself, not spanning the entire loop condition. Before: ``` warning: denote infinite loops with `loop { ... }` --> /tmp/foobar.rs:2:5 | 2 | while ((((((true)))))) {} | ^^^^^^^^^^^^^^^^ help: use `loop` | = note: `#[warn(while_true)]` on by default ``` After: ``` warning: denote infinite loops with `loop { ... }` --> /tmp/foobar.rs:2:5 | 2 | while ((((((true)))))) {} | ^^^^^^^^^^^^^^^^^^^^^^ help: use `loop` | = note: `#[warn(while_true)]` on by default ```
2023-05-06update Rust Unstable Book docs for `--extern force`Matt Hammerly-0/+2
2023-05-06Auto merge of #110907 - Bryanskiy:privacy_ef, r=petrochenkovbors-145/+181
Populate effective visibilities in 'rustc_privacy' Next part of RFC https://github.com/rust-lang/rust/issues/48054. r? `@petrochenkov`
2023-05-06rustc --explain E0726 - grammar fixing (it's => its + add a `the` where it ↵Astroide-2/+2
felt right to do so)
2023-05-06Auto merge of #111287 - matthiaskrgr:rollup-9lzax2c, r=matthiaskrgrbors-413/+1067
Rollup of 7 pull requests Successful merges: - #110577 (Use fulfillment to check `Drop` impl compatibility) - #110610 (Add Terminator conversion from MIR to SMIR, part #1) - #110985 (Fix spans in LLVM-generated inline asm errors) - #110989 (Make the BUG_REPORT_URL configurable by tools ) - #111167 (debuginfo: split method declaration and definition) - #111230 (add hint for =< as <=) - #111279 (More robust debug assertions for `Instance::resolve` on built-in traits with non-standard trait items) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-06Check arguments length in trivial diagnostic lintclubby789-2/+27
2023-05-06Rollup merge of #111279 - compiler-errors:core-item-resolve, r=cjgillotMatthias Krüger-14/+73
More robust debug assertions for `Instance::resolve` on built-in traits with non-standard trait items In #111264, a user added a new item to the `Future` trait, but the code in [`resolve_associated_item`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ty_utils/instance/fn.resolve_associated_item.html) implicitly assumes that the `Future` trait is defined with only one method (`Future::poll`) and treats the generator body as the implementation of that method. This PR adds some debug assertions to make sure that that new methods defined on `Future`/`Generator`/etc. don't accidentally resolve to the wrong item when they are added, and adds a helpful comment guiding a compiler dev (or curious `#![no_core]` user) to what must be done to support adding new associated items to these built-in implementations. I am open to discuss whether a test should be added, but I chose against it because I opted to make these `bug!()`s instead of, e.g., diagnostics or fatal errors. Arguably it doesn't need a test because it's not a bug that can be triggered by an end user, and internal-facing misuses of core kind of touch on rust-lang/compiler-team#620 -- however, I think the assertions I added in this PR are still a very useful way to make sure this bug doesn't waste debugging resources down the line. Fixes #111264
2023-05-06Rollup merge of #111230 - zacklukem:eq-less-to-less-eq, r=compiler-errorsMatthias Krüger-1/+79
add hint for =< as <= Adds a compiler hint for when `=<` is typed instead of `<=` Example hint: ```rust fn foo() { if 1 =< 3 { println!("Hello, World!"); } } ``` ``` error: expected type, found `3` --> main.rs:2:13 | 2 | if 1 =< 3 { | -- ^ expected type | | | help: did you mean: `<=` ``` This PR only emits the suggestion if there is no space between the `=` and `<`. This hopefully narrows the scope of when this error is emitted, however this still allows this error to be emitted in cases such as this: ``` error: expected expression, found `;` --> main.rs:2:18 | 2 | if 1 =< [i32;; 3]>::hello() { | -- ^ expected expression | | | help: did you mean: `<=` ``` Which could be a good reason not to merge since I haven't been able to think of any other ways of narrowing the scope of this diagnostic. closes #111128
2023-05-06Rollup merge of #111167 - cuviper:type-decl-disubprogram, r=michaelwoeristerMatthias Krüger-34/+109
debuginfo: split method declaration and definition When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. Now the subprogram definition gets added at the CU level with a specification link back to the abstract declaration. Both GCC and Clang write debuginfo this way for C++ class methods. Fixes #109730. Fixes #109934.
2023-05-06Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkinMatthias Krüger-114/+118
Make the BUG_REPORT_URL configurable by tools This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. I haven't changed clippy in case they want to make the change upstream instead of the subtree, but I'm happy to do so here if the maintainers want - cc ````@rust-lang/clippy```` Fixes https://github.com/rust-lang/rust/issues/109486.
2023-05-06Rollup merge of #110985 - Amanieu:normalize_asm_spans, r=b-naberMatthias Krüger-3/+31
Fix spans in LLVM-generated inline asm errors Previously, incorrect spans were reported if inline assembly contained CRLF (Windows) line endings. Fixes #110885
2023-05-06Rollup merge of #110610 - spastorino:smir-terminator, r=oli-obkMatthias Krüger-13/+209
Add Terminator conversion from MIR to SMIR, part #1 This adds internal MIR TerminatorKind to SMIR Terminator conversion. r? ```@oli-obk```
2023-05-06Rollup merge of #110577 - compiler-errors:drop-impl-fulfill, r=lcnrMatthias Krüger-234/+448
Use fulfillment to check `Drop` impl compatibility Use an `ObligationCtxt` to ensure that a `Drop` impl does not have stricter requirements than the ADT that it's implemented for, rather than using a `SimpleEqRelation` to (more or less) syntactically equate predicates on an ADT with predicates on an impl. r? types ### Some background The old code reads: ```rust // An earlier version of this code attempted to do this checking // via the traits::fulfill machinery. However, it ran into trouble // since the fulfill machinery merely turns outlives-predicates // 'a:'b and T:'b into region inference constraints. It is simpler // just to look for all the predicates directly. ``` I'm not sure what this means, but perhaps in the 8 years since that this comment was written (cc #23638) it's gotten easier to process region constraints after doing fulfillment? I don't know how this logic differs from anything we do in the `compare_impl_item` module. Ironically, later on it says: ```rust // However, it may be more efficient in the future to batch // the analysis together via the fulfill (see comment above regarding // the usage of the fulfill machinery), rather than the // repeated `.iter().any(..)` calls. ``` Also: * Removes `SimpleEqRelation` which was far too syntactical in its relation. * Fixes #110557
2023-05-06clean up transmutes in coreLukas Markeffsky-13/+9
2023-05-06Auto merge of #109421 - mhammerly:extern-force-option, r=petrochenkovbors-2/+78
Add `force` option for `--extern` flag When `--extern force:foo=libfoo.so` is passed to `rustc` and `foo` is not actually used in the crate, ~inject an `extern crate foo;` statement into the AST~ force it to be resolved anyway in `CrateLoader::postprocess()`. This allows you to, for instance, inject a `#[panic_handler]` implementation into a `#![no_std]` crate without modifying its source so that it can be built as a `dylib`. It may also be useful for `#![panic_runtime]` or `#[global_allocator]`/`#![default_lib_allocator]` implementations. My work previously involved integrating Rust into an existing C/C++ codebase which was built with Buck and shipped on, among other platforms, Android. When targeting Android, Buck builds all "native" code with shared linkage* so it can be loaded from Java/Kotlin. My project was not itself `#![no_std]`, but many of our dependencies were, and they would fail to build with shared linkage due to a lack of a panic handler. With this change, that project can add the new `force` option to the `std` dependency it already explicitly provides to every crate to solve this problem. *This is an oversimplification - Buck has a couple features for aggregating dependencies into larger shared libraries, but none that I think sustainably solve this problem. ~The AST injection happens after macro expansion around where we similarly inject a test harness and proc-macro harness. The resolver's list of actually-used extern flags is populated during macro expansion, and if any of our `--extern` arguments have the `force` option and weren't already used, we inject an `extern crate` statement for them. The injection logic was added in `rustc_builtin_macros` as that's where similar injections for tests, proc-macros, and std/core already live.~ (New contributor - grateful for feedback and guidance!)
2023-05-06Fix spans in LLVM-generated inline asm errorsAmanieu d'Antras-3/+31
Previously, incorrect spans were reported if inline assembly contained CRLF (Windows) line endings. Fixes #110885
2023-05-06Auto merge of #104872 - luqmana:packed-union-align, r=oli-obkbors-81/+397
Avoid alignment mismatch between ABI and layout for unions. Fixes #104802 Fixes #103634 r? `@eddyb` cc `@RalfJung`
2023-05-06More robust debug assertions for `Instance::resolve` on built-in traits with ↵Michael Goulet-14/+73
custom items
2023-05-06Auto merge of #107129 - wesleywiser:musl_1.2_upgrade, r=petrochenkovbors-16/+7
Update the version of musl used on `*-linux-musl` targets to 1.2.3 Update the version of musl used on our Linux musl targets from 1.1.24 to 1.2.3 as proposed in rust-lang/compiler-team#572. musl 1.2.3 is the latest version of musl and supports the same range of Linux kernels as the 1.1 series. As such, it does not affect the minimum supported version of Linux for any of the musl targets. One of the major musl 1.2 features is support for [time64](https://musl.libc.org/time64.html). This support is both source and ABI compatible with programs built against musl 1.1 and so updating the musl version for these targets should not cause Rust programs to fail to run or compile (a [crater run](https://github.com/rust-lang/rust/pull/107129#issuecomment-1407196104) has been completed which demonstrates this for the `i686-unknown-linux-musl` target). Once this change reaches stable, the `libc` crate will then be able to [update their definitions to support 64-bit time](https://github.com/rust-lang/libc/pull/3068), matching the default musl 1.2 APIs exactly. Fixes #91178