| author | bors <bors@rust-lang.org> 2025-05-09 23:48:54 UTC |
| committer | bors <bors@rust-lang.org> 2025-05-09 23:48:54 UTC |
| log | fd9fad6dbcc1bae3cba2a8634339ffa620a49f28 |
| tree | 0c8238f7f690ead0038f7a3a5cc0920956ef336c |
| parent | dcecb99176edf2eec51613730937d21cdd5c8f6e |
| parent | 505e78a29c6a267dae875c3055ad09d6329962af |
Rollup of 7 pull requests
Successful merges:
- #139863 (rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg`)
- #140815 (also export metrics from librustdoc)
- #140819 (Add regression test for 125877)
- #140843 (Fix `broken-pipe-no-ice` run-make test for rpath-less builds)
- #140848 (Improved error message for top-level or-patterns)
- #140852 (Update the edition guide for let chains)
- #140864 (Last minute relnotes fix)
r? `@ghost`
`@rustbot` modify labels: rollup29 files changed, 217 insertions(+), 189 deletions(-)
RELEASES.md+76-76| ... | ... | @@ -45,83 +45,83 @@ Libraries |
| 45 | 45 | Stabilized APIs |
| 46 | 46 | --------------- |
| 47 | 47 | |
| 48 | - [`Vec::extract_if`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.extract_if) | |
| 49 | - [`vec::ExtractIf`](https://doc.rust-lang.org/nightly/std/vec/struct.ExtractIf.html) | |
| 50 | - [`LinkedList::extract_if`](https://doc.rust-lang.org/nightly/std/collections/struct.LinkedList.html#method.extract_if) | |
| 51 | - [`linked_list::ExtractIf`](https://doc.rust-lang.org/nightly/std/collections/linked_list/struct.ExtractIf.html) | |
| 52 | - [`<[T]>::split_off`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_off) | |
| 53 | - [`<[T]>::split_off_mut`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_off_mut) | |
| 54 | - [`<[T]>::split_off_first`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_off_first) | |
| 55 | - [`<[T]>::split_off_first_mut`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_off_first_mut) | |
| 56 | - [`<[T]>::split_off_last`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_off_last) | |
| 57 | - [`<[T]>::split_off_last_mut`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_off_last_mut) | |
| 48 | - [`Vec::extract_if`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.extract_if) | |
| 49 | - [`vec::ExtractIf`](https://doc.rust-lang.org/stable/std/vec/struct.ExtractIf.html) | |
| 50 | - [`LinkedList::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.extract_if) | |
| 51 | - [`linked_list::ExtractIf`](https://doc.rust-lang.org/stable/std/collections/linked_list/struct.ExtractIf.html) | |
| 52 | - [`<[T]>::split_off`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off) | |
| 53 | - [`<[T]>::split_off_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_mut) | |
| 54 | - [`<[T]>::split_off_first`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first) | |
| 55 | - [`<[T]>::split_off_first_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first_mut) | |
| 56 | - [`<[T]>::split_off_last`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last) | |
| 57 | - [`<[T]>::split_off_last_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last_mut) | |
| 58 | 58 | - [`String::extend_from_within`](https://doc.rust-lang.org/stable/alloc/string/struct.String.html#method.extend_from_within) |
| 59 | - [`os_str::Display`](https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.Display.html) | |
| 60 | - [`OsString::display`](https://doc.rust-lang.org/nightly/std/ffi/struct.OsString.html#method.display) | |
| 61 | - [`OsStr::display`](https://doc.rust-lang.org/nightly/std/ffi/struct.OsStr.html#method.display) | |
| 62 | - [`io::pipe`](https://doc.rust-lang.org/nightly/std/io/fn.pipe.html) | |
| 63 | - [`io::PipeReader`](https://doc.rust-lang.org/nightly/std/io/struct.PipeReader.html) | |
| 64 | - [`io::PipeWriter`](https://doc.rust-lang.org/nightly/std/io/struct.PipeWriter.html) | |
| 65 | - [`impl From<PipeReader> for OwnedHandle`](https://doc.rust-lang.org/nightly/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeReader%3E-for-OwnedHandle) | |
| 66 | - [`impl From<PipeWriter> for OwnedHandle`](https://doc.rust-lang.org/nightly/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeWriter%3E-for-OwnedHandle) | |
| 67 | - [`impl From<PipeReader> for Stdio`](https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html) | |
| 68 | - [`impl From<PipeWriter> for Stdio`](https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html#impl-From%3CPipeWriter%3E-for-Stdio) | |
| 69 | - [`impl From<PipeReader> for OwnedFd`](https://doc.rust-lang.org/nightly/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeReader%3E-for-OwnedFd) | |
| 70 | - [`impl From<PipeWriter> for OwnedFd`](https://doc.rust-lang.org/nightly/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeWriter%3E-for-OwnedFd) | |
| 71 | - [`Box<MaybeUninit<T>>::write`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.write) | |
| 72 | - [`impl TryFrom<Vec<u8>> for String`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#impl-TryFrom%3CVec%3Cu8%3E%3E-for-String) | |
| 73 | ||
| 74 | These APIs are now stable in const contexts: | |
| 75 | ||
| 76 | - [`<*const T>::offset_from_unsigned`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.offset_from_unsigned) | |
| 77 | - [`<*const T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.byte_offset_from_unsigned) | |
| 78 | - [`<*mut T>::offset_from_unsigned`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.offset_from_unsigned-1) | |
| 79 | - [`<*mut T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.byte_offset_from_unsigned-1) | |
| 80 | - [`NonNull::offset_from_unsigned`](https://doc.rust-lang.org/nightly/std/ptr/struct.NonNull.html#method.offset_from_unsigned) | |
| 81 | - [`NonNull::byte_offset_from_unsigned`](https://doc.rust-lang.org/nightly/std/ptr/struct.NonNull.html#method.byte_offset_from_unsigned) | |
| 82 | - [`<uN>::cast_signed`](https://doc.rust-lang.org/nightly/std/primitive.usize.html#method.cast_signed) | |
| 83 | - [`NonZero::<uN>::cast_signed`](https://doc.rust-lang.org/nightly/std/num/struct.NonZero.html#method.cast_signed-5). | |
| 84 | - [`<iN>::cast_signed`](https://doc.rust-lang.org/nightly/std/primitive.isize.html#method.cast_signed). | |
| 85 | - [`NonZero::<iN>::cast_unsigned`](https://doc.rust-lang.org/nightly/std/num/struct.NonZero.html#method.cast_unsigned-5). | |
| 86 | - [`<uN>::is_multiple_of`](https://doc.rust-lang.org/nightly/std/primitive.usize.html#method.is_multiple_of) | |
| 87 | - [`<uN>::unbounded_shl`](https://doc.rust-lang.org/nightly/std/primitive.usize.html#method.unbounded_shl) | |
| 88 | - [`<uN>::unbounded_shr`](https://doc.rust-lang.org/nightly/std/primitive.usize.html#method.unbounded_shr) | |
| 89 | - [`<iN>::unbounded_shl`](https://doc.rust-lang.org/nightly/std/primitive.isize.html#method.unbounded_shl) | |
| 90 | - [`<iN>::unbounded_shr`](https://doc.rust-lang.org/nightly/std/primitive.isize.html#method.unbounded_shr) | |
| 91 | - [`<str>::from_utf8`](https://doc.rust-lang.org/nightly/std/primitive.str.html#method.from_utf8) | |
| 92 | - [`<str>::from_utf8_mut`](https://doc.rust-lang.org/nightly/std/primitive.str.html#method.from_utf8_mut) | |
| 93 | - [`<str>::from_utf8_unchecked`](https://doc.rust-lang.org/nightly/std/primitive.str.html#method.from_utf8_unchecked) | |
| 94 | - [`<str>::from_utf8_unchecked_mut`](https://doc.rust-lang.org/nightly/std/primitive.str.html#method.from_utf8_unchecked_mut) | |
| 95 | - [`core::str::from_utf8_mut`](https://doc.rust-lang.org/nightly/std/str/fn.from_utf8_mut.html) | |
| 96 | - [`<[T]>::copy_from_slice`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.copy_from_slice) | |
| 97 | - [`SocketAddr::set_ip`](https://doc.rust-lang.org/nightly/std/net/enum.SocketAddr.html#method.set_ip) | |
| 98 | - [`SocketAddr::set_port`](https://doc.rust-lang.org/nightly/std/net/enum.SocketAddr.html#method.set_port), | |
| 99 | - [`SocketAddrV4::set_ip`](https://doc.rust-lang.org/nightly/std/net/struct.SocketAddrV4.html#method.set_ip) | |
| 100 | - [`SocketAddrV4::set_port`](https://doc.rust-lang.org/nightly/std/net/struct.SocketAddrV4.html#method.set_port), | |
| 101 | - [`SocketAddrV6::set_ip`](https://doc.rust-lang.org/nightly/std/net/struct.SocketAddrV6.html#method.set_ip) | |
| 102 | - [`SocketAddrV6::set_port`](https://doc.rust-lang.org/nightly/std/net/struct.SocketAddrV6.html#method.set_port) | |
| 103 | - [`SocketAddrV6::set_flowinfo`](https://doc.rust-lang.org/nightly/std/net/struct.SocketAddrV6.html#method.set_flowinfo) | |
| 104 | - [`SocketAddrV6::set_scope_id`](https://doc.rust-lang.org/nightly/std/net/struct.SocketAddrV6.html#method.set_scope_id) | |
| 105 | - [`char::is_digit`](https://doc.rust-lang.org/nightly/std/primitive.char.html#method.is_digit) | |
| 106 | - [`char::is_whitespace`](https://doc.rust-lang.org/nightly/std/primitive.char.html#method.is_whitespace) | |
| 107 | - [`<iN>::midpoint`](https://doc.rust-lang.org/std/primitive.isize.html#method.midpoint) | |
| 108 | - [`<[[T; N]]>::as_flattened`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_flattened) | |
| 109 | - [`<[[T; N]]>::as_flattened_mut`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_flattened_mut) | |
| 110 | - [`String::into_bytes`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.into_bytes) | |
| 111 | - [`String::as_str`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.as_str) | |
| 112 | - [`String::capacity`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.capacity) | |
| 113 | - [`String::as_bytes`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.as_bytes) | |
| 114 | - [`String::len`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.len) | |
| 115 | - [`String::is_empty`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.is_empty) | |
| 116 | - [`String::as_mut_str`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.as_mut_str) | |
| 117 | - [`String::as_mut_vec`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.as_mut_vec) | |
| 118 | - [`Vec::as_ptr`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.as_ptr) | |
| 119 | - [`Vec::as_slice`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.as_slice) | |
| 120 | - [`Vec::capacity`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.capacity) | |
| 121 | - [`Vec::len`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.len) | |
| 122 | - [`Vec::is_empty`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.is_empty) | |
| 123 | - [`Vec::as_mut_slice`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.as_mut_slice) | |
| 124 | - [`Vec::as_mut_ptr`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.as_mut_ptr) | |
| 59 | - [`os_str::Display`](https://doc.rust-lang.org/stable/std/ffi/os_str/struct.Display.html) | |
| 60 | - [`OsString::display`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.display) | |
| 61 | - [`OsStr::display`](https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.display) | |
| 62 | - [`io::pipe`](https://doc.rust-lang.org/stable/std/io/fn.pipe.html) | |
| 63 | - [`io::PipeReader`](https://doc.rust-lang.org/stable/std/io/struct.PipeReader.html) | |
| 64 | - [`io::PipeWriter`](https://doc.rust-lang.org/stable/std/io/struct.PipeWriter.html) | |
| 65 | - [`impl From<PipeReader> for OwnedHandle`](https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeReader%3E-for-OwnedHandle) | |
| 66 | - [`impl From<PipeWriter> for OwnedHandle`](https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeWriter%3E-for-OwnedHandle) | |
| 67 | - [`impl From<PipeReader> for Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html) | |
| 68 | - [`impl From<PipeWriter> for Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CPipeWriter%3E-for-Stdio) | |
| 69 | - [`impl From<PipeReader> for OwnedFd`](https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeReader%3E-for-OwnedFd) | |
| 70 | - [`impl From<PipeWriter> for OwnedFd`](https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeWriter%3E-for-OwnedFd) | |
| 71 | - [`Box<MaybeUninit<T>>::write`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.write) | |
| 72 | - [`impl TryFrom<Vec<u8>> for String`](https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-TryFrom%3CVec%3Cu8%3E%3E-for-String) | |
| 73 | - [`<*const T>::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned) | |
| 74 | - [`<*const T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned) | |
| 75 | - [`<*mut T>::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned-1) | |
| 76 | - [`<*mut T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned-1) | |
| 77 | - [`NonNull::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.offset_from_unsigned) | |
| 78 | - [`NonNull::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.byte_offset_from_unsigned) | |
| 79 | - [`<uN>::cast_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.cast_signed) | |
| 80 | - [`NonZero::<uN>::cast_signed`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_signed-5). | |
| 81 | - [`<iN>::cast_unsigned`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.cast_unsigned). | |
| 82 | - [`NonZero::<iN>::cast_unsigned`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_unsigned-5). | |
| 83 | - [`<uN>::is_multiple_of`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.is_multiple_of) | |
| 84 | - [`<uN>::unbounded_shl`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shl) | |
| 85 | - [`<uN>::unbounded_shr`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shr) | |
| 86 | - [`<iN>::unbounded_shl`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shl) | |
| 87 | - [`<iN>::unbounded_shr`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shr) | |
| 88 | - [`<iN>::midpoint`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.midpoint) | |
| 89 | - [`<str>::from_utf8`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8) | |
| 90 | - [`<str>::from_utf8_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8_mut) | |
| 91 | - [`<str>::from_utf8_unchecked`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8_unchecked) | |
| 92 | - [`<str>::from_utf8_unchecked_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8_unchecked_mut) | |
| 93 | ||
| 94 | These previously stable APIs are now stable in const contexts: | |
| 95 | ||
| 96 | - [`core::str::from_utf8_mut`](https://doc.rust-lang.org/stable/std/str/fn.from_utf8_mut.html) | |
| 97 | - [`<[T]>::copy_from_slice`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.copy_from_slice) | |
| 98 | - [`SocketAddr::set_ip`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_ip) | |
| 99 | - [`SocketAddr::set_port`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_port), | |
| 100 | - [`SocketAddrV4::set_ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_ip) | |
| 101 | - [`SocketAddrV4::set_port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_port), | |
| 102 | - [`SocketAddrV6::set_ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_ip) | |
| 103 | - [`SocketAddrV6::set_port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_port) | |
| 104 | - [`SocketAddrV6::set_flowinfo`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_flowinfo) | |
| 105 | - [`SocketAddrV6::set_scope_id`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_scope_id) | |
| 106 | - [`char::is_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_digit) | |
| 107 | - [`char::is_whitespace`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_whitespace) | |
| 108 | - [`<[[T; N]]>::as_flattened`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened) | |
| 109 | - [`<[[T; N]]>::as_flattened_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened_mut) | |
| 110 | - [`String::into_bytes`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.into_bytes) | |
| 111 | - [`String::as_str`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_str) | |
| 112 | - [`String::capacity`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.capacity) | |
| 113 | - [`String::as_bytes`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_bytes) | |
| 114 | - [`String::len`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.len) | |
| 115 | - [`String::is_empty`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.is_empty) | |
| 116 | - [`String::as_mut_str`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_str) | |
| 117 | - [`String::as_mut_vec`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_vec) | |
| 118 | - [`Vec::as_ptr`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_ptr) | |
| 119 | - [`Vec::as_slice`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_slice) | |
| 120 | - [`Vec::capacity`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.capacity) | |
| 121 | - [`Vec::len`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.len) | |
| 122 | - [`Vec::is_empty`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.is_empty) | |
| 123 | - [`Vec::as_mut_slice`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_slice) | |
| 124 | - [`Vec::as_mut_ptr`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_ptr) | |
| 125 | 125 | |
| 126 | 126 | <a id="1.87.0-Cargo"></a> |
| 127 | 127 |
compiler/rustc_parse/messages.ftl+2-2| ... | ... | @@ -690,8 +690,8 @@ parse_nul_in_c_str = null characters in C string literals are not supported |
| 690 | 690 | |
| 691 | 691 | parse_or_in_let_chain = `||` operators are not supported in let chain conditions |
| 692 | 692 | |
| 693 | parse_or_pattern_not_allowed_in_fn_parameters = top-level or-patterns are not allowed in function parameters | |
| 694 | parse_or_pattern_not_allowed_in_let_binding = top-level or-patterns are not allowed in `let` bindings | |
| 693 | parse_or_pattern_not_allowed_in_fn_parameters = function parameters require top-level or-patterns in parentheses | |
| 694 | parse_or_pattern_not_allowed_in_let_binding = `let` bindings require top-level or-patterns in parentheses | |
| 695 | 695 | parse_out_of_range_hex_escape = out of range hex escape |
| 696 | 696 | .label = must be a character in the range [\x00-\x7f] |
| 697 | 697 |
src/doc/edition-guide+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | Subproject commit 467f45637b73ec6aa70fb36bc3054bb50b8967ea | |
| 1 | Subproject commit 1b1bb49babd65c732468cfa515b0c009bd1d26bc |
src/librustdoc/config.rs+3-3| ... | ... | @@ -174,7 +174,7 @@ pub(crate) struct Options { |
| 174 | 174 | pub(crate) expanded_args: Vec<String>, |
| 175 | 175 | |
| 176 | 176 | /// Arguments to be used when compiling doctests. |
| 177 | pub(crate) doctest_compilation_args: Vec<String>, | |
| 177 | pub(crate) doctest_build_args: Vec<String>, | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | impl fmt::Debug for Options { |
| ... | ... | @@ -802,7 +802,7 @@ impl Options { |
| 802 | 802 | let scrape_examples_options = ScrapeExamplesOptions::new(matches, dcx); |
| 803 | 803 | let with_examples = matches.opt_strs("with-examples"); |
| 804 | 804 | let call_locations = crate::scrape_examples::load_call_locations(with_examples, dcx); |
| 805 | let doctest_compilation_args = matches.opt_strs("doctest-compilation-args"); | |
| 805 | let doctest_build_args = matches.opt_strs("doctest-build-arg"); | |
| 806 | 806 | |
| 807 | 807 | let unstable_features = |
| 808 | 808 | rustc_feature::UnstableFeatures::from_environment(crate_name.as_deref()); |
| ... | ... | @@ -851,7 +851,7 @@ impl Options { |
| 851 | 851 | scrape_examples_options, |
| 852 | 852 | unstable_features, |
| 853 | 853 | expanded_args: args, |
| 854 | doctest_compilation_args, | |
| 854 | doctest_build_args, | |
| 855 | 855 | }; |
| 856 | 856 | let render_options = RenderOptions { |
| 857 | 857 | output, |
src/librustdoc/doctest.rs+1-43| ... | ... | @@ -51,46 +51,6 @@ pub(crate) struct GlobalTestOptions { |
| 51 | 51 | pub(crate) args_file: PathBuf, |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | /// Function used to split command line arguments just like a shell would. | |
| 55 | fn split_args(args: &str) -> Vec<String> { | |
| 56 | let mut out = Vec::new(); | |
| 57 | let mut iter = args.chars(); | |
| 58 | let mut current = String::new(); | |
| 59 | ||
| 60 | while let Some(c) = iter.next() { | |
| 61 | if c == '\\' { | |
| 62 | if let Some(c) = iter.next() { | |
| 63 | // If it's escaped, even a quote or a whitespace will be ignored. | |
| 64 | current.push(c); | |
| 65 | } | |
| 66 | } else if c == '"' || c == '\'' { | |
| 67 | while let Some(new_c) = iter.next() { | |
| 68 | if new_c == c { | |
| 69 | break; | |
| 70 | } else if new_c == '\\' { | |
| 71 | if let Some(c) = iter.next() { | |
| 72 | // If it's escaped, even a quote will be ignored. | |
| 73 | current.push(c); | |
| 74 | } | |
| 75 | } else { | |
| 76 | current.push(new_c); | |
| 77 | } | |
| 78 | } | |
| 79 | } else if " \n\t\r".contains(c) { | |
| 80 | if !current.is_empty() { | |
| 81 | out.push(current.clone()); | |
| 82 | current.clear(); | |
| 83 | } | |
| 84 | } else { | |
| 85 | current.push(c); | |
| 86 | } | |
| 87 | } | |
| 88 | if !current.is_empty() { | |
| 89 | out.push(current); | |
| 90 | } | |
| 91 | out | |
| 92 | } | |
| 93 | ||
| 94 | 54 | pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) -> Result<(), String> { |
| 95 | 55 | let mut file = File::create(file_path) |
| 96 | 56 | .map_err(|error| format!("failed to create args file: {error:?}"))?; |
| ... | ... | @@ -119,9 +79,7 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) -> |
| 119 | 79 | content.push(format!("-Z{unstable_option_str}")); |
| 120 | 80 | } |
| 121 | 81 | |
| 122 | for compilation_args in &options.doctest_compilation_args { | |
| 123 | content.extend(split_args(compilation_args)); | |
| 124 | } | |
| 82 | content.extend(options.doctest_build_args.clone()); | |
| 125 | 83 | |
| 126 | 84 | let content = content.join("\n"); |
| 127 | 85 |
src/librustdoc/doctest/tests.rs-22| ... | ... | @@ -381,28 +381,6 @@ fn main() { |
| 381 | 381 | assert_eq!((output, len), (expected, 1)); |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | #[test] | |
| 385 | fn check_split_args() { | |
| 386 | fn compare(input: &str, expected: &[&str]) { | |
| 387 | let output = super::split_args(input); | |
| 388 | let expected = expected.iter().map(|s| s.to_string()).collect::<Vec<_>>(); | |
| 389 | assert_eq!(expected, output, "test failed for {input:?}"); | |
| 390 | } | |
| 391 | ||
| 392 | compare("'a' \"b\"c", &["a", "bc"]); | |
| 393 | compare("'a' \"b \"c d", &["a", "b c", "d"]); | |
| 394 | compare("'a' \"b\\\"c\"", &["a", "b\"c"]); | |
| 395 | compare("'a\"'", &["a\""]); | |
| 396 | compare("\"a'\"", &["a'"]); | |
| 397 | compare("\\ a", &[" a"]); | |
| 398 | compare("\\\\", &["\\"]); | |
| 399 | compare("a'", &["a"]); | |
| 400 | compare("a ", &["a"]); | |
| 401 | compare("a b", &["a", "b"]); | |
| 402 | compare("a\n\t \rb", &["a", "b"]); | |
| 403 | compare("a\n\t1 \rb", &["a", "1", "b"]); | |
| 404 | } | |
| 405 | ||
| 406 | 384 | #[test] |
| 407 | 385 | fn comment_in_attrs() { |
| 408 | 386 | // If there is an inline code comment after attributes, we need to ensure that |
src/librustdoc/lib.rs+22-3| ... | ... | @@ -73,9 +73,11 @@ extern crate tikv_jemalloc_sys as jemalloc_sys; |
| 73 | 73 | |
| 74 | 74 | use std::env::{self, VarError}; |
| 75 | 75 | use std::io::{self, IsTerminal}; |
| 76 | use std::path::Path; | |
| 76 | 77 | use std::process; |
| 77 | 78 | |
| 78 | 79 | use rustc_errors::DiagCtxtHandle; |
| 80 | use rustc_hir::def_id::LOCAL_CRATE; | |
| 79 | 81 | use rustc_interface::interface; |
| 80 | 82 | use rustc_middle::ty::TyCtxt; |
| 81 | 83 | use rustc_session::config::{ErrorOutputType, RustcOptGroup, make_crate_type_option}; |
| ... | ... | @@ -654,9 +656,9 @@ fn opts() -> Vec<RustcOptGroup> { |
| 654 | 656 | Unstable, |
| 655 | 657 | Multi, |
| 656 | 658 | "", |
| 657 | "doctest-compilation-args", | |
| 658 | "", | |
| 659 | "add arguments to be used when compiling doctests", | |
| 659 | "doctest-build-arg", | |
| 660 | "One argument (of possibly many) to be used when compiling doctests", | |
| 661 | "ARG", | |
| 660 | 662 | ), |
| 661 | 663 | opt( |
| 662 | 664 | Unstable, |
| ... | ... | @@ -904,6 +906,10 @@ fn main_args(early_dcx: &mut EarlyDiagCtxt, at_args: &[String]) { |
| 904 | 906 | rustc_interface::passes::write_dep_info(tcx); |
| 905 | 907 | } |
| 906 | 908 | |
| 909 | if let Some(metrics_dir) = &sess.opts.unstable_opts.metrics_dir { | |
| 910 | dump_feature_usage_metrics(tcx, metrics_dir); | |
| 911 | } | |
| 912 | ||
| 907 | 913 | if run_check { |
| 908 | 914 | // Since we're in "check" mode, no need to generate anything beyond this point. |
| 909 | 915 | return; |
| ... | ... | @@ -923,3 +929,16 @@ fn main_args(early_dcx: &mut EarlyDiagCtxt, at_args: &[String]) { |
| 923 | 929 | }) |
| 924 | 930 | }) |
| 925 | 931 | } |
| 932 | ||
| 933 | fn dump_feature_usage_metrics(tcxt: TyCtxt<'_>, metrics_dir: &Path) { | |
| 934 | let hash = tcxt.crate_hash(LOCAL_CRATE); | |
| 935 | let crate_name = tcxt.crate_name(LOCAL_CRATE); | |
| 936 | let metrics_file_name = format!("unstable_feature_usage_metrics-{crate_name}-{hash}.json"); | |
| 937 | let metrics_path = metrics_dir.join(metrics_file_name); | |
| 938 | if let Err(error) = tcxt.features().dump_feature_usage_metrics(metrics_path) { | |
| 939 | // FIXME(yaahc): once metrics can be enabled by default we will want "failure to emit | |
| 940 | // default metrics" to only produce a warning when metrics are enabled by default and emit | |
| 941 | // an error only when the user manually enables metrics | |
| 942 | tcxt.dcx().err(format!("cannot emit feature usage metrics: {error}")); | |
| 943 | } | |
| 944 | } |
src/tools/run-make-support/src/command.rs+6| ... | ... | @@ -63,6 +63,12 @@ impl Command { |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | // Internal-only. | |
| 67 | pub(crate) fn into_raw_command(mut self) -> std::process::Command { | |
| 68 | self.drop_bomb.defuse(); | |
| 69 | self.cmd | |
| 70 | } | |
| 71 | ||
| 66 | 72 | /// Specify a stdin input buffer. This is a convenience helper, |
| 67 | 73 | pub fn stdin_buf<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self { |
| 68 | 74 | self.stdin_buf = Some(input.as_ref().to_vec().into_boxed_slice()); |
src/tools/run-make-support/src/external_deps/rustdoc.rs+2-2| ... | ... | @@ -5,7 +5,7 @@ use crate::command::Command; |
| 5 | 5 | use crate::env::env_var; |
| 6 | 6 | use crate::util::set_host_compiler_dylib_path; |
| 7 | 7 | |
| 8 | /// Construct a new `rustdoc` invocation. | |
| 8 | /// Construct a new `rustdoc` invocation. This will configure the host compiler runtime libs. | |
| 9 | 9 | #[track_caller] |
| 10 | 10 | pub fn rustdoc() -> Rustdoc { |
| 11 | 11 | Rustdoc::new() |
| ... | ... | @@ -28,7 +28,7 @@ fn setup_common() -> Command { |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | impl Rustdoc { |
| 31 | /// Construct a bare `rustdoc` invocation. | |
| 31 | /// Construct a bare `rustdoc` invocation. This will configure the host compiler runtime libs. | |
| 32 | 32 | #[track_caller] |
| 33 | 33 | pub fn new() -> Self { |
| 34 | 34 | let cmd = setup_common(); |
src/tools/run-make-support/src/macros.rs+12| ... | ... | @@ -28,6 +28,18 @@ |
| 28 | 28 | macro_rules! impl_common_helpers { |
| 29 | 29 | ($wrapper: ident) => { |
| 30 | 30 | impl $wrapper { |
| 31 | /// In very rare circumstances, you may need a e.g. `bare_rustc()` or `bare_rustdoc()` | |
| 32 | /// with host runtime libs configured, but want the underlying raw | |
| 33 | /// [`std::process::Command`] (e.g. for manipulating pipes or whatever). This function | |
| 34 | /// will consume the command wrapper and extract the underlying | |
| 35 | /// [`std::process::Command`]. | |
| 36 | /// | |
| 37 | /// Caution: this will mean that you can no longer use the convenience methods on the | |
| 38 | /// command wrapper. Use as a last resort. | |
| 39 | pub fn into_raw_command(self) -> ::std::process::Command { | |
| 40 | self.cmd.into_raw_command() | |
| 41 | } | |
| 42 | ||
| 31 | 43 | /// Specify an environment variable. |
| 32 | 44 | pub fn env<K, V>(&mut self, key: K, value: V) -> &mut Self |
| 33 | 45 | where |
tests/run-make/broken-pipe-no-ice/rmake.rs+5-3| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | use std::io::Read; |
| 15 | 15 | use std::process::{Command, Stdio}; |
| 16 | 16 | |
| 17 | use run_make_support::env_var; | |
| 17 | use run_make_support::{bare_rustc, rustdoc}; | |
| 18 | 18 | |
| 19 | 19 | #[derive(Debug, PartialEq)] |
| 20 | 20 | enum Binary { |
| ... | ... | @@ -67,11 +67,13 @@ fn check_broken_pipe_handled_gracefully(bin: Binary, mut cmd: Command) { |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | fn main() { |
| 70 | let mut rustc = Command::new(env_var("RUSTC")); | |
| 70 | let mut rustc = bare_rustc(); | |
| 71 | 71 | rustc.arg("--print=sysroot"); |
| 72 | let rustc = rustc.into_raw_command(); | |
| 72 | 73 | check_broken_pipe_handled_gracefully(Binary::Rustc, rustc); |
| 73 | 74 | |
| 74 | let mut rustdoc = Command::new(env_var("RUSTDOC")); | |
| 75 | let mut rustdoc = rustdoc(); | |
| 75 | 76 | rustdoc.arg("--version"); |
| 77 | let rustdoc = rustdoc.into_raw_command(); | |
| 76 | 78 | check_broken_pipe_handled_gracefully(Binary::Rustdoc, rustdoc); |
| 77 | 79 | } |
tests/run-make/rustdoc-default-output/output-default.stdout+3-2| ... | ... | @@ -188,8 +188,9 @@ Options: |
| 188 | 188 | from provided path. Only use with --merge=finalize |
| 189 | 189 | --html-no-source |
| 190 | 190 | Disable HTML source code pages generation |
| 191 | --doctest-compilation-args add arguments to be used when compiling doctests | |
| 192 | ||
| 191 | --doctest-build-arg ARG | |
| 192 | One argument (of possibly many) to be used when | |
| 193 | compiling doctests | |
| 193 | 194 | --disable-minification |
| 194 | 195 | disable the minification of CSS/JS files |
| 195 | 196 | (perma-unstable, do not use with cached files) |
tests/rustdoc-ui/doctest/rustflags-multiple-args.rs+3-4| ... | ... | @@ -1,9 +1,8 @@ |
| 1 | // This test checks that the test behave when `--doctest-compilation-args` is passed | |
| 2 | // multiple times. | |
| 1 | // This test checks that the test behave when `--doctest-build-arg` is passed multiple times. | |
| 3 | 2 | |
| 4 | 3 | //@ check-pass |
| 5 | //@ compile-flags: --test -Zunstable-options --doctest-compilation-args=--cfg=testcase_must_be_present | |
| 6 | //@ compile-flags: --doctest-compilation-args=--cfg=another | |
| 4 | //@ compile-flags: --test -Zunstable-options --doctest-build-arg=--cfg=testcase_must_be_present | |
| 5 | //@ compile-flags: --doctest-build-arg=--cfg=another | |
| 7 | 6 | //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR" |
| 8 | 7 | //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" |
| 9 | 8 |
tests/rustdoc-ui/doctest/rustflags-multiple-args.stdout+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | |
| 2 | 2 | running 1 test |
| 3 | test $DIR/rustflags-multiple-args.rs - Bar (line 10) ... ok | |
| 3 | test $DIR/rustflags-multiple-args.rs - Bar (line 9) ... ok | |
| 4 | 4 | |
| 5 | 5 | test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME |
| 6 | 6 |
tests/rustdoc-ui/doctest/rustflags.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | //@ check-pass |
| 2 | //@ compile-flags: --test -Zunstable-options --doctest-compilation-args=--cfg=testcase_must_be_present | |
| 2 | //@ compile-flags: --test -Zunstable-options --doctest-build-arg=--cfg=testcase_must_be_present | |
| 3 | 3 | //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR" |
| 4 | 4 | //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" |
| 5 | 5 |
tests/ui/or-patterns/fn-param-wrap-parens.fixed+1-1| ... | ... | @@ -10,4 +10,4 @@ enum E { A, B } |
| 10 | 10 | use E::*; |
| 11 | 11 | |
| 12 | 12 | #[cfg(false)] |
| 13 | fn fun1((A | B): E) {} //~ ERROR top-level or-patterns are not allowed | |
| 13 | fn fun1((A | B): E) {} //~ ERROR function parameters require top-level or-patterns in parentheses |
tests/ui/or-patterns/fn-param-wrap-parens.rs+1-1| ... | ... | @@ -10,4 +10,4 @@ enum E { A, B } |
| 10 | 10 | use E::*; |
| 11 | 11 | |
| 12 | 12 | #[cfg(false)] |
| 13 | fn fun1(A | B: E) {} //~ ERROR top-level or-patterns are not allowed | |
| 13 | fn fun1(A | B: E) {} //~ ERROR function parameters require top-level or-patterns in parentheses |
tests/ui/or-patterns/fn-param-wrap-parens.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error: top-level or-patterns are not allowed in function parameters | |
| 1 | error: function parameters require top-level or-patterns in parentheses | |
| 2 | 2 | --> $DIR/fn-param-wrap-parens.rs:13:9 |
| 3 | 3 | | |
| 4 | 4 | LL | fn fun1(A | B: E) {} |
tests/ui/or-patterns/nested-undelimited-precedence.rs+5-5| ... | ... | @@ -17,7 +17,7 @@ fn foo() { |
| 17 | 17 | let b @ (A | B): E = A; |
| 18 | 18 | |
| 19 | 19 | let b @ A | B: E = A; //~ERROR `b` is not bound in all patterns |
| 20 | //~^ ERROR top-level or-patterns are not allowed | |
| 20 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | enum F { |
| ... | ... | @@ -32,13 +32,13 @@ fn bar() { |
| 32 | 32 | let (A(x) | B(x)): F = A(3); |
| 33 | 33 | |
| 34 | 34 | let &A(_) | B(_): F = A(3); //~ERROR mismatched types |
| 35 | //~^ ERROR top-level or-patterns are not allowed | |
| 35 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 36 | 36 | let &&A(_) | B(_): F = A(3); //~ERROR mismatched types |
| 37 | //~^ ERROR top-level or-patterns are not allowed | |
| 37 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 38 | 38 | let &mut A(_) | B(_): F = A(3); //~ERROR mismatched types |
| 39 | //~^ ERROR top-level or-patterns are not allowed | |
| 39 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 40 | 40 | let &&mut A(_) | B(_): F = A(3); //~ERROR mismatched types |
| 41 | //~^ ERROR top-level or-patterns are not allowed | |
| 41 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | fn main() {} |
tests/ui/or-patterns/nested-undelimited-precedence.stderr+5-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error: top-level or-patterns are not allowed in `let` bindings | |
| 1 | error: `let` bindings require top-level or-patterns in parentheses | |
| 2 | 2 | --> $DIR/nested-undelimited-precedence.rs:19:9 |
| 3 | 3 | | |
| 4 | 4 | LL | let b @ A | B: E = A; |
| ... | ... | @@ -9,7 +9,7 @@ help: wrap the pattern in parentheses |
| 9 | 9 | LL | let (b @ A | B): E = A; |
| 10 | 10 | | + + |
| 11 | 11 | |
| 12 | error: top-level or-patterns are not allowed in `let` bindings | |
| 12 | error: `let` bindings require top-level or-patterns in parentheses | |
| 13 | 13 | --> $DIR/nested-undelimited-precedence.rs:34:9 |
| 14 | 14 | | |
| 15 | 15 | LL | let &A(_) | B(_): F = A(3); |
| ... | ... | @@ -20,7 +20,7 @@ help: wrap the pattern in parentheses |
| 20 | 20 | LL | let (&A(_) | B(_)): F = A(3); |
| 21 | 21 | | + + |
| 22 | 22 | |
| 23 | error: top-level or-patterns are not allowed in `let` bindings | |
| 23 | error: `let` bindings require top-level or-patterns in parentheses | |
| 24 | 24 | --> $DIR/nested-undelimited-precedence.rs:36:9 |
| 25 | 25 | | |
| 26 | 26 | LL | let &&A(_) | B(_): F = A(3); |
| ... | ... | @@ -31,7 +31,7 @@ help: wrap the pattern in parentheses |
| 31 | 31 | LL | let (&&A(_) | B(_)): F = A(3); |
| 32 | 32 | | + + |
| 33 | 33 | |
| 34 | error: top-level or-patterns are not allowed in `let` bindings | |
| 34 | error: `let` bindings require top-level or-patterns in parentheses | |
| 35 | 35 | --> $DIR/nested-undelimited-precedence.rs:38:9 |
| 36 | 36 | | |
| 37 | 37 | LL | let &mut A(_) | B(_): F = A(3); |
| ... | ... | @@ -42,7 +42,7 @@ help: wrap the pattern in parentheses |
| 42 | 42 | LL | let (&mut A(_) | B(_)): F = A(3); |
| 43 | 43 | | + + |
| 44 | 44 | |
| 45 | error: top-level or-patterns are not allowed in `let` bindings | |
| 45 | error: `let` bindings require top-level or-patterns in parentheses | |
| 46 | 46 | --> $DIR/nested-undelimited-precedence.rs:40:9 |
| 47 | 47 | | |
| 48 | 48 | LL | let &&mut A(_) | B(_): F = A(3); |
tests/ui/or-patterns/or-patterns-syntactic-fail.rs+4-4| ... | ... | @@ -16,18 +16,18 @@ fn no_top_level_or_patterns() { |
| 16 | 16 | fn no_top_level_or_patterns_2() { |
| 17 | 17 | // ...and for now neither do we allow or-patterns at the top level of functions. |
| 18 | 18 | fn fun1(A | B: E) {} |
| 19 | //~^ ERROR top-level or-patterns are not allowed | |
| 19 | //~^ ERROR function parameters require top-level or-patterns in parentheses | |
| 20 | 20 | |
| 21 | 21 | fn fun2(| A | B: E) {} |
| 22 | //~^ ERROR top-level or-patterns are not allowed | |
| 22 | //~^ ERROR function parameters require top-level or-patterns in parentheses | |
| 23 | 23 | |
| 24 | 24 | // We don't allow top-level or-patterns before type annotation in let-statements because we |
| 25 | 25 | // want to reserve this syntactic space for possible future type ascription. |
| 26 | 26 | let A | B: E = A; |
| 27 | //~^ ERROR top-level or-patterns are not allowed | |
| 27 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 28 | 28 | |
| 29 | 29 | let | A | B: E = A; |
| 30 | //~^ ERROR top-level or-patterns are not allowed | |
| 30 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 31 | 31 | |
| 32 | 32 | let (A | B): E = A; // ok -- wrapped in parens |
| 33 | 33 | } |
tests/ui/or-patterns/or-patterns-syntactic-fail.stderr+4-4| ... | ... | @@ -11,7 +11,7 @@ help: you might have meant to open the body of the closure |
| 11 | 11 | LL | let _ = |A | { B: E| (); |
| 12 | 12 | | + |
| 13 | 13 | |
| 14 | error: top-level or-patterns are not allowed in function parameters | |
| 14 | error: function parameters require top-level or-patterns in parentheses | |
| 15 | 15 | --> $DIR/or-patterns-syntactic-fail.rs:18:13 |
| 16 | 16 | | |
| 17 | 17 | LL | fn fun1(A | B: E) {} |
| ... | ... | @@ -22,7 +22,7 @@ help: wrap the pattern in parentheses |
| 22 | 22 | LL | fn fun1((A | B): E) {} |
| 23 | 23 | | + + |
| 24 | 24 | |
| 25 | error: top-level or-patterns are not allowed in function parameters | |
| 25 | error: function parameters require top-level or-patterns in parentheses | |
| 26 | 26 | --> $DIR/or-patterns-syntactic-fail.rs:21:13 |
| 27 | 27 | | |
| 28 | 28 | LL | fn fun2(| A | B: E) {} |
| ... | ... | @@ -33,7 +33,7 @@ help: wrap the pattern in parentheses |
| 33 | 33 | LL | fn fun2((| A | B): E) {} |
| 34 | 34 | | + + |
| 35 | 35 | |
| 36 | error: top-level or-patterns are not allowed in `let` bindings | |
| 36 | error: `let` bindings require top-level or-patterns in parentheses | |
| 37 | 37 | --> $DIR/or-patterns-syntactic-fail.rs:26:9 |
| 38 | 38 | | |
| 39 | 39 | LL | let A | B: E = A; |
| ... | ... | @@ -44,7 +44,7 @@ help: wrap the pattern in parentheses |
| 44 | 44 | LL | let (A | B): E = A; |
| 45 | 45 | | + + |
| 46 | 46 | |
| 47 | error: top-level or-patterns are not allowed in `let` bindings | |
| 47 | error: `let` bindings require top-level or-patterns in parentheses | |
| 48 | 48 | --> $DIR/or-patterns-syntactic-fail.rs:29:9 |
| 49 | 49 | | |
| 50 | 50 | LL | let | A | B: E = A; |
tests/ui/or-patterns/remove-leading-vert.fixed+1-1| ... | ... | @@ -8,7 +8,7 @@ fn main() {} |
| 8 | 8 | |
| 9 | 9 | #[cfg(false)] |
| 10 | 10 | fn leading() { |
| 11 | fn fun1( A: E) {} //~ ERROR top-level or-patterns are not allowed | |
| 11 | fn fun1( A: E) {} //~ ERROR function parameters require top-level or-patterns in parentheses | |
| 12 | 12 | fn fun2( A: E) {} //~ ERROR unexpected `||` before function parameter |
| 13 | 13 | let ( | A): E; |
| 14 | 14 | let ( | A): (E); //~ ERROR unexpected token `||` in pattern |
tests/ui/or-patterns/remove-leading-vert.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ fn main() {} |
| 8 | 8 | |
| 9 | 9 | #[cfg(false)] |
| 10 | 10 | fn leading() { |
| 11 | fn fun1( | A: E) {} //~ ERROR top-level or-patterns are not allowed | |
| 11 | fn fun1( | A: E) {} //~ ERROR function parameters require top-level or-patterns in parentheses | |
| 12 | 12 | fn fun2( || A: E) {} //~ ERROR unexpected `||` before function parameter |
| 13 | 13 | let ( | A): E; |
| 14 | 14 | let ( || A): (E); //~ ERROR unexpected token `||` in pattern |
tests/ui/or-patterns/remove-leading-vert.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error: top-level or-patterns are not allowed in function parameters | |
| 1 | error: function parameters require top-level or-patterns in parentheses | |
| 2 | 2 | --> $DIR/remove-leading-vert.rs:11:14 |
| 3 | 3 | | |
| 4 | 4 | LL | fn fun1( | A: E) {} |
tests/ui/rfcs/rfc-0000-never_patterns/parse.rs+1-1| ... | ... | @@ -65,7 +65,7 @@ fn parse(x: Void) { |
| 65 | 65 | let res: Result<bool, Void> = Ok(false); |
| 66 | 66 | let Ok(_) = res; |
| 67 | 67 | let Ok(_) | Err(!) = &res; // Disallowed; see #82048. |
| 68 | //~^ ERROR top-level or-patterns are not allowed in `let` bindings | |
| 68 | //~^ ERROR `let` bindings require top-level or-patterns in parentheses | |
| 69 | 69 | let (Ok(_) | Err(!)) = &res; |
| 70 | 70 | let (Ok(_) | Err(&!)) = res.as_ref(); |
| 71 | 71 |
tests/ui/rfcs/rfc-0000-never_patterns/parse.stderr+1-1| ... | ... | @@ -26,7 +26,7 @@ error: expected one of `,`, `=>`, `if`, `|`, or `}`, found `<=` |
| 26 | 26 | LL | Some(!) <= |
| 27 | 27 | | ^^ expected one of `,`, `=>`, `if`, `|`, or `}` |
| 28 | 28 | |
| 29 | error: top-level or-patterns are not allowed in `let` bindings | |
| 29 | error: `let` bindings require top-level or-patterns in parentheses | |
| 30 | 30 | --> $DIR/parse.rs:67:9 |
| 31 | 31 | | |
| 32 | 32 | LL | let Ok(_) | Err(!) = &res; // Disallowed; see #82048. |
tests/ui/traits/const-traits/const-trait-impl-parameter-mismatch.rs created+32| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | // This test demonstrates an ICE that may occur when we try to resolve the instance | |
| 2 | // of a impl that has different generics than the trait it's implementing. This ensures | |
| 3 | // we first check that the args are compatible before resolving the body, just like | |
| 4 | // we do in projection before substituting a GAT. | |
| 5 | // | |
| 6 | // Regression test for issue #125877. | |
| 7 | ||
| 8 | //@ compile-flags: -Znext-solver | |
| 9 | ||
| 10 | #![feature(const_trait_impl, effects)] | |
| 11 | //~^ ERROR feature has been removed | |
| 12 | ||
| 13 | #[const_trait] | |
| 14 | trait Main { | |
| 15 | fn compute<T: ~const Aux>() -> u32; | |
| 16 | } | |
| 17 | ||
| 18 | impl const Main for () { | |
| 19 | fn compute<'x>() -> u32 { | |
| 20 | //~^ ERROR associated function `compute` has 0 type parameters but its trait declaration has 1 type parameter | |
| 21 | 0 | |
| 22 | } | |
| 23 | } | |
| 24 | ||
| 25 | #[const_trait] | |
| 26 | trait Aux {} | |
| 27 | ||
| 28 | impl const Aux for () {} | |
| 29 | ||
| 30 | fn main() { | |
| 31 | const _: u32 = <()>::compute::<()>(); | |
| 32 | } |
tests/ui/traits/const-traits/const-trait-impl-parameter-mismatch.stderr created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | error[E0557]: feature has been removed | |
| 2 | --> $DIR/const-trait-impl-parameter-mismatch.rs:10:30 | |
| 3 | | | |
| 4 | LL | #![feature(const_trait_impl, effects)] | |
| 5 | | ^^^^^^^ feature has been removed | |
| 6 | | | |
| 7 | = note: removed, redundant with `#![feature(const_trait_impl)]` | |
| 8 | ||
| 9 | error[E0049]: associated function `compute` has 0 type parameters but its trait declaration has 1 type parameter | |
| 10 | --> $DIR/const-trait-impl-parameter-mismatch.rs:19:16 | |
| 11 | | | |
| 12 | LL | fn compute<T: ~const Aux>() -> u32; | |
| 13 | | - expected 1 type parameter | |
| 14 | ... | |
| 15 | LL | fn compute<'x>() -> u32 { | |
| 16 | | ^^ found 0 type parameters | |
| 17 | ||
| 18 | error: aborting due to 2 previous errors | |
| 19 | ||
| 20 | Some errors have detailed explanations: E0049, E0557. | |
| 21 | For more information about an error, try `rustc --explain E0049`. |