about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-05-09Auto merge of #110027 - nbdd0121:dieting, r=m-ou-sebors-0/+9
Add `#[inline]` to functions that are never called This makes libcore binary size reduce by ~300 bytes. Not much, but these functions are never called so it doesn't make sense for them to get into the binary anyway.
2023-05-08Auto merge of #111296 - Sp00ph:const_gcd, r=nagisa,Mark-Simulacrumbors-37/+6
Always const-evaluate the GCD in `slice::align_to_offsets` Use an inline `const`-block to force the compiler to calculate the GCD at compile time, even in debug mode. This shouldn't affect the behavior of the program at all, but it drastically cuts down on the number of instructions emitted with optimizations disabled. With the current implementation, a single `slice::align_to` instantiation (specifically `<[u8]>::align_to::<u128>()`) generates 676 instructions (on x86-64). Forcing the GCD computation to be const cuts it down to 327 instructions, so just over 50% less. This is obviously not representative of actual runtime gains, but I still see it as a significant win as long as it doesn't degrade compile times. Not having to worry about LLVM const-evaluating the GCD function also allows it to use the textbook recursive euclidean algorithm instead of a much more complicated iterative implementation with multiple `unsafe`-blocks.
2023-05-08Auto merge of #111358 - compiler-errors:rollup-yv27vrp, r=compiler-errorsbors-485/+2066
Rollup of 6 pull requests Successful merges: - #104070 (Prevent aborting guard from aborting the process in a forced unwind) - #109410 (Introduce `AliasKind::Inherent` for inherent associated types) - #111004 (Migrate `mir_transform` to translatable diagnostics) - #111118 (Suggest struct when we get colon in fileds in enum) - #111170 (Diagnostic args are still args if they're documented) - #111354 (Fix miscompilation when calling default methods on `Future`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-08Auto merge of #111007 - JakobDegen:nrvo, r=tmiaskobors-574/+247
Disable nrvo mir opt See #111005 and #110902 . The ICE can definitely be hit on stable, the miscompilation I'm not sure about. The pass makes some pretty sketchy assumptions though, and we should not have it on while that's the case. I'm not going to work on actually fixing this, it's probably not excessively difficult though. r? rust-lang/mir-opt
2023-05-08Rollup merge of #111354 - jonas-schievink:enable-future-combinators, ↵Michael Goulet-14/+11
r=compiler-errors Fix miscompilation when calling default methods on `Future` In https://github.com/rust-lang/rust/issues/111264 I discovered a lingering miscompilation when calling a default method on `Future` (none currently exist). https://github.com/rust-lang/rust/pull/111279 added a debug assertion, which sadly doesn't help much since to my knowledge stage0 is not built with them enabled, and it still doesn't make default methods work like they should. This PR fixes `resolve_instance` to resolve default methods on `Future` correctly, allowing library contributors to add `Future` combinators without running into ICEs or miscompilations. I've tested this as part of https://github.com/rust-lang/rust/pull/111347, but no test is included here (assuming that future methods include their own tests that would cover this sufficiently). r? `@compiler-errors`
2023-05-08Rollup merge of #111170 - compiler-errors:diag-doc, r=petrochenkovMichael Goulet-25/+116
Diagnostic args are still args if they're documented Fixes https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.60.23.5Bderive.28Diagnostic.29.5D.60.20works.20badly.20with.20docs/near/355597997 There's a lot of really strange code incongruencies between `Diagnostic` and `Subdiagnostic` derive. Perhaps those macros need some more overhaul, but I didn't really want to do it today.
2023-05-08Rollup merge of #111118 - chenyukang:yukang-sugg-struct, r=compiler-errorsMichael Goulet-8/+50
Suggest struct when we get colon in fileds in enum A follow-up fix for https://github.com/rust-lang/rust/pull/109128 From: https://github.com/rust-lang/rust/pull/109128#discussion_r1179304932 r? `@estebank`
2023-05-08Rollup merge of #111004 - clubby789:migrate-mir-transform, r=oli-obkMichael Goulet-200/+470
Migrate `mir_transform` to translatable diagnostics cc #100717
2023-05-08Rollup merge of #109410 - fmease:iat-alias-kind-inherent, r=compiler-errorsMichael Goulet-229/+1365
Introduce `AliasKind::Inherent` for inherent associated types Allows us to check (possibly generic) inherent associated types for well-formedness. Type inference now also works properly. Follow-up to #105961. Supersedes #108430. Fixes #106722. Fixes #108957. Fixes #109768. Fixes #109789. Fixes #109790. ~Not to be merged before #108860 (`AliasKind::Weak`).~ CC `@jackh726` r? `@compiler-errors` `@rustbot` label T-types F-inherent_associated_types
2023-05-08Rollup merge of #104070 - nbdd0121:unwind, r=AmanieuMichael Goulet-9/+54
Prevent aborting guard from aborting the process in a forced unwind Fix #101469
2023-05-08Fix miscompilation when adding default method to `Future`Jonas Schievink-14/+11
2023-05-08Auto merge of #110824 - cjgillot:const-prop-index, r=JakobDegen,oli-obkbors-4/+26
ConstProp into PlaceElem::Index. Noticed this while looking at keccak output MIR. This pass aims to replace `ProjectionElem::Index` with `ProjectionElem::ConstantIndex` during ConstProp. r? `@ghost`
2023-05-08Auto merge of #111346 - JohnTitor:rollup-6g5cg9z, r=JohnTitorbors-81/+454
Rollup of 7 pull requests Successful merges: - #105354 (Add deployment-target --print flag for Apple targets) - #110377 (Update max_atomic_width of armv7r and armv7_sony_vita targets to 64.) - #110638 (STD support for PSVita) - #111211 (Don't compute trait super bounds unless they're positive) - #111315 (Remove `identity_future` from stdlib) - #111331 (Mark s390x condition code register as clobbered in inline assembly) - #111332 (Improve inline asm for LoongArch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-08Disable nrvo mir optJakob Degen-574/+247
2023-05-08Rollup merge of #111332 - loongarch-rs:inline-asm, r=AmanieuYuki Okushi-6/+16
Improve inline asm for LoongArch This PR is a sub-part of https://github.com/rust-lang/rust/pull/111235, to improve inline asm for LoongArch. r? `@Amanieu`
2023-05-08Rollup merge of #111331 - taiki-e:s390x-asm-cc, r=AmanieuYuki Okushi-3/+14
Mark s390x condition code register as clobbered in inline assembly Various s390x instructions (arithmetic operations, logical operations, comparisons, etc. see also "Condition Codes" section in [z/Architecture Reference Summary](https://www.ibm.com/support/pages/zarchitecture-reference-summary)) modify condition code register `cc`, but AFAIK there is currently no way to mark it as clobbered in `asm!`. `cc` register definition in LLVM: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L320 This PR also updates asm_experimental_arch docs in the unstable-book to mention s390x registers. cc `@uweigand` r? `@Amanieu`
2023-05-08Rollup merge of #111315 - Swatinem:rm-identitiy-future, r=Mark-SimulacrumYuki Okushi-8/+0
Remove `identity_future` from stdlib This function/lang_item was introduced in #104321 as a temporary workaround of future lowering. The usage and need for it went away in #104833. After a bootstrap update, the function itself can be removed from `std`.
2023-05-08Rollup merge of #111211 - compiler-errors:negative-bounds-super, r=TaKO8KiYuki Okushi-5/+25
Don't compute trait super bounds unless they're positive Fixes #111207 The comment is modified to explain the rationale for why we even have this recursive call to supertraits in the first place, which doesn't apply to negative bounds since they don't elaborate at all.
2023-05-08Rollup merge of #110638 - nikarh:vita, r=Mark-SimulacrumYuki Okushi-40/+321
STD support for PSVita This PR adds std support for `armv7-sony-vita-newlibeabihf` target. The work here is fairly similar to #95897, just for a different target platform. This depends on the following pull requests: rust-lang/backtrace-rs#523 rust-lang/libc#3209
2023-05-08Rollup merge of #110377 - chrisnc:armv7-atomic-64, r=cjgillotYuki Okushi-5/+5
Update max_atomic_width of armv7r and armv7_sony_vita targets to 64. All armv7a and armv7r implementations support `ldrexd`/`strexd`, only armv7m does not.
2023-05-08Rollup merge of #105354 - BlackHoleFox:apple-deployment-printer, r=oli-obkYuki Okushi-14/+73
Add deployment-target --print flag for Apple targets This is very useful for crates that need to know what the Apple OS deployment target is for their build scripts or inside of a build environment. Right now, the defaults just get copy/pasted around the ecosystem since they've been stable for so long. But with #104385 in progress, that won't be true anymore and everything will need to move. Ideally whenever it happens again, this could be less painful as everything can ask the compiler what its default is instead. To show examples of the copy/paste proliferation, here's some crates and/or apps that do: - [cc](https://github.com/rust-lang/cc-rs/pull/708/files), Soon - [mac-notification-sys](https://github.com/h4llow3En/mac-notification-sys/pull/46/files#diff-d0d98998092552a1d3259338c2c71e118a5b8343dd4703c0c7f552ada7f9cb42R10-R12) - [PyO3](https://github.com/PyO3/maturin/blob/ccb02d1aa1cc41e82a3572a3c8b35cace15f3e78/src/target.rs#L755-L758) - [Anki](https://github.com/ankitects/anki/blob/613b5c1034cc9943f3f68d818ae22b2e0acec877/build/runner/src/bundle/artifacts.rs#L49-L54) - [jsc-rs](https://github.com/Brooooooklyn/jsc-rs/blob/37767267568fb2de62fc441473e7d158dd980520/xtask/src/build.rs#L402-L405) ... and probably more that a simple GitHub codesearch didn't see
2023-05-08Auto merge of #111342 - Dylan-DPC:rollup-b5p6wzy, r=Dylan-DPCbors-85/+312
Rollup of 7 pull requests Successful merges: - #110297 (Make `(try_)subst_and_normalize_erasing_regions` take `EarlyBinder`) - #110827 (Fix lifetime suggestion for type aliases with objects in them) - #111022 (Use smaller ints for bitflags) - #111056 (Fix some suggestions where a `Box<T>` is expected.) - #111262 (Further normalize msvc-non-utf8-ouput) - #111265 (Make generics_of has_self on RPITITs delegate to the opaque) - #111323 (Give a more helpful error when running the rustc shim directly) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-08make it more accurate by parsing tyyukang-9/+19
2023-05-08suggest struct when we get colon in fileds in enumyukang-5/+37
2023-05-08Mark s390x condition code register as clobbered in inline assemblyTaiki Endo-3/+14
2023-05-08Rollup merge of #111323 - jyn514:shim-error, r=Mark-SimulacrumDylan DPC-4/+14
Give a more helpful error when running the rustc shim directly cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Building.20.60coretests.60.20by.20hand
2023-05-08Rollup merge of #111265 - spastorino:has_self-opaque_ty, r=compiler-errorsDylan DPC-1/+1
Make generics_of has_self on RPITITs delegate to the opaque r? `@compiler-errors` I couldn't come up with a test case and none of the ones in the `tests` folder is impacted by this change, but I still think is the right thing to do. Michael, let me know if you have ideas on how to add a test that's affected by this change.
2023-05-08Rollup merge of #111262 - ChrisDenton:normalize-msvc-output, r=cjgillotDylan DPC-10/+3
Further normalize msvc-non-utf8-ouput Fixes #111256 by normalizing this tests down to the essential part so that it only tests for the Unicode output we expect. Also uses a file name that should never occur outside of this test.
2023-05-08Rollup merge of #111056 - JohnBobbo96:fix_box_suggestions, r=compiler-errorsDylan DPC-31/+174
Fix some suggestions where a `Box<T>` is expected. This fixes #111011, and also adds a suggestion for boxing a unit type when a `Box<T>` was expected and an empty block was found.
2023-05-08Rollup merge of #111022 - Nilstrieb:smaller-bitflags, r=compiler-errorsDylan DPC-4/+4
Use smaller ints for bitflags Free shrinking!
2023-05-08Rollup merge of #110827 - compiler-errors:issue-110761-followup, r=cjgillotDylan DPC-6/+72
Fix lifetime suggestion for type aliases with objects in them Fixes an issue identified in https://github.com/rust-lang/rust/issues/110761#issuecomment-1520678479 This suggestion, like many other borrowck suggestions, are very fragile and there are other ways to trigger strange behavior even after this PR, so this is just a small improvement and not a total rework :skull:
2023-05-08Rollup merge of #110297 - kylematsuda:earlybinder_tcx_subst, r=BoxyUwUDylan DPC-29/+44
Make `(try_)subst_and_normalize_erasing_regions` take `EarlyBinder` Changes `subst_and_normalize_erasing_regions` and `try_subst_and_normalize_erasing_regions` to take `EarlyBinder<T>` instead of `T`. (related to #105779) This was suggested by `@BoxyUwU` in https://github.com/rust-lang/rust/pull/107753#discussion_r1105828139. After changing `type_of` to return `EarlyBinder`, there were several places where the binder was immediately skipped to call `tcx.subst_and_normalize_erasing_regions`, only for the binder to be reconstructed inside of that method. r? `@BoxyUwU`
2023-05-08Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, ↵bors-101/+125
r=Mark-Simulacrum enable `rust_2018_idioms` lint group for doctests With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests. Resolves #106086 Resolves #99144 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-08Make spans a bit betterMichael Goulet-46/+48
2023-05-07Fix suggestion for boxing an async closure body, andJohn Bobbo-31/+174
also add a suggestion for boxing empty blocks.
2023-05-08Diagnostic args are still args if they're documentedMichael Goulet-8/+97
2023-05-08Simplify match statement since variable arch that is predictableWANG Rui-5/+4
2023-05-08Mark LoongArch float-point condition flags as clobbered in inline assemblyWANG Rui-1/+12
2023-05-08Auto merge of #111309 - saethlin:InstSimplify, r=scottmcmbors-100/+100
Rename InstCombine to InstSimplify ``` ╭ ➜ ben@archlinux:~/rust ╰ ➤ rg -i instcombine src/doc/rustc-dev-guide/src/mir/optimizations.md 134:may have been misapplied. Examples of this are `InstCombine` and `ConstantPropagation`. src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/llvm-config.sh 38: instcombine instrumentation interpreter ipo irreader lanai \ tests/codegen/slice_as_from_ptr_range.rs 4:// min-llvm-version: 15.0 (because this is a relatively new instcombine) ``` r? `@scottmcm`
2023-05-07Auto merge of #111306 - Urgau:hashbrown-std-0.13, r=Amanieubors-5/+5
Update hashbrown from 0.12.3 to 0.13.1 for std This PR updates hashbrown from 0.12.3 to 0.13.1 for std. r? `@Amanieu`
2023-05-07Auto merge of #111224 - jyn514:default-tidy, r=pietroalbinibors-10/+2
Remove `tidy` key in PR CI This avoids confusing error messages when adding an `auto` job to CI (as recommended in the dev-guide: https://rustc-dev-guide.rust-lang.org/tests/ci.html#using-ci-to-test). cc https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Do.20.60needs-profiler-support.60.20tests.20not.20run.20in.20CI.3F/near/355302998 r? `@ghost`
2023-05-07Use smaller ints for bitflagsNilstrieb-4/+4
2023-05-07Give a more helpful error when running the rustc shim directlyjyn-4/+14
cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Building.20.60coretests.60.20by.20hand
2023-05-07PS Vita std supportNikolay Arhipov-40/+321
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-07Add `#[inline]` to functions that are never calledGary Guo-0/+9
2023-05-07Fix codegen testGary Guo-2/+2
2023-05-07Add todo for filter landing padGary Guo-0/+1
2023-05-07Fix num reserved clauses for landing padGary Guo-2/+2
2023-05-07Add test for unwinding past terminating POFGary Guo-0/+26