about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-02-17Don't delay ReError bug during lexical region resolveMichael Goulet-1/+38
2023-02-17Auto merge of #108159 - matthiaskrgr:rollup-5k2j7cx, r=matthiaskrgrbors-42/+167
Rollup of 6 pull requests Successful merges: - #107592 (Default `repr(C)` enums to `c_int` size) - #107956 (Copy `bin/*` and `lib/*.dylib` files to `stage0-sysroot`) - #108126 (fix a line, and do a consistency fix) - #108144 (Add compiler-errors to a few more triagebot groups) - #108149 (typo) - #108154 (`BasicBlock::new(0)` -> `START_BLOCK` [no functional changes]) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-17Rollup merge of #108154 - scottmcm:start-block-cleanup, r=compiler-errorsMatthias Krüger-12/+12
`BasicBlock::new(0)` -> `START_BLOCK` [no functional changes]
2023-02-17Rollup merge of #108149 - tshepang:typo, r=Dylan-DPCMatthias Krüger-1/+1
typo
2023-02-17Rollup merge of #108144 - compiler-errors:triagebot-more, r=Mark-SimulacrumMatthias Krüger-1/+3
Add compiler-errors to a few more triagebot groups Self-explanatory
2023-02-17Rollup merge of #108126 - tshepang:nits, r=lcnrMatthias Krüger-3/+4
fix a line, and do a consistency fix
2023-02-17Rollup merge of #107956 - KittyBorgX:master, r=ozkanonurMatthias Krüger-0/+66
Copy `bin/*` and `lib/*.dylib` files to `stage0-sysroot` Fixes #101691
2023-02-17Rollup merge of #107592 - workingjubilee:use-16-bit-enum-on-16-bit-targets, ↵Matthias Krüger-25/+81
r=WaffleLapkin Default `repr(C)` enums to `c_int` size This is what ISO C strongly implies this is correct, and many processor-specific ABIs imply or mandate this size, so "everyone" (LLVM, gcc...) defaults to emitting enums this way. However, this is by no means guaranteed by ISO C, and the bare-metal Arm targets show it can be overridden, which rustc supports via `c-enum-min-bits` in a target.json. The override is a flag named `-fshort-enums` in clang and gcc, but introducing a CLI flag is probably unnecessary for rustc. This flag can be used by non-Arm microcontroller targets, like AVR and MSP430, but it is not enabled for them by default. Rust programmers who know the size of a target's enums can use explicit reprs, which also lets them match C23 code. This change is most relevant to 16-bit targets: AVR and MSP430. Most of rustc's targets use 32-bit ints, but ILP64 does exist. Regardless, rustc should now correctly handle enums for both very small and very large targets. Thanks to William for confirming MSP430 behavior, and to Waffle for better style and no-core `size_of` asserts. Fixes rust-lang/rust#107361 Fixes rust-lang/rust#77806
2023-02-17Auto merge of #107965 - BoxyUwU:add_const_arg_has_type_predicate, ↵bors-15/+183
r=compiler-errors Add `Clause::ConstArgHasType` Currently the way that we check that a const arg has the correct type for the const param it is an argument for is by setting the expected type of `typeck` on the anon const of the argument to be the const param's type. In the future for a potential `min_generic_const_exprs` we will allow providing const arguments that do not have an associated anon const that can be typeck'd which will require us to actually check that the const argument has the correct type. While it would potentially be possible to just call `eq` when creating substs this would not work if we support generics of the form `const N: T, T` (the const parameters type referencing generics declared after itself). Additionally having `ConstArgHasType` will allow us to potentially make progress on removing the `ty` field of `Const` which may be desirable. Once progress has been made on this, `ConstArgHasType` will also be helpful in ensuring we do not make mistakes in trait/impl checking by declaring functions with the wrong const parameter types as the checks that the param env is compatible would catch it. (We have messed this up in the past, and with generic const parameter types these checks will get more complex) There is a [document](https://hackmd.io/wuCS6CJBQ9-fWbwaW7nQRw?view) about the types of const generics that may provide some general information on this subject --- This PR shouldn't have any impact on whether code compiles or not on stable, it primarily exists to make progress on unstable const generics features that are desirable.
2023-02-17add predicate evaluation logicBoxy-18/+124
2023-02-17Add `Clause::ConstArgHasType` variantBoxy-6/+68
2023-02-17Auto merge of #108058 - Zoxc:query-ctxtx-byval, r=cjgillotbors-26/+26
Pass `DepContext` and `QueryContext` by value when practical This removes some indirections for a minor performance improvement. <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8294s</td><td align="right">1.8255s</td><td align="right"> -0.21%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2667s</td><td align="right">0.2669s</td><td align="right"> 0.07%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0080s</td><td align="right">1.0063s</td><td align="right"> -0.17%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6335s</td><td align="right">1.6295s</td><td align="right"> -0.24%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3633s</td><td align="right">6.3344s</td><td align="right"> -0.45%</td></tr><tr><td>Total</td><td align="right">11.1009s</td><td align="right">11.0627s</td><td align="right"> -0.34%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9980s</td><td align="right"> -0.20%</td></tr></table>
2023-02-16`BasicBlock::new(0)` -> `START_BLOCK` [no functional changes]Scott McMurray-12/+12
2023-02-17Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwUbors-334/+443
Switch to `EarlyBinder` for `type_of` query Part of the work to finish #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`. r? `@lcnr`
2023-02-17typoTshepang Mbambo-1/+1
2023-02-17Copy `bin/*` and `lib/*.dylib` files to `stage0-sysroot`KittyBorgX-0/+66
2023-02-17Auto merge of #108145 - matthiaskrgr:rollup-bgadak1, r=matthiaskrgrbors-370/+822
Rollup of 8 pull requests Successful merges: - #104068 (rustdoc: Add PartialOrd trait to doc comment explanation) - #107489 (Implement partial support for non-lifetime binders) - #107905 (Pass arguments to `x` subcommands with `--`) - #108009 (Move some tests) - #108086 (wasm: Register the `relaxed-simd` target feature) - #108104 (don't into self) - #108133 (Small cleanups around `EarlyBinder`) - #108136 (Do not ICE on unmet trait alias impl bounds) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-16fix new usage of type_ofKyle Matsuda-2/+2
2023-02-16changes from reviewKyle Matsuda-12/+53
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-380/+325
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-262/+385
2023-02-17Rollup merge of #108136 - eggyal:unmet_trait_alias_bound_on_generic_impl, ↵Matthias Krüger-13/+59
r=compiler-errors Do not ICE on unmet trait alias impl bounds Fixes #108132 I've also added some documentation to the `impl_def_id` field of `DerivedObligationCause` to try and minimise the risk of such errors in future. r? `@compiler-errors`
2023-02-17Rollup merge of #108133 - kylematsuda:earlybinder-cleanups, r=compiler-errorsMatthias Krüger-5/+8
Small cleanups around `EarlyBinder` Cleaning up a few things that were brought up by `@lcnr` in reviewing #106696: - [make `issue33140_self_ty` query return `Option<EarlyBinder<Ty>>`](https://github.com/rust-lang/rust/pull/106696#discussion_r1067821423) - [small style improvement](https://github.com/rust-lang/rust/pull/106696#discussion_r1067816772)
2023-02-17Rollup merge of #108104 - matthiaskrgr:into, r=compiler-errorsMatthias Krüger-5/+4
don't into self don't into()-convert types to themselves
2023-02-17Rollup merge of #108086 - alexcrichton:wasm-relaxed-simd-feature, r=eholkMatthias Krüger-0/+1
wasm: Register the `relaxed-simd` target feature This WebAssembly proposal is likely to reach stage 4 soon so this starts the support in Rust for the proposal by adding a target feature that can be enabled via attributes for the stdarch project to bind the intrinsics.
2023-02-17Rollup merge of #108009 - c410-f3r:moar-tests, r=petrochenkovMatthias Krüger-1/+1
Move some tests r? `@petrochenkov`
2023-02-17Rollup merge of #107905 - clubby789:x-free-args, r=albertlarsan68Matthias Krüger-1/+20
Pass arguments to `x` subcommands with `--` Fixes #107375 Any arguments passed to `x` following `--` are removed and not parsed, instead passed down to subcommands (just the ones listed in the issue, not sure if more are needed). This does not remove the existing `--args` and `--test-args` behaviour, just extends it. It's also not documented in the help, not sure of the best way to format it. r? `@jyn514`
2023-02-17Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillotMatthias Krüger-343/+709
Implement partial support for non-lifetime binders This implements support for non-lifetime binders. It's pretty useless currently, but I wanted to put this up so the implementation can be discussed. Specifically, this piggybacks off of the late-bound lifetime collection code in `rustc_hir_typeck::collect::lifetimes`. This seems like a necessary step given the fact we don't resolve late-bound regions until this point, and binders are sometimes merged. Q: I'm not sure if I should go along this route, or try to modify the earlier nameres code to compute the right bound var indices for type and const binders eagerly... If so, I'll need to rename all these queries to something more appropriate (I've done this for `resolve_lifetime::Region` -> `resolve_lifetime::ResolvedArg`) cc rust-lang/types-team#81 r? `@ghost`
2023-02-17Rollup merge of #104068 - yancyribbens:partial-cmp-doc-update, r=scottmcmMatthias Krüger-2/+20
rustdoc: Add PartialOrd trait to doc comment explanation The doc comments for [partial_cmp](https://github.com/rust-lang/rust/blob/master/library/core/src/iter/traits/iterator.rs#L3478) is the exact same as the doc comment for [cmp](https://github.com/rust-lang/rust/blob/master/library/core/src/iter/traits/iterator.rs#L3413). This PR adds to the description `partial_cmp` to disambiguate the description from `cmp.`
2023-02-16Default repr(C) enums to c_int sizeJubilee Young-25/+81
This is what ISO C strongly implies this is correct, and many processor-specific ABIs imply or mandate this size, so "everyone" (LLVM, gcc...) defaults to emitting enums this way. However, this is by no means guaranteed by ISO C, and the bare-metal Arm targets show it can be overridden, which rustc supports via `c-enum-min-bits` in a target.json. The override is a flag named `-fshort-enums` in clang and gcc, but introducing a CLI flag is probably unnecessary for rustc. This flag can be used by non-Arm microcontroller targets, like AVR and MSP430, but it is not enabled for them by default. Rust programmers who know the size of a target's enums can use explicit reprs, which also lets them match C23 code. This change is most relevant to 16-bit targets: AVR and MSP430. Most of rustc's targets use 32-bit ints, but ILP64 does exist. Regardless, rustc should now correctly handle enums for both very small and very large targets. Thanks to William for confirming MSP430 behavior, and to Waffle for better style and no-core size_of asserts. Co-authored-by: William D. Jones <thor0505@comcast.net> Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2023-02-16Add compiler-errors to a few more triagebot groupsMichael Goulet-1/+3
2023-02-16Clarify `DerivedObligationCause` may hold alias idAlan Egerton-12/+16
2023-02-16Do not ICE on unmet trait alias impl boundsAlan Egerton-1/+43
2023-02-16Auto merge of #107833 - Zoxc:arena-query-clean, r=cjgillotbors-239/+147
Factor query arena allocation out from query caches This moves the logic for arena allocation out from the query caches into conditional code in the query system. The specialized arena caches are removed. A new `QuerySystem` type is added in `rustc_middle` which contains the arenas, providers and query caches. Performance seems to be slightly regressed: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8053s</td><td align="right">1.8109s</td><td align="right"> 0.31%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2600s</td><td align="right">0.2597s</td><td align="right"> -0.10%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9973s</td><td align="right">1.0006s</td><td align="right"> 0.34%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6048s</td><td align="right">1.6051s</td><td align="right"> 0.02%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.2992s</td><td align="right">6.3159s</td><td align="right"> 0.26%</td></tr><tr><td>Total</td><td align="right">10.9664s</td><td align="right">10.9922s</td><td align="right"> 0.23%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">1.0017s</td><td align="right"> 0.17%</td></tr></table> Incremental performance is a bit worse: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:initial</td><td align="right">2.2103s</td><td align="right">2.2247s</td><td align="right"> 0.65%</td></tr><tr><td>🟣 <b>hyper</b>:check:initial</td><td align="right">0.3335s</td><td align="right">0.3349s</td><td align="right"> 0.41%</td></tr><tr><td>🟣 <b>regex</b>:check:initial</td><td align="right">1.2597s</td><td align="right">1.2650s</td><td align="right"> 0.42%</td></tr><tr><td>🟣 <b>syn</b>:check:initial</td><td align="right">2.0521s</td><td align="right">2.0613s</td><td align="right"> 0.45%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:initial</td><td align="right">7.8275s</td><td align="right">7.8583s</td><td align="right"> 0.39%</td></tr><tr><td>Total</td><td align="right">13.6832s</td><td align="right">13.7442s</td><td align="right"> 0.45%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">1.0046s</td><td align="right"> 0.46%</td></tr></table> It does seem like LLVM optimizers struggle a bit with the current state of the query system. Based on top of https://github.com/rust-lang/rust/pull/107782 and https://github.com/rust-lang/rust/pull/107802. r? `@cjgillot`
2023-02-16Auto merge of #108127 - matthiaskrgr:rollup-kpzfc6j, r=matthiaskrgrbors-558/+677
Rollup of 7 pull requests Successful merges: - #106347 (More accurate spans for arg removal suggestion) - #108057 (Prevent some attributes from being merged with others on reexports) - #108090 (`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`) - #108092 (note issue for feature(packed_bundled_libs)) - #108099 (use chars instead of strings where applicable) - #108115 (Do not ICE on unmet trait alias bounds) - #108125 (Add new people to the compiletest review rotation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-16rustdoc: Update the description to include PartialOrd elementsyancy-2/+20
2023-02-16fix ugly skip_binderKyle Matsuda-1/+2
2023-02-16make issue33140_self_ty return Option<EarlyBinder<Ty>>Kyle Matsuda-4/+6
2023-02-16don't into selfMatthias Krüger-5/+4
don't into()-convert types to themselves
2023-02-16fix some lines, and do a consistency fixTshepang Mbambo-3/+4
2023-02-16Rollup merge of #108125 - albertlarsan68:moar-compiletest-reviewers, ↵Matthias Krüger-1/+1
r=wesleywiser Add new people to the compiletest review rotation `@oli-obk` and `@wesleywiser` volunteered to be part of the review rotation of compiletest in https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202023-02-16/near/328274017
2023-02-16Rollup merge of #108115 - eggyal:unmet_trait_alias_bound, r=compiler-errorsMatthias Krüger-6/+41
Do not ICE on unmet trait alias bounds Rework of #108093 following feedback on that PR. Fixes #108072 r? `@compiler-errors`
2023-02-16Rollup merge of #108099 - matthiaskrgr:str_to_char, r=GuillaumeGomezMatthias Krüger-4/+4
use chars instead of strings where applicable
2023-02-16Rollup merge of #108092 - BelovDV:fix-feature-description-pbl, r=petrochenkovMatthias Krüger-2/+2
note issue for feature(packed_bundled_libs) Add to feature (introduced in #105601) gate description number of issue created for it. r? `@petrochenkov`
2023-02-16Rollup merge of #108090 - WaffleLapkin:if_not_now_then_when…, r=oli-obkMatthias Krüger-286/+165
`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)` Resurrection of #108079
2023-02-16Rollup merge of #108057 - GuillaumeGomez:fix-reexport-attr-merge, r=notriddleMatthias Krüger-27/+178
Prevent some attributes from being merged with others on reexports Final fix for https://github.com/rust-lang/rust/issues/59368. As discussed on zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Filtering.20sub.20attributes.20in.20ast.3A.3AAttribute), we need to clone the `Attribute` to be able to filter some parts of it. Then we need to go through the attributes to able to only keep what we want (everything except a few attributes in short). As for the second commit, when I wrote the test, I realized that the code to traverse all reexports one by one to collect all their attributes was not completely working so I fixed the few issues remaining. r? `@notriddle`
2023-02-16Rollup merge of #106347 - estebank:removal-suggestion, r=TaKO8KiMatthias Krüger-232/+286
More accurate spans for arg removal suggestion Partially address #106304.
2023-02-16Add new people to the compiletest review rotationAlbert Larsan-1/+1
2023-02-16Auto merge of #108020 - nnethercote:opt-mk_region, r=compiler-errorsbors-186/+254
Optimize `mk_region` PR #107869 avoiding some interning under `mk_ty` by special-casing `Ty` variants with simple (integer) bodies. This PR does something similar for regions. r? `@compiler-errors`
2023-02-16Replace some `then`s with some `then_some`sMaybe Waffle-26/+27