Commit Graph

303456 Commits

Author SHA1 Message Date
bors
4c40c89c26 Auto merge of #134505 - jieyouxu:boop-compiler-cc, r=clubby789,jieyouxu
Bump compiler `cc` to 1.2.5

- `cc` 1.2.4 contains a fix to address [rustc uses wrong build tools when compiling from MSVC #133794](https://github.com/rust-lang/rust/issues/133794). See <https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.4>.
- `cc` 1.2.5 contains a fix to also check linking when testing if certain compiler flags are supported, which fixed an issue that was causing previous compiler `cc` bumps to fail. See <https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.5>.

Supersedes #134419.
Fixes #133794.

r? `@clubby789`
2024-12-21 17:58:54 +00:00
Ralf Jung
8f9fede0b8 coroutine_clone: add comments 2024-12-21 17:01:36 +01:00
Chris Denton
1e3ecd5e4d Windows: Use WriteFile to write to a UTF-8 console 2024-12-21 15:59:56 +00:00
bors
387b245664 Auto merge of #134614 - Kobzol:revert-dist-arm, r=onur-ozkan
Revert "Auto merge of #133902 - Kobzol:ci-dist-arm-runner, r=MarcoIeni"

Reverts https://github.com/rust-lang/rust/pull/133902

Context: https://github.com/rust-lang/rust/issues/134612#issuecomment-2558111888
2024-12-21 15:19:22 +00:00
Chris Denton
fdb43ef0c4 Avoid short writes in LineWriter
Also update the tests to avoid testing implementation details.
2024-12-21 15:13:22 +00:00
Jakub Beránek
69a6c9c365 Revert "Auto merge of #133902 - Kobzol:ci-dist-arm-runner, r=MarcoIeni"
This reverts commit b597d2a099, reversing
changes made to ff7906bfe1.
2024-12-21 13:51:17 +01:00
bors
9bd5f3387d Auto merge of #134501 - lcnr:member-constraints-yeet, r=oli-obk
handle member constraints directly in the mir type checker

cleaner, faster, easier to change going forward :> fixes #109654

r? `@oli-obk` `@compiler-errors`
2024-12-21 12:37:40 +00:00
sayantn
96154fbde8 Fix _mm*_mask_cmp_ep*_mask bug with IMM3=7 2024-12-21 12:02:41 +00:00
daxpedda
9ea6010f16 Fix Wasm f*_sqrt() doc 2024-12-21 12:02:28 +00:00
Tobias Bucher
237dea336b Align {i686,x86_64}-win7-windows-msvc to their parent targets
There were some changes to `{i686,x86_64}-pc-windows-msvc`, include them
in the backward compatibility targets as well.
2024-12-21 12:06:35 +01:00
sayantn
9fa56b9563 Disable armv7-unknown-linux-gnueabihf dox.sh CI temporarily 2024-12-21 10:12:32 +00:00
sayantn
a635da83d7 Make assert_instr stricter 2024-12-21 10:12:32 +00:00
sayantn
846c283131 Refactor dox.sh, add loongarch64 and nvptx64 2024-12-21 10:12:32 +00:00
sayantn
8229871c87 Upgrade Intel SDE 2024-12-21 10:12:32 +00:00
sayantn
c91778f8c3 Add PowerPC (32-bit) to CI 2024-12-21 10:12:32 +00:00
sayantn
94a889d77d Remove gba.json as it was unused 2024-12-21 10:12:32 +00:00
sayantn
fcf05b8776 Re-enable the disabled PPC tests, Upgrade CPU 2024-12-21 10:12:32 +00:00
Sayantan Chakraborty
f00f948ee6 Enable x86_64-pc-windows-msvc-dev 2024-12-21 10:12:32 +00:00
Tobias Bucher
ea75d051c6 Fix compiler team name in target tier docs 2024-12-21 11:10:03 +01:00
Tobias Bucher
f35f8414aa Format build.toml consistently in platform support docs 2024-12-21 11:10:03 +01:00
Tim (Theemathas) Chirananthavat
e6efbb210b Document CTFE behavior of methods that call is_null 2024-12-21 16:32:47 +07:00
bors
54dcff104b Auto merge of #134604 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-12-21 09:21:42 +00:00
Tobias Bucher
84f8faf17c on pair → on par 2024-12-21 10:18:39 +01:00
Tim (Theemathas) Chirananthavat
93889172bc Correctly document is_null CTFE behavior.
The "panic in const if CTFE doesn't know the answer" behavior was discussed to be the desired behavior in #74939, and is currently how the function actually behaves.

I intentionally wrote this documentation to allow for the possibility that a panic might not occur even if the pointer is out of bounds, because of #133700 and other potential changes in the future.
2024-12-21 15:36:16 +07:00
Ralf Jung
526d29865c ptr::copy: fix docs for the overlapping case 2024-12-21 08:34:55 +01:00
Lukas Wirth
0c409e5a69 Merge pull request #18727 from roife/fix-issue-18704
fix: remove `always!` check for file_id in `runnables`
2024-12-21 07:10:08 +00:00
Ralf Jung
58ad698df7 Merge pull request #4103 from RalfJung/remove-unused
remove an unused helper method
2024-12-21 06:46:33 +00:00
bors
6076beecb8 Auto merge of #134605 - jhpratt:rollup-quiss71, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - #133087 (Detect missing `.` in method chain in `let` bindings and statements)
 - #134575 (Handle `DropKind::ForLint` in coroutines correctly)
 - #134576 (Improve prose around basic examples of Iter and IterMut)
 - #134577 (Improve prose around `as_slice` example of Iter)
 - #134579 (Improve prose around into_slice example of IterMut)
 - #134593 (Less unwrap() in documentation)
 - #134600 (Fix parenthesization of chained comparisons by pretty-printer)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-21 06:41:22 +00:00
Ralf Jung
9c87ec8242 remove an unused helper method 2024-12-21 07:21:58 +01:00
Jacob Pratt
ea8bc3b4be Rollup merge of #134600 - dtolnay:chainedcomparison, r=oli-obk
Fix parenthesization of chained comparisons by pretty-printer

Example:

```rust
macro_rules! repro {
    () => {
        1 < 2
    };
}

fn main() {
    let _ = repro!() == false;
}
```

Previously `-Zunpretty=expanded` would pretty-print this syntactically invalid output: `fn main() { let _ = 1 < 2 == false; }`

```console
error: comparison operators cannot be chained
 --> <anon>:8:23
  |
8 | fn main() { let _ = 1 < 2 == false; }
  |                       ^   ^^
  |
help: parenthesize the comparison
  |
8 | fn main() { let _ = (1 < 2) == false; }
  |                     +     +
```

With the fix, it will print `fn main() { let _ = (1 < 2) == false; }`.

Making `-Zunpretty=expanded` consistently produce syntactically valid Rust output is important because that is what makes it possible for `cargo expand` to format and perform filtering on the expanded code.

## Review notes

According to `rg '\.fixity\(\)' compiler/` the `fixity` function is called only 3 places:

- 13170cd787/compiler/rustc_ast_pretty/src/pprust/state/expr.rs (L283-L287)

- 13170cd787/compiler/rustc_hir_pretty/src/lib.rs (L1295-L1299)

- 13170cd787/compiler/rustc_parse/src/parser/expr.rs (L282-L289)

The 2 pretty printers definitely want to treat comparisons using `Fixity::None`. That's the whole bug being fixed. Meanwhile, the parser's `Fixity::None` codepath is previously unreachable as indicated by the comment, so as long as `Fixity::None` here behaves exactly the way that `Fixity::Left` used to behave, you can tell that this PR definitely does not constitute any behavior change for the parser.

My guess for why comparison operators were set to `Fixity::Left` instead of `Fixity::None` is that it's a very old workaround for giving a good chained comparisons diagnostic (like what I pasted above). Nowadays that is handled by a different dedicated codepath.
2024-12-21 01:18:43 -05:00
Jacob Pratt
cc27e3f08b Rollup merge of #134593 - kornelski:less-unwrap, r=jhpratt
Less unwrap() in documentation

I think the common use of `.unwrap()` in examples makes it overrepresented, looking like a more typical way of error handling than it really is in real programs.

Therefore, this PR changes a bunch of examples to use different error handling methods, primarily the `?` operator. Additionally, `unwrap()` docs warn that it might abort the program.
2024-12-21 01:18:43 -05:00
Jacob Pratt
c682d30337 Rollup merge of #134579 - hkBst:patch-6, r=jhpratt
Improve prose around into_slice example of IterMut

Having a part without modification and one with seems redundant, since `into_slice` is only called for the part without. I have brought the modification into the remaining part, although it perhaps does not add much (or only distracts?).
2024-12-21 01:18:42 -05:00
Jacob Pratt
91320f6eb8 Rollup merge of #134577 - hkBst:patch-5, r=jhpratt
Improve prose around `as_slice` example of Iter
2024-12-21 01:18:41 -05:00
Jacob Pratt
ba4f4f6a4f Rollup merge of #134576 - hkBst:patch-4, r=jhpratt
Improve prose around basic examples of Iter and IterMut
2024-12-21 01:18:41 -05:00
Jacob Pratt
307fe498eb Rollup merge of #134575 - compiler-errors:drop-lint-coro, r=nikomatsakis
Handle `DropKind::ForLint` in coroutines correctly

Fixes #134566
Fixes #134541
2024-12-21 01:18:40 -05:00
Jacob Pratt
36485acdac Rollup merge of #133087 - estebank:stmt-misparse, r=chenyukang
Detect missing `.` in method chain in `let` bindings and statements

On parse errors where an ident is found where one wasn't expected, see if the next elements might have been meant as method call or field access.

```
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `map`
  --> $DIR/missing-dot-on-statement-expression.rs:7:29
   |
LL |     let _ = [1, 2, 3].iter()map(|x| x);
   |                             ^^^ expected one of `.`, `;`, `?`, `else`, or an operator
   |
help: you might have meant to write a method call
   |
LL |     let _ = [1, 2, 3].iter().map(|x| x);
   |                             +
```
2024-12-21 01:18:40 -05:00
Ralf Jung
7b29dafacf Merge pull request #4090 from RalfJung/sc-test
add more tests for SC access/fence consistency
2024-12-21 06:09:12 +00:00
Oli Scherer
268a5f423e Merge pull request #4102 from rust-lang/rustup-2024-12-21
Automatic Rustup
2024-12-21 05:35:01 +00:00
David Tolnay
23a250738b Relocate dyn* test out of parenthesis insertion test 2024-12-20 21:31:21 -08:00
David Tolnay
1cc8289791 Support pretty-printing dyn* trait objects 2024-12-20 21:31:21 -08:00
The Miri Cronjob Bot
591c47b247 Merge from rustc 2024-12-21 05:09:29 +00:00
The Miri Cronjob Bot
9dac973f84 Preparing for merge from rustc 2024-12-21 05:01:56 +00:00
Kevin Reid
7b500d852d Explain why a type is not eligible for impl PointerLike.
The rules were baffling when I ran in to them trying to add some impls,
so I made the compiler explain them to me.

The logic of the successful cases is unchanged, but I did rearrange it
to reverse the order of the primitive and `Adt` cases; this makes
producing the errors easier.
2024-12-20 20:49:09 -08:00
Kevin Reid
da6616c54f Document PointerLike implementation restrictions. 2024-12-20 20:47:03 -08:00
David Tolnay
fe65e886f3 Change comparison operators to have Fixity::None 2024-12-20 20:12:22 -08:00
David Tolnay
d748d1d953 Add some parenthesization test cases with operators that are not left-associative 2024-12-20 20:12:20 -08:00
David Tolnay
3f98f76d70 Check that pretty-printer parenthesis test operates on the whole test case 2024-12-20 19:59:10 -08:00
bors
73c278fd93 Auto merge of #134594 - weihanglo:update-cargo, r=weihanglo
Update cargo

10 commits in 99dff6d77db779716dda9ca3b29c26addd02c1be..652623b779c88fe44afede28bf7f1c9c07812511
2024-12-18 00:55:17 +0000 to 2024-12-20 15:44:42 +0000
- fix(package): use relpath to cwd for vcs dirtiness report (rust-lang/cargo#14970)
- Enable triagebot merge conflict notifications (rust-lang/cargo#14972)
- fixed the error message for a user to open the crate (rust-lang/cargo#14969)
- fix(package): show dirty filepaths relative to git workdir (rust-lang/cargo#14968)
- Add the `test` cfg as a well known cfg before of compiler change (rust-lang/cargo#14963)
- refactor(cargo-package): let-else to flatten code (rust-lang/cargo#14959)
- fix(cargo-package): add more traces (rust-lang/cargo#14960)
- Do not hash absolute sysroot path into stdlib crates metadata. (rust-lang/cargo#14951)
- docs: add missing argument to Rustup Cargo workaround (rust-lang/cargo#14954)
- fix(cargo-rustc): stabilize higher precedence trailing flags (rust-lang/cargo#14900)
2024-12-21 03:59:07 +00:00
Esteban Küber
1549af29c3 Do not suggest foo.Bar 2024-12-21 03:02:07 +00:00
Esteban Küber
cbbc7becc8 Account for missing . in macros to avoid incorrect suggestion 2024-12-21 02:46:33 +00:00