Commit graph

255253 commits

Author SHA1 Message Date
Michael Goulet dbfed2c43e Add failing test for cross-crate enum in type alias 2024-05-19 20:13:18 -04:00
bors d84b903754 Auto merge of #125294 - matthiaskrgr:rollup-w42c829, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #124948 (chore: Remove repeated words (extension of #124924))
 - #124992 (Add example to IsTerminal::is_terminal)
 - #125279 (make `Debug` impl for `Term` simpler)
 - #125286 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-19 21:30:43 +00:00
Matthias Krüger 7a45322300
Rollup merge of #125286 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-05-19 22:50:56 +02:00
Matthias Krüger 131d48f5a1
Rollup merge of #125279 - WaffleLapkin:unpacktermindebug, r=aDotInTheVoid,Nilstrieb,BoxyUwU
make `Debug` impl for `Term` simpler

meow
2024-05-19 22:50:56 +02:00
Matthias Krüger c5b8c7c3b0
Rollup merge of #124992 - foresterre:example/is-terminal, r=ChrisDenton
Add example to IsTerminal::is_terminal
2024-05-19 22:50:55 +02:00
Matthias Krüger d5bef41ee5
Rollup merge of #124948 - blyxyas:remove-repeated-words, r=compiler-errors
chore: Remove repeated words (extension of #124924)

When I saw #124924 I thought "Hey, I'm sure that there are far more than just two typos of this nature in the codebase". So here's some more typo-fixing.

Some found with regex, some found with a spellchecker. Every single one manually reviewed by me (along with hundreds of false negatives by the tools)
2024-05-19 22:50:55 +02:00
bors 1d1283ed09 Auto merge of #125006 - spastorino:generics-is-empty, r=compiler-errors
Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes

r? `@compiler-errors`

Related to #123929
2024-05-19 19:22:57 +00:00
Ralf Jung e93268eee2 update lockfile 2024-05-19 20:31:08 +02:00
Martijn 0b6baf6130 Add example to IsTerminal::is_terminal 2024-05-19 20:00:02 +02:00
bors 85ed056888 Auto merge of #3319 - bjorn3:some_more_shims, r=RalfJung
Directly implement native exception raise methods in miri

This implements the `_Unwind_RaiseException` function used on pretty much every unix system for starting unwinding. This allows removing the miri special case from libpanic_unwind for unix.

Windows still needs `miri_start_unwind` as SEH unwinding isn't supported by miri. Unlike DWARF unwinding, SEH preserves all stack frames until right after the do_catch function has executed. Because of this panic_unwind stack allocates the exception object. Miri can't currently model unwinding without destroying stack frames and as such will report a use-after-free of the exception object.
2024-05-19 17:35:20 +00:00
Ralf Jung 5e41ff516f various small nits
- share implementation with miri_starting_unwind
- make test use a custom unwinding class
- extend comments
- use NeedsUnwind more consistently
2024-05-19 19:31:52 +02:00
bors 959a67a7f2 Auto merge of #123786 - a1phyr:cursor_unsafe, r=joboet
Remove bound checks from `BorrowedBuf` and `BorrowedCursor` methods
2024-05-19 17:16:12 +00:00
bjorn3 42cb1ffa36 Directly implement native exception raise methods in miri
Windows still needs the old custom ABI as SEH unwinding isn't supported
by miri. Unlike DWARF unwinding it preserves all stack frames until
right after the do_catch function has executed. Because of this
panic_unwind stack allocates the exception object. Miri can't currently
model unwinding without destroying stack frames and as such will report
a use-after-free of the exception object.
2024-05-19 19:06:31 +02:00
bors a32423c28e Auto merge of #3621 - RalfJung:argparse, r=RalfJung
use a little arg-parsing helper for miri-script
2024-05-19 16:58:51 +00:00
Ralf Jung 9cba160d52 use a little arg-parsing helper for miri-script 2024-05-19 18:57:22 +02:00
bors 698293518d Auto merge of #125280 - compiler-errors:rollup-401itda, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #123709 (Update documentation related to the recent cmd.exe fix)
 - #124304 (revise the interpretation of ReadDir for HermitOS)
 - #124708 (Actually use the `#[do_not_recommend]` attribute if present)
 - #125252 (Add `#[inline]` to float `Debug` fallback used by `cfg(no_fp_fmt_parse)`)
 - #125261 (crashes: add more)
 - #125270 (Followup fixes from #123344)
 - #125275 (Migrate `run-make/rustdoc-scrape-examples-test` to new `rmake.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-19 15:06:28 +00:00
Michael Goulet e959fd6634
Rollup merge of #125275 - GuillaumeGomez:migrate-rustdoc-scrape-examples-test, r=jieyouxu
Migrate `run-make/rustdoc-scrape-examples-test` to new `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? ``@jieyouxu``
2024-05-19 11:04:10 -04:00
Michael Goulet b65fcda4d5
Rollup merge of #125270 - pietroalbini:pa-no-sad-contributors, r=Nilstrieb
Followup fixes from #123344

``@Nilstrieb`` doesn't deserve [to be sad](https://github.com/rust-lang/rust/pull/123344#issuecomment-2100978863), so this PR addresses the two pieces of feedback from that PR.

r? ``@Nilstrieb``
2024-05-19 11:04:09 -04:00
Michael Goulet 0fd615f70e
Rollup merge of #125261 - matthiaskrgr:from_ashes_to_crashes, r=jieyouxu
crashes: add more

r? ``@jieyouxu``
2024-05-19 11:04:09 -04:00
Michael Goulet edace328b8
Rollup merge of #125252 - beetrees:patch-1, r=joboet
Add `#[inline]` to float `Debug` fallback used by `cfg(no_fp_fmt_parse)`

Fixes #125229.
2024-05-19 11:04:08 -04:00
Michael Goulet e940ca7d4f
Rollup merge of #124708 - weiznich:implement_do_not_recommend, r=compiler-errors,estebank
Actually use the `#[do_not_recommend]` attribute if present

This change tweaks the error message generation to actually use the `#[do_not_recommend]` attribute if present by just skipping the marked trait impl in favour of the parent impl. It also adds a compile test for this behaviour. Without this change the test would output the following error:

```
error[E0277]: the trait bound `&str: Expression` is not satisfied
  --> /home/weiznich/Documents/rust/rust/tests/ui/diagnostic_namespace/do_not_recommend.rs:53:15
   |
LL |     SelectInt.check("bar");
   |               ^^^^^ the trait `Expression` is not implemented for `&str`, which is required by `&str: AsExpression<Integer>`
   |
   = help: the following other types implement trait `Expression`:
             Bound<T>
             SelectInt
note: required for `&str` to implement `AsExpression<Integer>`
  --> /home/weiznich/Documents/rust/rust/tests/ui/diagnostic_namespace/do_not_recommend.rs:26:13
   |
LL | impl<T, ST> AsExpression<ST> for T
   |             ^^^^^^^^^^^^^^^^     ^
LL | where
LL |     T: Expression<SqlType = ST>,
   |        ------------------------ unsatisfied trait bound introduced here
```

Note how that mentions `&str: Expression` before and now mentions `&str: AsExpression<Integer>` instead which is much more helpful for users.

Open points for further changes before stabilization:

* We likely want to move the attribute to the `#[diagnostic]` namespace to relax the guarantees given?
* How does it interact with the new trait solver?

r? `@estebank`
2024-05-19 11:04:08 -04:00
Michael Goulet f848505c40
Rollup merge of #124304 - hermit-os:fuse, r=joboet
revise the interpretation of ReadDir for HermitOS

HermitOS supports getdents64. As under Linux, the dirent64 entry `d_off` is not longer used, because its definition is not clear. Instead of `d_off` the entry `d_reclen` is used to determine the end of the dirent64 entry.

In addition, take up `@workingjubilee`  suggestion from the discussions in rust-lang/rust#115984 to increase the readability.

Hermit is a tier 3 platform and this PR changes only files, wich are related to the tier 3 platform.
2024-05-19 11:04:07 -04:00
Michael Goulet 0f923a48c5
Rollup merge of #123709 - tgross35:windows-cmd-docs-update, r=ChrisDenton
Update documentation related to the recent cmd.exe fix

Fix some grammar nits, change `bat` (extension) -> `batch` (file), and make line wrapping more consistent.
2024-05-19 11:04:07 -04:00
bors f7520e40f7 Auto merge of #3620 - RalfJung:wasi, r=RalfJung
test wasm32-wasip2 instead of the deprecated wasm32-wasi target
2024-05-19 14:51:12 +00:00
Waffle Lapkin 006866f558 make Debug impl for Term simpler 2024-05-19 16:48:54 +02:00
Ralf Jung b8a7c73792 test wasm32-wasip2 instead of the deprecated wasm32-wasi target 2024-05-19 16:48:48 +02:00
Santiago Pastorino 4501ae89f1
Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes 2024-05-19 11:10:56 -03:00
Guillaume Gomez 2f8b98c664 Migrate run-make/rustdoc-scrape-examples-test to new rmake.rs 2024-05-19 15:02:30 +02:00
bors 7d2a95b143 Auto merge of #125272 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2024-05-19 12:56:35 +00:00
bors 3c15681a48 Auto merge of #3619 - RalfJung:print-sysroot, r=RalfJung
properly print error in 'cargo miri setup --print-sysroot'

Based on rustc-build-sysroot now putting the stderr into the error message.
2024-05-19 12:04:28 +00:00
Ralf Jung 2b9c1caa18 properly print error in 'cargo miri setup --print-sysroot' 2024-05-19 14:01:52 +02:00
bors 84b9b6d16c Auto merge of #125145 - Kobzol:ci-toolstate, r=Mark-Simulacrum
CI: fix toolstate publishing

Toolstate publishing after something broke was not working (discovered [here](https://github.com/rust-lang/rust/pull/124050#issuecomment-2111292015)). The toolstate env. vars should only be needed for the publishing step, so I moved them there.

The toolstate script is also being checked in `mingw-check` on PR and auto CI, but it doesn't really seem to do anything, and it shouldn't require the token.
2024-05-19 10:49:24 +00:00
bors 0e41a801f3 Auto merge of #3616 - RalfJung:android, r=RalfJung
make basic things work on Android

Fixes https://github.com/rust-lang/miri/issues/3608
2024-05-19 10:14:36 +00:00
bors 3726afad7e Auto merge of #3585 - devnexen:aligned_alloc, r=RalfJung
support aligned_alloc for unixes.

Fixes https://github.com/rust-lang/miri/issues/3577
2024-05-19 09:50:25 +00:00
Ralf Jung 844de64396 make basic things work on Android 2024-05-19 11:50:12 +02:00
Ralf Jung 430298c3ad a bit of refactoring and tweak the aligned-allocation tests 2024-05-19 11:48:51 +02:00
Laurențiu Nicola 0f4d94a5b0 Add option-ext to RA license exception list 2024-05-19 11:53:08 +03:00
bors 8d7c8ac50a Auto merge of #3615 - RalfJung:rustup, r=RalfJung
Rustup
2024-05-19 08:42:59 +00:00
bors 7c735958b2 Auto merge of #124674 - onur-ozkan:followup-124461, r=pietroalbini
keep the `STAGE0_MISSING_TARGETS` list updated

Implements https://github.com/rust-lang/rust/pull/124461#issuecomment-2092574309.

r? pietroalbini
2024-05-19 08:41:49 +00:00
Ralf Jung 3460853a45 Merge from rustc 2024-05-19 10:35:44 +02:00
Ralf Jung 1ba83f2dc1 Preparing for merge from rustc 2024-05-19 10:35:38 +02:00
bors 9f4b651720 Auto merge of #17259 - lnicola:sync-from-rust, r=lnicola
internal: Sync from downstream
2024-05-19 08:28:03 +00:00
Pietro Albini 5d03c3d3a5
fix typo 2024-05-19 10:23:31 +02:00
Laurențiu Nicola c944b01b81 Bump rustc crates 2024-05-19 11:22:58 +03:00
Pietro Albini 3ce9b2f95b
document what the span of UseTreeKind::Nested is 2024-05-19 10:22:19 +02:00
Laurențiu Nicola 6ead205843 Merge from rust-lang/rust 2024-05-19 11:20:26 +03:00
Laurențiu Nicola 2018426f56 Preparing for merge from rust-lang/rust 2024-05-19 11:20:20 +03:00
Georg Semmler 9b45cfdbdd
Actually use the #[do_not_recommend] attribute if present
This change tweaks the error message generation to actually use the
`#[do_not_recommend]` attribute if present by just skipping the marked
trait impl in favour of the parent impl. It also adds a compile test for
this behaviour. Without this change the test would output the following
error:

```
error[E0277]: the trait bound `&str: Expression` is not satisfied
  --> /home/weiznich/Documents/rust/rust/tests/ui/diagnostic_namespace/do_not_recommend.rs:53:15
   |
LL |     SelectInt.check("bar");
   |               ^^^^^ the trait `Expression` is not implemented for `&str`, which is required by `&str: AsExpression<Integer>`
   |
   = help: the following other types implement trait `Expression`:
             Bound<T>
             SelectInt
note: required for `&str` to implement `AsExpression<Integer>`
  --> /home/weiznich/Documents/rust/rust/tests/ui/diagnostic_namespace/do_not_recommend.rs:26:13
   |
LL | impl<T, ST> AsExpression<ST> for T
   |             ^^^^^^^^^^^^^^^^     ^
LL | where
LL |     T: Expression<SqlType = ST>,
   |        ------------------------ unsatisfied trait bound introduced here
```

Note how that mentions `&str: Expression` before and now mentions `&str:
AsExpression<Integer>` instead which is much more helpful for users.

Open points for further changes before stabilization:

* We likely want to move the attribute to the `#[diagnostic]` namespace
to relax the guarantees given?
* How does it interact with the new trait solver?
2024-05-19 08:29:27 +02:00
bors 496f7310c8 Auto merge of #124640 - Billy-Sheppard:master, r=dtolnay
Fix #124275: Implemented Default for `Arc<str>`

With added implementations.

```
GOOD    Arc<CStr>
BROKEN  Arc<OsStr> // removed
GOOD    Rc<str>
GOOD    Rc<CStr>
BROKEN  Rc<OsStr> // removed

GOOD    Rc<[T]>
GOOD    Arc<[T]>
```

For discussion of https://github.com/rust-lang/rust/pull/124367#issuecomment-2091940137.

Key pain points currently:
> I've had a guess at the best locations/feature attrs for them but they might not be correct.

> However I'm unclear how to get the OsStr impl to compile, which file should they go in to avoid the error below? Is it possible, perhaps with some special std rust lib magic?
2024-05-19 06:25:20 +00:00
bors 6579ed89f0 Auto merge of #124500 - VladimirMakaev:lldb-str-formatters, r=Mark-Simulacrum
lldb-formatters: Use StdSliceSyntheticProvider for &str

&str has associated summary provider which correctly displays string values in debugger, but while working on https://github.com/rust-lang/rust/pull/124458 I've noticed that a &str inside an enum displays a blob of memory until a 0 is reached (as a c-string) which makes a very bizarre experience when debugging

However there is already StdSliceSyntheticProvider which we use for other slices. This PR enables the same synthetic provider to be used for &str, however the summary provider is still fixed to return the string value

I've added a test `debuginfo/strings-and-strs.rs` which prior to this PR would output the following in LLDB:
```
* thread #1, name = 'a', stop reason = breakpoint 1.1
    frame #0: 0x0000555555556383 a`strings_and_strs::main::h1d2b5f9227b8767d at strings-and-strs.rs:47:5
   44  	    let plain_str = "Hello";
   45  	    let str_in_struct = Foo { inner: "Hello" };
   46  	    let str_in_tuple = ("Hello", "World");
-> 47  	    zzz(); // #break
   48  	}
   49
   50  	fn zzz() {
(lldb) frame var
(alloc::string::String) plain_string = "Hello" {
  vec = size=5 {
    [0] = 'H'
    [1] = 'e'
    [2] = 'l'
    [3] = 'l'
    [4] = 'o'
  }
}
(&str) plain_str = "Hello" {
  data_ptr = 0x0000555555557263 "HelloWorld\U00000001gdb_load_rust_pretty_printers.py"
  length = 5
}
(strings_and_strs::Foo) str_in_struct = {
  inner = "Hello" {
    data_ptr = 0x0000555555557263 "HelloWorld\U00000001gdb_load_rust_pretty_printers.py"
    length = 5
  }
}
((&str, &str)) str_in_tuple = {
  0 = "Hello" {
    data_ptr = 0x0000555555557263 "HelloWorld\U00000001gdb_load_rust_pretty_printers.py"
    length = 5
  }
  1 = "World" {
    data_ptr = 0x0000555555557268 "World\U00000001gdb_load_rust_pretty_printers.py"
    length = 5
  }
}
```
After this PR it would look the following way:

```
* thread #1, name = 'a', stop reason = breakpoint 1.1
    frame #0: 0x0000555555556383 a`strings_and_strs::main::h1d2b5f9227b8767d at strings-and-strs.rs:47:5
   44  	    let plain_str = "Hello";
   45  	    let str_in_struct = Foo { inner: "Hello" };
   46  	    let str_in_tuple = ("Hello", "World");
-> 47  	    zzz(); // #break
   48  	}
   49
   50  	fn zzz() {
(lldb) frame var
(alloc::string::String) plain_string = "Hello" {
  vec = size=5 {
    [0] = 'H'
    [1] = 'e'
    [2] = 'l'
    [3] = 'l'
    [4] = 'o'
  }
}
(&str) plain_str = "Hello" {
  [0] = 'H'
  [1] = 'e'
  [2] = 'l'
  [3] = 'l'
  [4] = 'o'
}
(strings_and_strs::Foo) str_in_struct = {
  inner = "Hello" {
    [0] = 'H'
    [1] = 'e'
    [2] = 'l'
    [3] = 'l'
    [4] = 'o'
  }
}
((&str, &str)) str_in_tuple = {
  0 = "Hello" {
    [0] = 'H'
    [1] = 'e'
    [2] = 'l'
    [3] = 'l'
    [4] = 'o'
  }
  1 = "World" {
    [0] = 'W'
    [1] = 'o'
    [2] = 'r'
    [3] = 'l'
    [4] = 'd'
  }
}
```
2024-05-19 04:18:52 +00:00