about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-10-06Miri: Add `CreateWaitableTimerEx` stubChris Denton-0/+12
This function will always fail, allowing std's `Sleep` fallback path to be taken instead.
2023-10-06Windows: Support sub-millisecond sleepChris Denton-1/+88
Use `CreateWaitableTimerExW` with `CREATE_WAITABLE_TIMER_HIGH_RESOLUTION`. Does not work before Windows 10, version 1803 so in that case we fallback to using `Sleep`.
2023-10-05Auto merge of #116417 - ouz-a:trait_type_detective, r=compiler-errorsbors-23/+23
Remove is global hack In attempt to fix https://github.com/rust-lang/rust/issues/114057 we found several issues with how compiler computes layouts, this change removes `is_global` from `and` to stop impl from being shadowed. In depth conversation can be read here https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Getting.20different.20types.20from.20almost.20same.20inputs This is a fix candidate opened for performance run. r? `@lcnr`
2023-10-05remove is global hackOğuz Ağcayazı-23/+23
2023-10-05Auto merge of #116455 - matthiaskrgr:rollup-p226a5u, r=matthiaskrgrbors-356/+762
Rollup of 5 pull requests Successful merges: - #116220 (stabilize `Option::as_`(`mut_`)`slice`) - #116288 (Add Span to various smir types) - #116415 (Move subtyper below reveal_all and change reveal_all) - #116428 (Add a note to duplicate diagnostics) - #116452 (Do not assert that hidden types don't have erased regions.) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-05Rollup merge of #116452 - cjgillot:noassert-erased, r=oli-obkMatthias Krüger-3/+0
Do not assert that hidden types don't have erased regions. cc https://github.com/rust-lang/rust/issues/116306 `args` can have erased regions. In the linked issue, this is reached by computing whether a large type is `Freeze` to compute its ABI. I do not have a minimized test to include.
2023-10-05Rollup merge of #116428 - Alexendoo:note-duplicate-diagnostics, ↵Matthias Krüger-203/+460
r=compiler-errors,estebank Add a note to duplicate diagnostics Helps explain why there may be a difference between manual testing and the test suite output and highlights them as something to potentially look into For existing duplicate diagnostics I just blessed them other than a few files that had other `NOTE` annotations in
2023-10-05Rollup merge of #116415 - ouz-a:move_subtyper, r=oli-obkMatthias Krüger-55/+143
Move subtyper below reveal_all and change reveal_all In previous attempt https://github.com/rust-lang/rust/pull/116378 we tried to handle `Opaque` in few different places, but this isn't necessary, after moving subtyper below reveal_all and calling `super_place` on reveal_all, issues cease to exist. r? ``@oli-obk`` Fixes https://github.com/rust-lang/rust/issues/116332 Fixes https://github.com/rust-lang/rust/issues/116265 Fixes https://github.com/rust-lang/rust/issues/116383 Fixes https://github.com/rust-lang/rust/issues/116333
2023-10-05Rollup merge of #116288 - ouz-a:smir_spans, r=spastorinoMatthias Krüger-82/+157
Add Span to various smir types Had to make few extra changes to few structs to attach spans to them. r? ``@oli-obk``
2023-10-05Rollup merge of #116220 - llogiq:stabilize-option-as-slice, r=BurntSushiMatthias Krüger-13/+2
stabilize `Option::as_`(`mut_`)`slice` This is the stabilization to #108545. Thanks to everyone who helped getting this into Rust proper.
2023-10-05move subtyper change reveal_allouz-a-55/+143
2023-10-05Do not assert that hidden types don't have erased regions.Camille GILLOT-3/+0
2023-10-05Auto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubileebors-17/+50
docs: Correct terminology in std::cmp This PR is the result of some discussions on URLO: * [Traits in `std::cmp` and mathematical terminology](https://users.rust-lang.org/t/traits-in-std-cmp-and-mathematical-terminology/69887) * [Are poker hands `Ord` or `PartialOrd`?](https://users.rust-lang.org/t/are-poker-hands-ord-or-partialord/82644) Arguably, the documentation currently isn't very precise regarding mathematical terminology. This can lead to misunderstandings of what `PartialEq`, `Eq`, `PartialOrd`, and `Ord` actually do. While I believe this PR doesn't give any new API guarantees, it expliclitly mentions that `PartialEq::eq(a, b)` may return `true` for two distinct values `a` and `b` (i.e. where `a` and `b` are not equal in the mathematical sense). This leads to the consequence that `Ord` may describe a weak ordering instead of a total ordering. In either case, I believe this PR should be thoroughly reviewed, ideally by someone with mathematical background to make sure the terminology is correct now, and also to ensure that no unwanted new API guarantees are made. In particular, the following problems are addressed: * Some clarifications regarding used (mathematical) terminology: * Avoid using the terms "total equality" and "partial equality" in favor of "equivalence relation" and "partial equivalence relation", which are well-defined and unambiguous. * Clarify that `Ordering` is an ordering between two values (and not an order in the mathematical sense). * Avoid saying that `PartialEq` and `Eq` are "equality comparisons" because the terminology "equality comparison" could be misleading: it's possible to implement `PartialEq` and `Eq` for other (partial) equivalence relations, in particular for relations where `a == b` for some `a` and `b` even when `a` and `b` are not the same value. * Added a section "Strict and non-strict partial orders" to document that the `<=` and `>=` operators do not correspond to non-strict partial orders. * Corrected section "Corollaries" in documenation of `Ord` in regard to `<` only describing a strict total order in cases where `==` conforms to mathematical equality. * ~~Added a section "Weak orders" to explain that `Ord` may also describe a weak order or total preorder, depending on how `PartialEq::eq` has been implemented.~~ (Removed, see [comment](https://github.com/rust-lang/rust/pull/103046#issuecomment-1279929676)) * Made documentation easier to understand: * Explicitly state at the beginning of `PartialEq`'s documentation comment that implementing the trait will provide the `==` and `!=` operators. * Added an easier to understand rule when to implement `Eq` in addition to `PartialEq`: "if it’s guaranteed that `PartialEq::eq(a, a)` always returns `true`." * Explicitly mention in documentation of `Eq` that the properties "symmetric" and "transitive" are already required by `PartialEq`.
2023-10-05Auto merge of #114042 - liushuyu:ubuntu/i586-fpmath, r=workingjubileebors-1/+1
core library: Disable fpmath tests for i586 ... This patch disables the floating-point epsilon test for i586 since x87 registers are too imprecise and can't produce the expected results.
2023-10-05docs: Correct terminology in std::cmpJan Behrens-17/+50
Some clarifications regarding used (mathematical) terminology: * Avoid using the terms "total equality" and "partial equality" in favor of "equivalence relation" and "partial equivalence relation", which are well-defined and unambiguous. * Clarify that `Ordering` is an ordering between two values (and not an order in the mathematical sense). * Avoid saying that `PartialEq` and `Eq` are "equality comparisons" because the terminology "equality comparison" could be misleading: it's possible to implement `PartialEq` and `Eq` for other (partial) equivalence relations, in particular for relations where `a == b` for some `a` and `b` even when `a` and `b` are not the same value. * Added a section "Strict and non-strict partial orders" to document that the `<=` and `>=` operators do not correspond to non-strict partial orders. * Corrected section "Corollaries" in documenation of Ord in regard to `<` only describing a strict total order in cases where `==` conforms to mathematical equality. Made documentation easier to understand: * Explicitly state at the beginning of `PartialEq`'s documentation comment that implementing the trait will provide the `==` and `!=` operators. * Added an easier to understand rule when to implement `Eq` in addition to `PartialEq`: "if it’s guaranteed that `PartialEq::eq(a, a)` always returns `true`." * Explicitly mention in documentation of `Eq` that the properties "symmetric" and "transitive" are already required by `PartialEq`.
2023-10-05Auto merge of #104153 - tspiteri:doc-float-constants, r=workingjubileebors-4/+80
doc: expand description for f32 and f64 associated constants This explains the meaning of some of the floating-point associated constants.
2023-10-05Auto merge of #116427 - cjgillot:no-internal, r=oli-obkbors-57/+106
Remove mir::LocalDecl::internal. It does not serve any purpose, as we don't have typeck-based generator witnesses any more.
2023-10-05impl stable for kindsOğuz Ağcayazı-114/+114
2023-10-05add span to statementsouz-a-73/+98
2023-10-05Auto merge of #116443 - workingjubilee:rollup-r9mh13f, r=workingjubileebors-396/+553
Rollup of 5 pull requests Successful merges: - #116223 (Fix misuses of a vs an) - #116296 (More accurately point to where default return type should go) - #116429 (Diagnostics: Be more careful when suggesting struct fields) - #116431 (Tweak wording of E0562) - #116432 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 2)) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-05Rollup merge of #116432 - notriddle:master, r=fmeaseJubilee-8/+68
rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 2) Follow up https://github.com/rust-lang/rust/pull/116214
2023-10-05Rollup merge of #116431 - estebank:issue-80476, r=compiler-errorsJubilee-136/+136
Tweak wording of E0562 Fix #80476.
2023-10-05Rollup merge of #116429 - fmease:clean-up-struct-field-suggs, r=compiler-errorsJubilee-145/+226
Diagnostics: Be more careful when suggesting struct fields Consolidate the various places which filter out struct fields that shouldn't be suggested into a single function. Previously, each of those code paths had slightly different and incomplete metrics for no good reason. Now, there's only a single 'complete' metric (namely `is_field_suggestable`) which also filters out hygienic fields that come from different syntax contexts. Fixes #116334.
2023-10-05Rollup merge of #116296 - compiler-errors:default-return, r=estebankJubilee-89/+105
More accurately point to where default return type should go When getting the "default return type" span, instead of pointing to the low span of the next token, point to the high span of the previous token. This: 1. Makes forming return type suggestions more uniform, since we expect them all in the same place. 2. Arguably makes labels easier to understand, since we're pointing to where the implicit `-> ()` would've gone, rather than the starting brace or the semicolon. r? ```@estebank```
2023-10-05Rollup merge of #116223 - catandcoder:master, r=cjgillotJubilee-18/+18
Fix misuses of a vs an Fixes the misuse of "a" vs "an", according to English grammatical expectations and using https://www.a-or-an.com/
2023-10-05Auto merge of #116273 - compiler-errors:refine2, r=tmandrybors-8/+23
Only trigger `refining_impl_trait` lint on reachable traits Public but unreachable traits don't matter 😸 r? `@tmandry`
2023-10-05Auto merge of #116184 - compiler-errors:afit-lint, r=tmandrybors-60/+308
Add `async_fn_in_trait` lint cc https://github.com/rust-lang/rust/pull/115822#issuecomment-1731168465 Mostly unsure what the messaging should be. Feedback required. r? `@tmandry`
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-203/+460
2023-10-04Auto merge of #116370 - nnethercote:more-arena-stuff, r=cjgillotbors-128/+74
Remove the `TypedArena::alloc_from_iter` specialization. It was added in #78569. It's complicated and doesn't actually help performance. r? `@cjgillot`
2023-10-04Apply suggestions from code reviewTyler Mandry-2/+7
Co-authored-by: Travis Cross <tc@traviscross.com>
2023-10-04Fix spans for comments in rustfmtMichael Goulet-1/+2
2023-10-04Point to closure return instead of output if defaultedMichael Goulet-3/+7
2023-10-04Fix clippyMichael Goulet-18/+14
2023-10-04Point to where missing return type should goMichael Goulet-71/+86
2023-10-04Auto merge of #114417 - ↵bors-34/+69
chinedufn:fix-expect-unused-in-impl-block-rust-issue-114416, r=cjgillot Fix multiple `expect` attribs in impl block Closes #114416
2023-10-04Add URL to test case issuesMichael Howell-1/+21
2023-10-04Rename issue-\d+.rs tests to have meaningful namesMichael Howell-1/+1
2023-10-04Tweak wording of E0562Esteban Küber-136/+136
Fix #80476.
2023-10-04clean up struct field suggestionsLeón Orell Valerian Liehr-145/+226
2023-10-04 Add `crate_name` to test so that it can be renamedMichael Howell-1/+41
2023-10-04Auto merge of #115200 - rcvalle:rust-cfi-fix-115199, r=workingjubileebors-88/+123
Disable CFI for core and std CFI violations Work around https://github.com/rust-lang/rust/issues/115199 by temporarily disabling CFI for core and std CFI violations to allow the user rebuild and use both core and std with CFI enabled using the Cargo build-std feature.
2023-10-04Remove mir::LocalDecl::internal.Camille GILLOT-57/+106
2023-10-04Update documentation for LLVM CFI supportRamon de C Valle-76/+85
Updates documentation for LLVM CFI support with recommended information since the user can now rebuild and use both core and std with CFI enabled using the Cargo build-std feature.
2023-10-04Disable CFI for core and std CFI violationsRamon de C Valle-12/+38
Works around #115199 by temporarily disabling CFI for core and std CFI violations to allow the user rebuild and use both core and std with CFI enabled using the Cargo build-std feature.
2023-10-04Auto merge of #116413 - nnethercote:rm-E0551, r=compiler-errorsbors-21/+14
Remove E0551 Because it's the same as E0539. Fixes #51489. r? `@Nilstrieb`
2023-10-04Auto merge of #116381 - Mark-Simulacrum:drop-wasm32-unknown-emscripten, r=Kobzolbors-69/+0
Remove wasm32-unknown-emscripten tests from CI This builder tested the wasm32-unknown-emscripten target, which is tier 2 (and so not eligible for testing). In the recent beta [promotion](https://github.com/rust-lang/rust/pull/116362#issuecomment-1744960904), we ran into a problem with this target: emscripten doesn't support passing environment variables into the std environment, so we can't enable RUSTC_BOOTSTRAP for libtest in order to pass -Zunstable-options. We worked around this for the beta/stable branches, but given this problem, and its tier 2 status, just dropping the target's tests entirely seems warranted. Downgrading to tier 3 may also be a good idea, but that is a separate conversation not proposed here.
2023-10-04Auto merge of #116360 - compiler-errors:async-span, r=oli-obkbors-64/+68
Point to full `async fn` for future Semi-follow-up to https://github.com/rust-lang/rust/pull/116296#discussion_r1342007575 cc `@asquared31415`
2023-10-04Auto merge of #116353 - Kobzol:new-bors-event, r=Mark-Simulacrumbors-0/+4
Add new bors try branches to CI Workflows for the new bors weren't launching, because its branches weren't whitelisted here. r? `@Mark-Simulacrum`
2023-10-04Remove E0551.Nicholas Nethercote-16/+9
Because it's the same as E0539. Fixes #51489.
2023-10-04Sort `compiler/rustc_attr/Cargo.toml` dependencies.Nicholas Nethercote-5/+5
It's easier to read in sorted order.