From 529aae6fc368818bf64d21aab217826a6c0745fc Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:58:56 +0100 Subject: [PATCH 01/14] wasi/fs: Improve stopping condition for ::next When upgrading [Zed](https://github.com/zed-industries/zed/pull/19349) to Rust 1.82 I've encountered a test failure in our test suite. Specifically, one of our extension tests started hanging. I've tracked it down to a call to std::fs::remove_dir_all not returning when an extension is compiled with Rust 1.82 Our extension system uses WASM components, thus I've looked at the diff between 1.81 and 1.82 with respect to WASI and found 736f773844e7ebf05ccb827c17b7ad9eb28aa295 As it turned out, calling remove_dir_all from extension returned io::ErrorKind::NotFound in 1.81; the underlying issue is that the ReadDir iterator never actually terminates iteration, however since it loops around, with 1.81 we'd come across an entry second time and fail to remove it, since it would've been removed previously. With 1.82 and 736f773844e7ebf05ccb827c17b7ad9eb28aa295 it is no longer the case, thus we're seeing the hang. This commit makes ReadDir::next adhere to readdir contract, namely it will no longer call readdir once the returned # of bytes is smaller than the size of a passed-in buffer. Previously we'd only terminate the loop if readdir returned 0. --- library/std/src/sys/pal/wasi/fs.rs | 31 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/library/std/src/sys/pal/wasi/fs.rs b/library/std/src/sys/pal/wasi/fs.rs index 3296c762cca2b..b519a0fe6a3a4 100644 --- a/library/std/src/sys/pal/wasi/fs.rs +++ b/library/std/src/sys/pal/wasi/fs.rs @@ -172,20 +172,22 @@ impl Iterator for ReadDir { let offset = if self.offset == self.cap { let cookie = self.cookie.take()?; match self.inner.dir.fd.readdir(&mut self.buf, cookie) { - Ok(bytes) => self.cap = bytes, + Ok(bytes) => { + // No more entries if we read less than buffer size + if bytes < self.buf.len() { + self.cookie = None; + if bytes == 0 { + return None; + } + } else { + self.cookie = Some(cookie); + } + self.cap = self.buf.len(); + self.offset = 0; + 0 + } Err(e) => return Some(Err(e)), } - self.offset = 0; - self.cookie = Some(cookie); - - // If we didn't actually read anything, this is in theory the - // end of the directory. - if self.cap == 0 { - self.cookie = None; - return None; - } - - 0 } else { self.offset }; @@ -197,7 +199,6 @@ impl Iterator for ReadDir { // where we last left off. let dirent_size = mem::size_of::(); if data.len() < dirent_size { - assert!(self.cookie.is_some()); assert!(self.buf.len() >= dirent_size); self.offset = self.cap; continue; @@ -218,7 +219,9 @@ impl Iterator for ReadDir { self.offset = self.cap; continue; } - self.cookie = Some(dirent.d_next); + self.cookie.as_mut().map(|cookie| { + *cookie = dirent.d_next; + }); self.offset = offset + dirent_size + dirent.d_namlen as usize; let name = &data[..(dirent.d_namlen as usize)]; From 692c19ae8032f80fc75912b98651bfc841cfbaf0 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:45:17 +0100 Subject: [PATCH 02/14] Refactor ReadDir into a state machine --- library/std/src/sys/pal/wasi/fs.rs | 171 +++++++++++++++++------------ 1 file changed, 101 insertions(+), 70 deletions(-) diff --git a/library/std/src/sys/pal/wasi/fs.rs b/library/std/src/sys/pal/wasi/fs.rs index b519a0fe6a3a4..5c6ddfa559eca 100644 --- a/library/std/src/sys/pal/wasi/fs.rs +++ b/library/std/src/sys/pal/wasi/fs.rs @@ -27,10 +27,26 @@ pub struct FileAttr { pub struct ReadDir { inner: Arc, - cookie: Option, - buf: Vec, - offset: usize, - cap: usize, + state: ReadDirState, +} + +enum ReadDirState { + /// Next DirEntry should be read from contents of buf at `offset` + FillBuffer { + next_read_offset: wasi::Dircookie, + buf: Vec, + }, + ProcessEntry { + buf: Vec, + next_read_offset: Option, + offset: usize, + }, + /// Do not fetch any more entries, process all entries + RunUntilExhaustion { + buf: Vec, + offset: usize, + }, + Done, } struct ReadDirInner { @@ -147,11 +163,8 @@ impl FileType { impl ReadDir { fn new(dir: File, root: PathBuf) -> ReadDir { ReadDir { - cookie: Some(0), - buf: vec![0; 128], - offset: 0, - cap: 0, inner: Arc::new(ReadDirInner { dir, root }), + state: ReadDirState::FillBuffer { next_read_offset: 0, buf: vec![0; 128] }, } } } @@ -162,81 +175,99 @@ impl fmt::Debug for ReadDir { } } +impl core::iter::FusedIterator for ReadDir {} + impl Iterator for ReadDir { type Item = io::Result; fn next(&mut self) -> Option> { - loop { - // If we've reached the capacity of our buffer then we need to read - // some more from the OS, otherwise we pick up at our old offset. - let offset = if self.offset == self.cap { - let cookie = self.cookie.take()?; - match self.inner.dir.fd.readdir(&mut self.buf, cookie) { - Ok(bytes) => { - // No more entries if we read less than buffer size - if bytes < self.buf.len() { - self.cookie = None; - if bytes == 0 { - return None; - } + match &mut self.state { + ReadDirState::FillBuffer { next_read_offset, ref mut buf } => { + let result = self.inner.dir.fd.readdir(buf, *next_read_offset); + match result { + Ok(read_bytes) => { + if read_bytes < buf.len() { + buf.truncate(read_bytes); + self.state = + ReadDirState::RunUntilExhaustion { buf: mem::take(buf), offset: 0 }; } else { - self.cookie = Some(cookie); + debug_assert_eq!(read_bytes, buf.len()); + self.state = ReadDirState::ProcessEntry { + buf: mem::take(buf), + offset: 0, + next_read_offset: Some(*next_read_offset), + }; } - self.cap = self.buf.len(); - self.offset = 0; - 0 + self.next() + } + Err(e) => { + self.state = ReadDirState::Done; + return Some(Err(e)); } - Err(e) => return Some(Err(e)), - } - } else { - self.offset - }; - let data = &self.buf[offset..self.cap]; - - // If we're not able to read a directory entry then that means it - // must have been truncated at the end of the buffer, so reset our - // offset so we can go back and reread into the buffer, picking up - // where we last left off. - let dirent_size = mem::size_of::(); - if data.len() < dirent_size { - assert!(self.buf.len() >= dirent_size); - self.offset = self.cap; - continue; - } - let (dirent, data) = data.split_at(dirent_size); - let dirent = unsafe { ptr::read_unaligned(dirent.as_ptr() as *const wasi::Dirent) }; - - // If the file name was truncated, then we need to reinvoke - // `readdir` so we truncate our buffer to start over and reread this - // descriptor. Note that if our offset is 0 that means the file name - // is massive and we need a bigger buffer. - if data.len() < dirent.d_namlen as usize { - if offset == 0 { - let amt_to_add = self.buf.capacity(); - self.buf.extend(iter::repeat(0).take(amt_to_add)); } - assert!(self.cookie.is_some()); - self.offset = self.cap; - continue; } - self.cookie.as_mut().map(|cookie| { - *cookie = dirent.d_next; - }); - self.offset = offset + dirent_size + dirent.d_namlen as usize; + ReadDirState::ProcessEntry { ref mut buf, next_read_offset, offset } => { + let contents = &buf[*offset..]; + const DIRENT_SIZE: usize = crate::mem::size_of::(); + if contents.len() >= DIRENT_SIZE { + let (dirent, data) = contents.split_at(DIRENT_SIZE); + let dirent = + unsafe { ptr::read_unaligned(dirent.as_ptr() as *const wasi::Dirent) }; + // If the file name was truncated, then we need to reinvoke + // `readdir` so we truncate our buffer to start over and reread this + // descriptor. + if data.len() < dirent.d_namlen as usize { + if buf.len() < dirent.d_namlen as usize + DIRENT_SIZE { + buf.resize(dirent.d_namlen as usize + DIRENT_SIZE, 0); + } + if let Some(next_read_offset) = *next_read_offset { + self.state = + ReadDirState::FillBuffer { next_read_offset, buf: mem::take(buf) }; + } else { + self.state = ReadDirState::Done; + } + + return self.next(); + } + next_read_offset.as_mut().map(|cookie| { + *cookie = dirent.d_next; + }); + *offset = *offset + DIRENT_SIZE + dirent.d_namlen as usize; + + let name = &data[..(dirent.d_namlen as usize)]; - let name = &data[..(dirent.d_namlen as usize)]; + // These names are skipped on all other platforms, so let's skip + // them here too + if name == b"." || name == b".." { + return self.next(); + } - // These names are skipped on all other platforms, so let's skip - // them here too - if name == b"." || name == b".." { - continue; + return Some(Ok(DirEntry { + meta: dirent, + name: name.to_vec(), + inner: self.inner.clone(), + })); + } else if let Some(next_read_offset) = *next_read_offset { + self.state = ReadDirState::FillBuffer { next_read_offset, buf: mem::take(buf) }; + } else { + self.state = ReadDirState::Done; + } + self.next() } + ReadDirState::RunUntilExhaustion { buf, offset } => { + if *offset >= buf.len() { + self.state = ReadDirState::Done; + } else { + self.state = ReadDirState::ProcessEntry { + buf: mem::take(buf), + offset: *offset, + next_read_offset: None, + }; + } - return Some(Ok(DirEntry { - meta: dirent, - name: name.to_vec(), - inner: self.inner.clone(), - })); + self.next() + } + ReadDirState::Done => None, } } } From f4ab9829e1a3c6e564f79c98f39632aecbc675d3 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 26 Nov 2024 22:46:12 +0100 Subject: [PATCH 03/14] chore: Improve doc comments --- library/std/src/sys/pal/wasi/fs.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/std/src/sys/pal/wasi/fs.rs b/library/std/src/sys/pal/wasi/fs.rs index 5c6ddfa559eca..9e233436a8447 100644 --- a/library/std/src/sys/pal/wasi/fs.rs +++ b/library/std/src/sys/pal/wasi/fs.rs @@ -31,7 +31,7 @@ pub struct ReadDir { } enum ReadDirState { - /// Next DirEntry should be read from contents of buf at `offset` + /// Fill `buf` with `buf.len()` bytes starting from `next_read_offset`. FillBuffer { next_read_offset: wasi::Dircookie, buf: Vec, @@ -41,7 +41,8 @@ enum ReadDirState { next_read_offset: Option, offset: usize, }, - /// Do not fetch any more entries, process all entries + /// There is no more data to get in [`Self::FillBuffer`]; keep returning + /// entries via ProcessEntry until `buf` is exhausted. RunUntilExhaustion { buf: Vec, offset: usize, From 18f8657415da5ebc480e63abe03f87d4b4ce4157 Mon Sep 17 00:00:00 2001 From: Kai Luo Date: Thu, 8 Aug 2024 22:08:57 -0400 Subject: [PATCH 04/14] Pass -bnoipath when adding rust upstream dynamic crates --- compiler/rustc_codegen_ssa/src/back/link.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index ad81ff272c62f..b3bb32bedf4b3 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2753,6 +2753,13 @@ fn add_upstream_rust_crates( .find(|(ty, _)| *ty == crate_type) .expect("failed to find crate type in dependency format list"); + if sess.target.is_like_aix { + // Unlike GNU's ld, AIX linker doesn't feature `-soname=...` when output + // a shared library. Instead, AIX linker offers `(no)ipath`. See + // https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command. + cmd.link_or_cc_arg("-bnoipath"); + } + for &cnum in &codegen_results.crate_info.used_crates { // We may not pass all crates through to the linker. Some crates may appear statically in // an existing dylib, meaning we'll pick up all the symbols from the dylib. From 1ae1f8ce9cb327eaa22454bbf5a8e25123091ffb Mon Sep 17 00:00:00 2001 From: David Tenty Date: Fri, 6 Dec 2024 10:53:26 -0500 Subject: [PATCH 05/14] Clarify comment --- compiler/rustc_codegen_ssa/src/back/link.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index b3bb32bedf4b3..eb8f7cf6d407c 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2754,8 +2754,10 @@ fn add_upstream_rust_crates( .expect("failed to find crate type in dependency format list"); if sess.target.is_like_aix { - // Unlike GNU's ld, AIX linker doesn't feature `-soname=...` when output - // a shared library. Instead, AIX linker offers `(no)ipath`. See + // Unlike ELF linkers, AIX doesn't feature `DT_SONAME` to override + // the dependency name when outputing a shared library. Thus, `ld` will + // use the full path to shared libraries as the dependency if passed it + // by default unless `noipath` is passed. // https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command. cmd.link_or_cc_arg("-bnoipath"); } From 3109f07d855cd758aec574b009d339fe3e54cdb3 Mon Sep 17 00:00:00 2001 From: Xing Xue Date: Fri, 6 Dec 2024 12:51:59 -0500 Subject: [PATCH 06/14] Replace sa_sigaction with sa_union.__su_sigaction for AIX. --- .../auxiliary/assert-sigpipe-disposition.rs | 9 ++++++++- .../ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs | 9 ++++++++- tests/ui/runtime/signal-alternate-stack-cleanup.rs | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs b/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs index 117f6134b4e03..229408fb72474 100644 --- a/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs +++ b/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs @@ -25,7 +25,14 @@ fn start(argc: isize, argv: *const *const u8) -> isize { let actual = unsafe { let mut actual: libc::sigaction = std::mem::zeroed(); libc::sigaction(libc::SIGPIPE, std::ptr::null(), &mut actual); - actual.sa_sigaction + #[cfg(not(target_os = "aix"))] + { + actual.sa_sigaction + } + #[cfg(target_os = "aix")] + { + actual.sa_union.__su_sigaction as libc::sighandler_t + } }; assert_eq!(actual, expected, "actual and expected SIGPIPE disposition in child differs"); diff --git a/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs b/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs index 3d93d50ca3fbb..d16a2b4d8c8ab 100644 --- a/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs +++ b/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs @@ -20,7 +20,14 @@ pub fn assert_sigpipe_handler(expected_handler: SignalHandler) { let actual = unsafe { let mut actual: libc::sigaction = std::mem::zeroed(); libc::sigaction(libc::SIGPIPE, std::ptr::null(), &mut actual); - actual.sa_sigaction + #[cfg(not(target_os = "aix"))] + { + actual.sa_sigaction + } + #[cfg(target_os = "aix")] + { + actual.sa_union.__su_sigaction as libc::sighandler_t + } }; let expected = match expected_handler { diff --git a/tests/ui/runtime/signal-alternate-stack-cleanup.rs b/tests/ui/runtime/signal-alternate-stack-cleanup.rs index f2af86be0a5f5..8fce092827318 100644 --- a/tests/ui/runtime/signal-alternate-stack-cleanup.rs +++ b/tests/ui/runtime/signal-alternate-stack-cleanup.rs @@ -29,7 +29,14 @@ fn main() { // Install signal handler that runs on alternate signal stack. let mut action: sigaction = std::mem::zeroed(); action.sa_flags = (SA_ONSTACK | SA_SIGINFO) as _; - action.sa_sigaction = signal_handler as sighandler_t; + #[cfg(not(target_os = "aix"))] + { + action.sa_sigaction = signal_handler as sighandler_t; + } + #[cfg(target_os = "aix")] + { + action.sa_union.__su_sigaction = signal_handler as sighandler_t; + } sigaction(SIGWINCH, &action, std::ptr::null_mut()); // Send SIGWINCH on exit. From ab2ee7aa2f0eb8906b5d04104c93050e703b3936 Mon Sep 17 00:00:00 2001 From: Xing Xue Date: Fri, 6 Dec 2024 15:22:46 -0500 Subject: [PATCH 07/14] Use option "-sf" for the AIX "ln" command. --- tests/run-make/libs-through-symlinks/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/run-make/libs-through-symlinks/Makefile b/tests/run-make/libs-through-symlinks/Makefile index 592eae663a49a..c6ff566a0e86e 100644 --- a/tests/run-make/libs-through-symlinks/Makefile +++ b/tests/run-make/libs-through-symlinks/Makefile @@ -3,10 +3,20 @@ include ../tools.mk # ignore-windows +# The option -n for the AIX ln command has a different purpose than it does +# on Linux. On Linux, the -n option is used to treat the destination path as +# normal file if it is a symbolic link to a directory, which is the default +# behavior of the AIX ln command. +ifeq ($(UNAME),AIX) +LN_FLAGS := -sf +else +LN_FLAGS := -nsf +endif + NAME := $(shell $(RUSTC) --print file-names foo.rs) all: mkdir -p $(TMPDIR)/outdir $(RUSTC) foo.rs -o $(TMPDIR)/outdir/$(NAME) - ln -nsf outdir/$(NAME) $(TMPDIR) + ln $(LN_FLAGS) outdir/$(NAME) $(TMPDIR) RUSTC_LOG=rustc_metadata::loader $(RUSTC) bar.rs From f884f18151d63ac9ce7e573cadb165ecbe8d7f9b Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sat, 7 Dec 2024 12:35:19 +1100 Subject: [PATCH 08/14] Move tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs` --- .../empty-kind-1.rs | 0 .../empty-kind-1.stderr | 0 .../empty-kind-2.rs | 0 .../empty-kind-2.stderr | 0 .../link-arg-error.rs | 0 .../link-arg-error.stderr | 0 .../link-arg-from-rs.rs | 0 .../link-arg-from-rs.stderr | 0 tests/ui/{manual => link-native-libs}/manual-link-bad-form.rs | 0 tests/ui/{manual => link-native-libs}/manual-link-bad-form.stderr | 0 tests/ui/{manual => link-native-libs}/manual-link-bad-kind.rs | 0 tests/ui/{manual => link-native-libs}/manual-link-bad-kind.stderr | 0 .../{manual => link-native-libs}/manual-link-bad-search-path.rs | 0 .../manual-link-bad-search-path.stderr | 0 tests/ui/{manual => link-native-libs}/manual-link-framework.rs | 0 .../ui/{manual => link-native-libs}/manual-link-framework.stderr | 0 .../{manual => link-native-libs}/manual-link-unsupported-kind.rs | 0 .../manual-link-unsupported-kind.stderr | 0 .../modifiers-bad.blank.stderr | 0 .../modifiers-bad.no-prefix.stderr | 0 .../modifiers-bad.prefix-only.stderr | 0 .../modifiers-bad.rs | 0 .../modifiers-bad.unknown.stderr | 0 .../modifiers-override-2.rs | 0 .../modifiers-override-2.stderr | 0 .../modifiers-override-3.rs | 0 .../modifiers-override-3.stderr | 0 .../modifiers-override.rs | 0 .../modifiers-override.stderr | 0 .../msvc-non-utf8-output.rs | 0 .../msvc-non-utf8-output.stderr | 0 .../suggest-libname-only-1.rs | 0 .../suggest-libname-only-1.stderr | 0 .../suggest-libname-only-2.rs | 0 .../suggest-libname-only-2.stderr | 0 35 files changed, 0 insertions(+), 0 deletions(-) rename tests/ui/{native-library-link-flags => link-native-libs}/empty-kind-1.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/empty-kind-1.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/empty-kind-2.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/empty-kind-2.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/link-arg-error.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/link-arg-error.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/link-arg-from-rs.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/link-arg-from-rs.stderr (100%) rename tests/ui/{manual => link-native-libs}/manual-link-bad-form.rs (100%) rename tests/ui/{manual => link-native-libs}/manual-link-bad-form.stderr (100%) rename tests/ui/{manual => link-native-libs}/manual-link-bad-kind.rs (100%) rename tests/ui/{manual => link-native-libs}/manual-link-bad-kind.stderr (100%) rename tests/ui/{manual => link-native-libs}/manual-link-bad-search-path.rs (100%) rename tests/ui/{manual => link-native-libs}/manual-link-bad-search-path.stderr (100%) rename tests/ui/{manual => link-native-libs}/manual-link-framework.rs (100%) rename tests/ui/{manual => link-native-libs}/manual-link-framework.stderr (100%) rename tests/ui/{manual => link-native-libs}/manual-link-unsupported-kind.rs (100%) rename tests/ui/{manual => link-native-libs}/manual-link-unsupported-kind.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-bad.blank.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-bad.no-prefix.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-bad.prefix-only.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-bad.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-bad.unknown.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-override-2.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-override-2.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-override-3.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-override-3.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-override.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/modifiers-override.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/msvc-non-utf8-output.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/msvc-non-utf8-output.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/suggest-libname-only-1.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/suggest-libname-only-1.stderr (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/suggest-libname-only-2.rs (100%) rename tests/ui/{native-library-link-flags => link-native-libs}/suggest-libname-only-2.stderr (100%) diff --git a/tests/ui/native-library-link-flags/empty-kind-1.rs b/tests/ui/link-native-libs/empty-kind-1.rs similarity index 100% rename from tests/ui/native-library-link-flags/empty-kind-1.rs rename to tests/ui/link-native-libs/empty-kind-1.rs diff --git a/tests/ui/native-library-link-flags/empty-kind-1.stderr b/tests/ui/link-native-libs/empty-kind-1.stderr similarity index 100% rename from tests/ui/native-library-link-flags/empty-kind-1.stderr rename to tests/ui/link-native-libs/empty-kind-1.stderr diff --git a/tests/ui/native-library-link-flags/empty-kind-2.rs b/tests/ui/link-native-libs/empty-kind-2.rs similarity index 100% rename from tests/ui/native-library-link-flags/empty-kind-2.rs rename to tests/ui/link-native-libs/empty-kind-2.rs diff --git a/tests/ui/native-library-link-flags/empty-kind-2.stderr b/tests/ui/link-native-libs/empty-kind-2.stderr similarity index 100% rename from tests/ui/native-library-link-flags/empty-kind-2.stderr rename to tests/ui/link-native-libs/empty-kind-2.stderr diff --git a/tests/ui/native-library-link-flags/link-arg-error.rs b/tests/ui/link-native-libs/link-arg-error.rs similarity index 100% rename from tests/ui/native-library-link-flags/link-arg-error.rs rename to tests/ui/link-native-libs/link-arg-error.rs diff --git a/tests/ui/native-library-link-flags/link-arg-error.stderr b/tests/ui/link-native-libs/link-arg-error.stderr similarity index 100% rename from tests/ui/native-library-link-flags/link-arg-error.stderr rename to tests/ui/link-native-libs/link-arg-error.stderr diff --git a/tests/ui/native-library-link-flags/link-arg-from-rs.rs b/tests/ui/link-native-libs/link-arg-from-rs.rs similarity index 100% rename from tests/ui/native-library-link-flags/link-arg-from-rs.rs rename to tests/ui/link-native-libs/link-arg-from-rs.rs diff --git a/tests/ui/native-library-link-flags/link-arg-from-rs.stderr b/tests/ui/link-native-libs/link-arg-from-rs.stderr similarity index 100% rename from tests/ui/native-library-link-flags/link-arg-from-rs.stderr rename to tests/ui/link-native-libs/link-arg-from-rs.stderr diff --git a/tests/ui/manual/manual-link-bad-form.rs b/tests/ui/link-native-libs/manual-link-bad-form.rs similarity index 100% rename from tests/ui/manual/manual-link-bad-form.rs rename to tests/ui/link-native-libs/manual-link-bad-form.rs diff --git a/tests/ui/manual/manual-link-bad-form.stderr b/tests/ui/link-native-libs/manual-link-bad-form.stderr similarity index 100% rename from tests/ui/manual/manual-link-bad-form.stderr rename to tests/ui/link-native-libs/manual-link-bad-form.stderr diff --git a/tests/ui/manual/manual-link-bad-kind.rs b/tests/ui/link-native-libs/manual-link-bad-kind.rs similarity index 100% rename from tests/ui/manual/manual-link-bad-kind.rs rename to tests/ui/link-native-libs/manual-link-bad-kind.rs diff --git a/tests/ui/manual/manual-link-bad-kind.stderr b/tests/ui/link-native-libs/manual-link-bad-kind.stderr similarity index 100% rename from tests/ui/manual/manual-link-bad-kind.stderr rename to tests/ui/link-native-libs/manual-link-bad-kind.stderr diff --git a/tests/ui/manual/manual-link-bad-search-path.rs b/tests/ui/link-native-libs/manual-link-bad-search-path.rs similarity index 100% rename from tests/ui/manual/manual-link-bad-search-path.rs rename to tests/ui/link-native-libs/manual-link-bad-search-path.rs diff --git a/tests/ui/manual/manual-link-bad-search-path.stderr b/tests/ui/link-native-libs/manual-link-bad-search-path.stderr similarity index 100% rename from tests/ui/manual/manual-link-bad-search-path.stderr rename to tests/ui/link-native-libs/manual-link-bad-search-path.stderr diff --git a/tests/ui/manual/manual-link-framework.rs b/tests/ui/link-native-libs/manual-link-framework.rs similarity index 100% rename from tests/ui/manual/manual-link-framework.rs rename to tests/ui/link-native-libs/manual-link-framework.rs diff --git a/tests/ui/manual/manual-link-framework.stderr b/tests/ui/link-native-libs/manual-link-framework.stderr similarity index 100% rename from tests/ui/manual/manual-link-framework.stderr rename to tests/ui/link-native-libs/manual-link-framework.stderr diff --git a/tests/ui/manual/manual-link-unsupported-kind.rs b/tests/ui/link-native-libs/manual-link-unsupported-kind.rs similarity index 100% rename from tests/ui/manual/manual-link-unsupported-kind.rs rename to tests/ui/link-native-libs/manual-link-unsupported-kind.rs diff --git a/tests/ui/manual/manual-link-unsupported-kind.stderr b/tests/ui/link-native-libs/manual-link-unsupported-kind.stderr similarity index 100% rename from tests/ui/manual/manual-link-unsupported-kind.stderr rename to tests/ui/link-native-libs/manual-link-unsupported-kind.stderr diff --git a/tests/ui/native-library-link-flags/modifiers-bad.blank.stderr b/tests/ui/link-native-libs/modifiers-bad.blank.stderr similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-bad.blank.stderr rename to tests/ui/link-native-libs/modifiers-bad.blank.stderr diff --git a/tests/ui/native-library-link-flags/modifiers-bad.no-prefix.stderr b/tests/ui/link-native-libs/modifiers-bad.no-prefix.stderr similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-bad.no-prefix.stderr rename to tests/ui/link-native-libs/modifiers-bad.no-prefix.stderr diff --git a/tests/ui/native-library-link-flags/modifiers-bad.prefix-only.stderr b/tests/ui/link-native-libs/modifiers-bad.prefix-only.stderr similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-bad.prefix-only.stderr rename to tests/ui/link-native-libs/modifiers-bad.prefix-only.stderr diff --git a/tests/ui/native-library-link-flags/modifiers-bad.rs b/tests/ui/link-native-libs/modifiers-bad.rs similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-bad.rs rename to tests/ui/link-native-libs/modifiers-bad.rs diff --git a/tests/ui/native-library-link-flags/modifiers-bad.unknown.stderr b/tests/ui/link-native-libs/modifiers-bad.unknown.stderr similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-bad.unknown.stderr rename to tests/ui/link-native-libs/modifiers-bad.unknown.stderr diff --git a/tests/ui/native-library-link-flags/modifiers-override-2.rs b/tests/ui/link-native-libs/modifiers-override-2.rs similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-override-2.rs rename to tests/ui/link-native-libs/modifiers-override-2.rs diff --git a/tests/ui/native-library-link-flags/modifiers-override-2.stderr b/tests/ui/link-native-libs/modifiers-override-2.stderr similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-override-2.stderr rename to tests/ui/link-native-libs/modifiers-override-2.stderr diff --git a/tests/ui/native-library-link-flags/modifiers-override-3.rs b/tests/ui/link-native-libs/modifiers-override-3.rs similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-override-3.rs rename to tests/ui/link-native-libs/modifiers-override-3.rs diff --git a/tests/ui/native-library-link-flags/modifiers-override-3.stderr b/tests/ui/link-native-libs/modifiers-override-3.stderr similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-override-3.stderr rename to tests/ui/link-native-libs/modifiers-override-3.stderr diff --git a/tests/ui/native-library-link-flags/modifiers-override.rs b/tests/ui/link-native-libs/modifiers-override.rs similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-override.rs rename to tests/ui/link-native-libs/modifiers-override.rs diff --git a/tests/ui/native-library-link-flags/modifiers-override.stderr b/tests/ui/link-native-libs/modifiers-override.stderr similarity index 100% rename from tests/ui/native-library-link-flags/modifiers-override.stderr rename to tests/ui/link-native-libs/modifiers-override.stderr diff --git a/tests/ui/native-library-link-flags/msvc-non-utf8-output.rs b/tests/ui/link-native-libs/msvc-non-utf8-output.rs similarity index 100% rename from tests/ui/native-library-link-flags/msvc-non-utf8-output.rs rename to tests/ui/link-native-libs/msvc-non-utf8-output.rs diff --git a/tests/ui/native-library-link-flags/msvc-non-utf8-output.stderr b/tests/ui/link-native-libs/msvc-non-utf8-output.stderr similarity index 100% rename from tests/ui/native-library-link-flags/msvc-non-utf8-output.stderr rename to tests/ui/link-native-libs/msvc-non-utf8-output.stderr diff --git a/tests/ui/native-library-link-flags/suggest-libname-only-1.rs b/tests/ui/link-native-libs/suggest-libname-only-1.rs similarity index 100% rename from tests/ui/native-library-link-flags/suggest-libname-only-1.rs rename to tests/ui/link-native-libs/suggest-libname-only-1.rs diff --git a/tests/ui/native-library-link-flags/suggest-libname-only-1.stderr b/tests/ui/link-native-libs/suggest-libname-only-1.stderr similarity index 100% rename from tests/ui/native-library-link-flags/suggest-libname-only-1.stderr rename to tests/ui/link-native-libs/suggest-libname-only-1.stderr diff --git a/tests/ui/native-library-link-flags/suggest-libname-only-2.rs b/tests/ui/link-native-libs/suggest-libname-only-2.rs similarity index 100% rename from tests/ui/native-library-link-flags/suggest-libname-only-2.rs rename to tests/ui/link-native-libs/suggest-libname-only-2.rs diff --git a/tests/ui/native-library-link-flags/suggest-libname-only-2.stderr b/tests/ui/link-native-libs/suggest-libname-only-2.stderr similarity index 100% rename from tests/ui/native-library-link-flags/suggest-libname-only-2.stderr rename to tests/ui/link-native-libs/suggest-libname-only-2.stderr From 0a48b96859d3d66138082ffad6a1057b54cd55c7 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sat, 7 Dec 2024 12:35:30 +1100 Subject: [PATCH 09/14] Move more tests into `tests/ui/link-native-libs` --- src/tools/tidy/src/issues.txt | 10 +++++----- src/tools/tidy/src/ui_tests.rs | 2 +- .../auxiliary/link-cfg-works-transitive-dylib.rs | 0 .../auxiliary/link-cfg-works-transitive-rlib.rs | 0 .../{linkage-attr => link-native-libs}/issue-109144.rs | 0 .../issue-109144.stderr | 0 tests/ui/{issues => link-native-libs}/issue-43925.rs | 0 .../ui/{issues => link-native-libs}/issue-43925.stderr | 0 tests/ui/{issues => link-native-libs}/issue-43926.rs | 0 .../ui/{issues => link-native-libs}/issue-43926.stderr | 0 .../issue-70093/issue-70093-link-directives.rs | 0 .../issue-70093/issue-70093.rs | 0 .../kind-framework.rs | 0 .../kind-framework.stderr | 0 .../link-attr-validation-early.rs | 0 .../link-attr-validation-early.stderr | 0 .../link-attr-validation-late.rs | 0 .../link-attr-validation-late.stderr | 0 .../link-cfg-works.rs | 0 .../uikit-framework.rs | 0 20 files changed, 6 insertions(+), 6 deletions(-) rename tests/ui/{linkage-attr => link-native-libs}/auxiliary/link-cfg-works-transitive-dylib.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/auxiliary/link-cfg-works-transitive-rlib.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/issue-109144.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/issue-109144.stderr (100%) rename tests/ui/{issues => link-native-libs}/issue-43925.rs (100%) rename tests/ui/{issues => link-native-libs}/issue-43925.stderr (100%) rename tests/ui/{issues => link-native-libs}/issue-43926.rs (100%) rename tests/ui/{issues => link-native-libs}/issue-43926.stderr (100%) rename tests/ui/{issues => link-native-libs}/issue-70093/issue-70093-link-directives.rs (100%) rename tests/ui/{issues => link-native-libs}/issue-70093/issue-70093.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/kind-framework.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/kind-framework.stderr (100%) rename tests/ui/{linkage-attr => link-native-libs}/link-attr-validation-early.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/link-attr-validation-early.stderr (100%) rename tests/ui/{linkage-attr => link-native-libs}/link-attr-validation-late.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/link-attr-validation-late.stderr (100%) rename tests/ui/{linkage-attr => link-native-libs}/link-cfg-works.rs (100%) rename tests/ui/{linkage-attr => link-native-libs}/uikit-framework.rs (100%) diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index ac82a17e1459f..4088b2de2cdbd 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -2297,8 +2297,6 @@ ui/issues/issue-43853.rs ui/issues/issue-4387.rs ui/issues/issue-43910.rs ui/issues/issue-43923.rs -ui/issues/issue-43925.rs -ui/issues/issue-43926.rs ui/issues/issue-43988.rs ui/issues/issue-44023.rs ui/issues/issue-44056.rs @@ -2547,8 +2545,6 @@ ui/issues/issue-6936.rs ui/issues/issue-69455.rs ui/issues/issue-69602-type-err-during-codegen-ice.rs ui/issues/issue-69683.rs -ui/issues/issue-70093/issue-70093-link-directives.rs -ui/issues/issue-70093/issue-70093.rs ui/issues/issue-7012.rs ui/issues/issue-70381.rs ui/issues/issue-7044.rs @@ -2713,11 +2709,15 @@ ui/limits/issue-17913.rs ui/limits/issue-55878.rs ui/limits/issue-69485-var-size-diffs-too-large.rs ui/limits/issue-75158-64.rs +ui/link-native-libs/issue-109144.rs +ui/link-native-libs/issue-43925.rs +ui/link-native-libs/issue-43926.rs +ui/link-native-libs/issue-70093/issue-70093-link-directives.rs +ui/link-native-libs/issue-70093/issue-70093.rs ui/linkage-attr/auxiliary/issue-12133-dylib.rs ui/linkage-attr/auxiliary/issue-12133-dylib2.rs ui/linkage-attr/auxiliary/issue-12133-rlib.rs ui/linkage-attr/issue-10755.rs -ui/linkage-attr/issue-109144.rs ui/linkage-attr/issue-12133-1.rs ui/linkage-attr/issue-12133-2.rs ui/linkage-attr/issue-12133-3.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 11f9d5bb03df7..401169c838f71 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -17,7 +17,7 @@ use ignore::Walk; const ENTRY_LIMIT: u32 = 901; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1672; +const ISSUES_ENTRY_LIMIT: u32 = 1667; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/ui/linkage-attr/auxiliary/link-cfg-works-transitive-dylib.rs b/tests/ui/link-native-libs/auxiliary/link-cfg-works-transitive-dylib.rs similarity index 100% rename from tests/ui/linkage-attr/auxiliary/link-cfg-works-transitive-dylib.rs rename to tests/ui/link-native-libs/auxiliary/link-cfg-works-transitive-dylib.rs diff --git a/tests/ui/linkage-attr/auxiliary/link-cfg-works-transitive-rlib.rs b/tests/ui/link-native-libs/auxiliary/link-cfg-works-transitive-rlib.rs similarity index 100% rename from tests/ui/linkage-attr/auxiliary/link-cfg-works-transitive-rlib.rs rename to tests/ui/link-native-libs/auxiliary/link-cfg-works-transitive-rlib.rs diff --git a/tests/ui/linkage-attr/issue-109144.rs b/tests/ui/link-native-libs/issue-109144.rs similarity index 100% rename from tests/ui/linkage-attr/issue-109144.rs rename to tests/ui/link-native-libs/issue-109144.rs diff --git a/tests/ui/linkage-attr/issue-109144.stderr b/tests/ui/link-native-libs/issue-109144.stderr similarity index 100% rename from tests/ui/linkage-attr/issue-109144.stderr rename to tests/ui/link-native-libs/issue-109144.stderr diff --git a/tests/ui/issues/issue-43925.rs b/tests/ui/link-native-libs/issue-43925.rs similarity index 100% rename from tests/ui/issues/issue-43925.rs rename to tests/ui/link-native-libs/issue-43925.rs diff --git a/tests/ui/issues/issue-43925.stderr b/tests/ui/link-native-libs/issue-43925.stderr similarity index 100% rename from tests/ui/issues/issue-43925.stderr rename to tests/ui/link-native-libs/issue-43925.stderr diff --git a/tests/ui/issues/issue-43926.rs b/tests/ui/link-native-libs/issue-43926.rs similarity index 100% rename from tests/ui/issues/issue-43926.rs rename to tests/ui/link-native-libs/issue-43926.rs diff --git a/tests/ui/issues/issue-43926.stderr b/tests/ui/link-native-libs/issue-43926.stderr similarity index 100% rename from tests/ui/issues/issue-43926.stderr rename to tests/ui/link-native-libs/issue-43926.stderr diff --git a/tests/ui/issues/issue-70093/issue-70093-link-directives.rs b/tests/ui/link-native-libs/issue-70093/issue-70093-link-directives.rs similarity index 100% rename from tests/ui/issues/issue-70093/issue-70093-link-directives.rs rename to tests/ui/link-native-libs/issue-70093/issue-70093-link-directives.rs diff --git a/tests/ui/issues/issue-70093/issue-70093.rs b/tests/ui/link-native-libs/issue-70093/issue-70093.rs similarity index 100% rename from tests/ui/issues/issue-70093/issue-70093.rs rename to tests/ui/link-native-libs/issue-70093/issue-70093.rs diff --git a/tests/ui/linkage-attr/kind-framework.rs b/tests/ui/link-native-libs/kind-framework.rs similarity index 100% rename from tests/ui/linkage-attr/kind-framework.rs rename to tests/ui/link-native-libs/kind-framework.rs diff --git a/tests/ui/linkage-attr/kind-framework.stderr b/tests/ui/link-native-libs/kind-framework.stderr similarity index 100% rename from tests/ui/linkage-attr/kind-framework.stderr rename to tests/ui/link-native-libs/kind-framework.stderr diff --git a/tests/ui/linkage-attr/link-attr-validation-early.rs b/tests/ui/link-native-libs/link-attr-validation-early.rs similarity index 100% rename from tests/ui/linkage-attr/link-attr-validation-early.rs rename to tests/ui/link-native-libs/link-attr-validation-early.rs diff --git a/tests/ui/linkage-attr/link-attr-validation-early.stderr b/tests/ui/link-native-libs/link-attr-validation-early.stderr similarity index 100% rename from tests/ui/linkage-attr/link-attr-validation-early.stderr rename to tests/ui/link-native-libs/link-attr-validation-early.stderr diff --git a/tests/ui/linkage-attr/link-attr-validation-late.rs b/tests/ui/link-native-libs/link-attr-validation-late.rs similarity index 100% rename from tests/ui/linkage-attr/link-attr-validation-late.rs rename to tests/ui/link-native-libs/link-attr-validation-late.rs diff --git a/tests/ui/linkage-attr/link-attr-validation-late.stderr b/tests/ui/link-native-libs/link-attr-validation-late.stderr similarity index 100% rename from tests/ui/linkage-attr/link-attr-validation-late.stderr rename to tests/ui/link-native-libs/link-attr-validation-late.stderr diff --git a/tests/ui/linkage-attr/link-cfg-works.rs b/tests/ui/link-native-libs/link-cfg-works.rs similarity index 100% rename from tests/ui/linkage-attr/link-cfg-works.rs rename to tests/ui/link-native-libs/link-cfg-works.rs diff --git a/tests/ui/linkage-attr/uikit-framework.rs b/tests/ui/link-native-libs/uikit-framework.rs similarity index 100% rename from tests/ui/linkage-attr/uikit-framework.rs rename to tests/ui/link-native-libs/uikit-framework.rs From 88669aed22aeeef5fb7ecdb7f43ed33e674f8fcb Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 7 Dec 2024 23:54:10 +0000 Subject: [PATCH 10/14] Don't use AsyncFnOnce::CallOnceFuture bounds for signature deduction --- compiler/rustc_hir_typeck/src/closure.rs | 12 ++++-------- .../async-closures/call-once-deduction.rs | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 tests/ui/async-await/async-closures/call-once-deduction.rs diff --git a/compiler/rustc_hir_typeck/src/closure.rs b/compiler/rustc_hir_typeck/src/closure.rs index e715a7f7e1588..9037caf0066fe 100644 --- a/compiler/rustc_hir_typeck/src/closure.rs +++ b/compiler/rustc_hir_typeck/src/closure.rs @@ -454,20 +454,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { closure_kind: hir::ClosureKind, projection: ty::PolyProjectionPredicate<'tcx>, ) -> Option> { - let tcx = self.tcx; - - let trait_def_id = projection.trait_def_id(tcx); + let def_id = projection.projection_def_id(); // For now, we only do signature deduction based off of the `Fn` and `AsyncFn` traits, // for closures and async closures, respectively. match closure_kind { - hir::ClosureKind::Closure - if self.tcx.fn_trait_kind_from_def_id(trait_def_id).is_some() => - { + hir::ClosureKind::Closure if self.tcx.is_lang_item(def_id, LangItem::FnOnceOutput) => { self.extract_sig_from_projection(cause_span, projection) } hir::ClosureKind::CoroutineClosure(hir::CoroutineDesugaring::Async) - if self.tcx.async_fn_trait_kind_from_def_id(trait_def_id).is_some() => + if self.tcx.is_lang_item(def_id, LangItem::AsyncFnOnceOutput) => { self.extract_sig_from_projection(cause_span, projection) } @@ -475,7 +471,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // `F: FnOnce() -> Fut, Fut: Future` style bound. Let's still // guide inference here, since it's beneficial for the user. hir::ClosureKind::CoroutineClosure(hir::CoroutineDesugaring::Async) - if self.tcx.fn_trait_kind_from_def_id(trait_def_id).is_some() => + if self.tcx.is_lang_item(def_id, LangItem::FnOnceOutput) => { self.extract_sig_from_projection_and_future_bound(cause_span, projection) } diff --git a/tests/ui/async-await/async-closures/call-once-deduction.rs b/tests/ui/async-await/async-closures/call-once-deduction.rs new file mode 100644 index 0000000000000..41d92bc3d786c --- /dev/null +++ b/tests/ui/async-await/async-closures/call-once-deduction.rs @@ -0,0 +1,14 @@ +//@ edition: 2021 +//@ check-pass + +#![feature(async_closure, async_fn_traits, unboxed_closures)] + +fn bar(_: F) +where + F: AsyncFnOnce<(), CallOnceFuture = O>, +{ +} + +fn main() { + bar(async move || {}); +} From c4d7f1d29f05e9655e3827529ba4da3438e3e1fb Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sun, 8 Dec 2024 18:27:22 +0300 Subject: [PATCH 11/14] implement `TargetSelection::is_cygwin` function Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index b06147055f2a7..a07d1597746c2 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -565,6 +565,12 @@ impl TargetSelection { self.ends_with("windows-gnu") } + pub fn is_cygwin(&self) -> bool { + self.is_windows() && + // ref. https://cygwin.com/pipermail/cygwin/2022-February/250802.html + env::var("OSTYPE").is_ok_and(|v| v.to_lowercase().contains("cygwin")) + } + /// Path to the file defining the custom target, if any. pub fn filepath(&self) -> Option<&Path> { self.file.as_ref().map(Path::new) From d3b53408789ad749b027a1932459e22bc2685622 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sun, 8 Dec 2024 18:27:46 +0300 Subject: [PATCH 12/14] handle cygwin environments in `install::sanitize_sh` Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/install.rs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/install.rs b/src/bootstrap/src/core/build_steps/install.rs index 0ce86eadbce67..b6862c2d5c4a9 100644 --- a/src/bootstrap/src/core/build_steps/install.rs +++ b/src/bootstrap/src/core/build_steps/install.rs @@ -21,9 +21,9 @@ const SHELL: &str = "sh"; /// We have to run a few shell scripts, which choke quite a bit on both `\` /// characters and on `C:\` paths, so normalize both of them away. -fn sanitize_sh(path: &Path) -> String { +fn sanitize_sh(path: &Path, is_cygwin: bool) -> String { let path = path.to_str().unwrap().replace('\\', "/"); - return change_drive(unc_to_lfs(&path)).unwrap_or(path); + return if is_cygwin { path } else { change_drive(unc_to_lfs(&path)).unwrap_or(path) }; fn unc_to_lfs(s: &str) -> &str { s.strip_prefix("//?/").unwrap_or(s) @@ -71,6 +71,7 @@ fn install_sh( let prefix = default_path(&builder.config.prefix, "/usr/local"); let sysconfdir = prefix.join(default_path(&builder.config.sysconfdir, "/etc")); let destdir_env = env::var_os("DESTDIR").map(PathBuf::from); + let is_cygwin = builder.config.build.is_cygwin(); // Sanity checks on the write access of user. // @@ -103,14 +104,14 @@ fn install_sh( let mut cmd = command(SHELL); cmd.current_dir(&empty_dir) - .arg(sanitize_sh(&tarball.decompressed_output().join("install.sh"))) - .arg(format!("--prefix={}", prepare_dir(&destdir_env, prefix))) - .arg(format!("--sysconfdir={}", prepare_dir(&destdir_env, sysconfdir))) - .arg(format!("--datadir={}", prepare_dir(&destdir_env, datadir))) - .arg(format!("--docdir={}", prepare_dir(&destdir_env, docdir))) - .arg(format!("--bindir={}", prepare_dir(&destdir_env, bindir))) - .arg(format!("--libdir={}", prepare_dir(&destdir_env, libdir))) - .arg(format!("--mandir={}", prepare_dir(&destdir_env, mandir))) + .arg(sanitize_sh(&tarball.decompressed_output().join("install.sh"), is_cygwin)) + .arg(format!("--prefix={}", prepare_dir(&destdir_env, prefix, is_cygwin))) + .arg(format!("--sysconfdir={}", prepare_dir(&destdir_env, sysconfdir, is_cygwin))) + .arg(format!("--datadir={}", prepare_dir(&destdir_env, datadir, is_cygwin))) + .arg(format!("--docdir={}", prepare_dir(&destdir_env, docdir, is_cygwin))) + .arg(format!("--bindir={}", prepare_dir(&destdir_env, bindir, is_cygwin))) + .arg(format!("--libdir={}", prepare_dir(&destdir_env, libdir, is_cygwin))) + .arg(format!("--mandir={}", prepare_dir(&destdir_env, mandir, is_cygwin))) .arg("--disable-ldconfig"); cmd.run(builder); t!(fs::remove_dir_all(&empty_dir)); @@ -120,7 +121,7 @@ fn default_path(config: &Option, default: &str) -> PathBuf { config.as_ref().cloned().unwrap_or_else(|| PathBuf::from(default)) } -fn prepare_dir(destdir_env: &Option, mut path: PathBuf) -> String { +fn prepare_dir(destdir_env: &Option, mut path: PathBuf, is_cygwin: bool) -> String { // The DESTDIR environment variable is a standard way to install software in a subdirectory // while keeping the original directory structure, even if the prefix or other directories // contain absolute paths. @@ -146,7 +147,7 @@ fn prepare_dir(destdir_env: &Option, mut path: PathBuf) -> String { assert!(path.is_absolute(), "could not make the path relative"); } - sanitize_sh(&path) + sanitize_sh(&path, is_cygwin) } macro_rules! install { From 999aed4bff113924393ca55f3d6498d5c723f037 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 8 Dec 2024 21:39:48 -0700 Subject: [PATCH 13/14] Add URL to test cases --- tests/rustdoc-ui/issues/issue-101076.rs | 1 + tests/rustdoc-ui/issues/issue-102986.rs | 1 + tests/rustdoc-ui/issues/issue-103997.rs | 1 + tests/rustdoc-ui/issues/issue-105334.rs | 1 + tests/rustdoc-ui/issues/issue-105737.rs | 1 + tests/rustdoc-ui/issues/issue-105742.rs | 1 + tests/rustdoc-ui/issues/issue-106213.rs | 1 + tests/rustdoc-ui/issues/issue-107918.rs | 1 + tests/rustdoc-ui/issues/issue-110900.rs | 1 + 9 files changed, 9 insertions(+) diff --git a/tests/rustdoc-ui/issues/issue-101076.rs b/tests/rustdoc-ui/issues/issue-101076.rs index f9b93c408fd68..0c9a8b9175b3d 100644 --- a/tests/rustdoc-ui/issues/issue-101076.rs +++ b/tests/rustdoc-ui/issues/issue-101076.rs @@ -1,4 +1,5 @@ //@ check-pass +// https://github.com/rust-lang/rust/issues/101076 const _: () = { #[macro_export] diff --git a/tests/rustdoc-ui/issues/issue-102986.rs b/tests/rustdoc-ui/issues/issue-102986.rs index 001784ac28561..8fcbfffe17246 100644 --- a/tests/rustdoc-ui/issues/issue-102986.rs +++ b/tests/rustdoc-ui/issues/issue-102986.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/102986 struct Struct { y: (typeof("hey"),), //~^ `typeof` is a reserved keyword but unimplemented diff --git a/tests/rustdoc-ui/issues/issue-103997.rs b/tests/rustdoc-ui/issues/issue-103997.rs index ebd1d2e4447d8..b6ba4e48cffd6 100644 --- a/tests/rustdoc-ui/issues/issue-103997.rs +++ b/tests/rustdoc-ui/issues/issue-103997.rs @@ -1,4 +1,5 @@ //@ check-pass +// https://github.com/rust-lang/rust/issues/103997 pub fn foo() {} diff --git a/tests/rustdoc-ui/issues/issue-105334.rs b/tests/rustdoc-ui/issues/issue-105334.rs index ee1adc6a02914..f18f0456fdde8 100644 --- a/tests/rustdoc-ui/issues/issue-105334.rs +++ b/tests/rustdoc-ui/issues/issue-105334.rs @@ -1,2 +1,3 @@ +// https://github.com/rust-lang/rust/issues/105334 impl Vec< br##"*.."## > {} //~^ ERROR diff --git a/tests/rustdoc-ui/issues/issue-105737.rs b/tests/rustdoc-ui/issues/issue-105737.rs index 154f069d8ffac..651fd9ab4b8b3 100644 --- a/tests/rustdoc-ui/issues/issue-105737.rs +++ b/tests/rustdoc-ui/issues/issue-105737.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/105737 impl Vec {} //~^ ERROR diff --git a/tests/rustdoc-ui/issues/issue-105742.rs b/tests/rustdoc-ui/issues/issue-105742.rs index bd8ec4e8b589e..027574923c7ad 100644 --- a/tests/rustdoc-ui/issues/issue-105742.rs +++ b/tests/rustdoc-ui/issues/issue-105742.rs @@ -1,4 +1,5 @@ //@ compile-flags: -Znormalize-docs +// https://github.com/rust-lang/rust/issues/105742 use std::ops::Index; pub fn next<'a, T>(s: &'a mut dyn SVec) { diff --git a/tests/rustdoc-ui/issues/issue-106213.rs b/tests/rustdoc-ui/issues/issue-106213.rs index 5c3a83902523f..c954162589d9e 100644 --- a/tests/rustdoc-ui/issues/issue-106213.rs +++ b/tests/rustdoc-ui/issues/issue-106213.rs @@ -1,5 +1,6 @@ //@ compile-flags: --document-private-items //@ edition:2021 +// https://github.com/rust-lang/rust/issues/106213 fn use_avx() -> dyn { //~^ ERROR at least one trait is required for an object type diff --git a/tests/rustdoc-ui/issues/issue-107918.rs b/tests/rustdoc-ui/issues/issue-107918.rs index 19d53f84cb66e..ec35b52e33b0d 100644 --- a/tests/rustdoc-ui/issues/issue-107918.rs +++ b/tests/rustdoc-ui/issues/issue-107918.rs @@ -2,6 +2,7 @@ //@ compile-flags: --document-private-items //@ build-pass //@ only-linux +// https://github.com/rust-lang/rust/issues/107918 #![no_std] #![no_main] diff --git a/tests/rustdoc-ui/issues/issue-110900.rs b/tests/rustdoc-ui/issues/issue-110900.rs index 5a8961670833f..4fa60f8878d1d 100644 --- a/tests/rustdoc-ui/issues/issue-110900.rs +++ b/tests/rustdoc-ui/issues/issue-110900.rs @@ -1,4 +1,5 @@ //@ check-pass +// https://github.com/rust-lang/rust/issues/110900 #![crate_type="lib"] From b5318549c701771bde8b06709a69d7e3eb860c1f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 8 Dec 2024 21:59:23 -0700 Subject: [PATCH 14/14] rustdoc: rename `issue-\d+.rs` tests to have meaningful names --- ...7918.rs => duplicate-panic-impl-107918.rs} | 0 ...s => ice-associated-type-bounds-110900.rs} | 0 ...issue-106213.rs => ice-bare-dyn-106213.rs} | 0 ...6213.stderr => ice-bare-dyn-106213.stderr} | 2 +- ...42.rs => ice-generic-type-alias-105742.rs} | 0 ...r => ice-generic-type-alias-105742.stderr} | 148 +++++++++--------- ...05737.rs => ice-impl-fn-generic-105737.rs} | 0 ...derr => ice-impl-fn-generic-105737.stderr} | 2 +- ...cro-hidden-exported-macro-defid-101076.rs} | 0 ...s => ice-placeholder-type-alias-106226.rs} | 0 ... ice-placeholder-type-alias-106226.stderr} | 2 +- ...{issue-105334.rs => ice-raw-str-105334.rs} | 0 ...05334.stderr => ice-raw-str-105334.stderr} | 2 +- .../{issue-102986.rs => ice-typeof-102986.rs} | 0 ...102986.stderr => ice-typeof-102986.stderr} | 2 +- ...03997.rs => ice-unresolved-self-103997.rs} | 0 ...derr => ice-unresolved-self-103997.stderr} | 2 +- 17 files changed, 80 insertions(+), 80 deletions(-) rename tests/rustdoc-ui/issues/{issue-107918.rs => duplicate-panic-impl-107918.rs} (100%) rename tests/rustdoc-ui/issues/{issue-110900.rs => ice-associated-type-bounds-110900.rs} (100%) rename tests/rustdoc-ui/issues/{issue-106213.rs => ice-bare-dyn-106213.rs} (100%) rename tests/rustdoc-ui/issues/{issue-106213.stderr => ice-bare-dyn-106213.stderr} (85%) rename tests/rustdoc-ui/issues/{issue-105742.rs => ice-generic-type-alias-105742.rs} (100%) rename tests/rustdoc-ui/issues/{issue-105742.stderr => ice-generic-type-alias-105742.stderr} (84%) rename tests/rustdoc-ui/issues/{issue-105737.rs => ice-impl-fn-generic-105737.rs} (100%) rename tests/rustdoc-ui/issues/{issue-105737.stderr => ice-impl-fn-generic-105737.stderr} (87%) rename tests/rustdoc-ui/issues/{issue-101076.rs => ice-macro-hidden-exported-macro-defid-101076.rs} (100%) rename tests/rustdoc-ui/issues/{issue-106226.rs => ice-placeholder-type-alias-106226.rs} (100%) rename tests/rustdoc-ui/issues/{issue-106226.stderr => ice-placeholder-type-alias-106226.stderr} (84%) rename tests/rustdoc-ui/issues/{issue-105334.rs => ice-raw-str-105334.rs} (100%) rename tests/rustdoc-ui/issues/{issue-105334.stderr => ice-raw-str-105334.stderr} (85%) rename tests/rustdoc-ui/issues/{issue-102986.rs => ice-typeof-102986.rs} (100%) rename tests/rustdoc-ui/issues/{issue-102986.stderr => ice-typeof-102986.stderr} (90%) rename tests/rustdoc-ui/issues/{issue-103997.rs => ice-unresolved-self-103997.rs} (100%) rename tests/rustdoc-ui/issues/{issue-103997.stderr => ice-unresolved-self-103997.stderr} (83%) diff --git a/tests/rustdoc-ui/issues/issue-107918.rs b/tests/rustdoc-ui/issues/duplicate-panic-impl-107918.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-107918.rs rename to tests/rustdoc-ui/issues/duplicate-panic-impl-107918.rs diff --git a/tests/rustdoc-ui/issues/issue-110900.rs b/tests/rustdoc-ui/issues/ice-associated-type-bounds-110900.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-110900.rs rename to tests/rustdoc-ui/issues/ice-associated-type-bounds-110900.rs diff --git a/tests/rustdoc-ui/issues/issue-106213.rs b/tests/rustdoc-ui/issues/ice-bare-dyn-106213.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-106213.rs rename to tests/rustdoc-ui/issues/ice-bare-dyn-106213.rs diff --git a/tests/rustdoc-ui/issues/issue-106213.stderr b/tests/rustdoc-ui/issues/ice-bare-dyn-106213.stderr similarity index 85% rename from tests/rustdoc-ui/issues/issue-106213.stderr rename to tests/rustdoc-ui/issues/ice-bare-dyn-106213.stderr index fa79fe2e71c10..b029fee510ee9 100644 --- a/tests/rustdoc-ui/issues/issue-106213.stderr +++ b/tests/rustdoc-ui/issues/ice-bare-dyn-106213.stderr @@ -1,5 +1,5 @@ error[E0224]: at least one trait is required for an object type - --> $DIR/issue-106213.rs:4:17 + --> $DIR/ice-bare-dyn-106213.rs:5:17 | LL | fn use_avx() -> dyn { | ^^^ diff --git a/tests/rustdoc-ui/issues/issue-105742.rs b/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-105742.rs rename to tests/rustdoc-ui/issues/ice-generic-type-alias-105742.rs diff --git a/tests/rustdoc-ui/issues/issue-105742.stderr b/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.stderr similarity index 84% rename from tests/rustdoc-ui/issues/issue-105742.stderr rename to tests/rustdoc-ui/issues/ice-generic-type-alias-105742.stderr index 0f09d637f38fe..06a1cf6b118da 100644 --- a/tests/rustdoc-ui/issues/issue-105742.stderr +++ b/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -15,13 +15,13 @@ LL | ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -31,13 +31,13 @@ LL | ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -47,13 +47,13 @@ LL | Output = ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -63,13 +63,13 @@ LL | Output = ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -79,13 +79,13 @@ LL | Output = ::Item<'a>> as SVec>::Item, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -95,13 +95,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -111,13 +111,13 @@ LL | Output = ::Item> as SVec>::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -127,13 +127,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:4:40 + --> $DIR/ice-generic-type-alias-105742.rs:5:40 | LL | pub fn next<'a, T>(s: &'a mut dyn SVec) { | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -143,13 +143,13 @@ LL | pub fn next<'a, T>(s: &'a mut dyn SVec = T, Output = T>) { | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:4:40 + --> $DIR/ice-generic-type-alias-105742.rs:5:40 | LL | pub fn next<'a, T>(s: &'a mut dyn SVec) { | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -159,13 +159,13 @@ LL | pub fn next<'a, T>(s: &'a mut dyn SVec = T, Output = T>) { | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -176,13 +176,13 @@ LL | ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -193,13 +193,13 @@ LL | ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -210,13 +210,13 @@ LL | Output = ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -227,13 +227,13 @@ LL | Output = ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -244,13 +244,13 @@ LL | Output = ::Item<'a>> as SVec>::Item, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -261,13 +261,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -278,13 +278,13 @@ LL | Output = ::Item> as SVec>::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -295,13 +295,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0038]: the trait `SVec` cannot be made into an object - --> $DIR/issue-105742.rs:4:31 + --> $DIR/ice-generic-type-alias-105742.rs:5:31 | LL | pub fn next<'a, T>(s: &'a mut dyn SVec) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SVec` cannot be made into an object | note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/issue-105742.rs:14:17 + --> $DIR/ice-generic-type-alias-105742.rs:15:17 | LL | pub trait SVec: Index< | ____________----__^ @@ -329,13 +329,13 @@ LL | pub fn next<'a, T>(s: &'a mut impl SVec) { | ~~~~ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -346,13 +346,13 @@ LL | ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -363,13 +363,13 @@ LL | ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -380,13 +380,13 @@ LL | Output = ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -397,13 +397,13 @@ LL | Output = ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -414,13 +414,13 @@ LL | Output = ::Item<'a>> as SVec>::Item, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -431,13 +431,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -448,13 +448,13 @@ LL | Output = ::Item> as SVec>::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -465,13 +465,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -482,13 +482,13 @@ LL | ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:15:21 + --> $DIR/ice-generic-type-alias-105742.rs:16:21 | LL | ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -499,13 +499,13 @@ LL | ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -516,13 +516,13 @@ LL | Output = ::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:26:37 + --> $DIR/ice-generic-type-alias-105742.rs:27:37 | LL | Output = ::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -533,13 +533,13 @@ LL | Output = ::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -550,13 +550,13 @@ LL | Output = ::Item<'a>> as SVec>::Item, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:30 + --> $DIR/ice-generic-type-alias-105742.rs:38:30 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -567,13 +567,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -584,13 +584,13 @@ LL | Output = ::Item> as SVec>::Item<'a>, | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:37:46 + --> $DIR/ice-generic-type-alias-105742.rs:38:46 | LL | Output = ::Item> as SVec>::Item, | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - @@ -601,13 +601,13 @@ LL | Output = ::Item> as SVec>::Item, | +++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:61:38 + --> $DIR/ice-generic-type-alias-105742.rs:62:38 | LL | fn len(&self) -> ::Item; | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ -- @@ -617,13 +617,13 @@ LL | fn len(&self) -> ::Item<'_>; | ++++ error[E0107]: missing generics for associated type `SVec::Item` - --> $DIR/issue-105742.rs:61:38 + --> $DIR/ice-generic-type-alias-105742.rs:62:38 | LL | fn len(&self) -> ::Item; | ^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-105742.rs:59:10 + --> $DIR/ice-generic-type-alias-105742.rs:60:10 | LL | type Item<'a, T>; | ^^^^ - diff --git a/tests/rustdoc-ui/issues/issue-105737.rs b/tests/rustdoc-ui/issues/ice-impl-fn-generic-105737.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-105737.rs rename to tests/rustdoc-ui/issues/ice-impl-fn-generic-105737.rs diff --git a/tests/rustdoc-ui/issues/issue-105737.stderr b/tests/rustdoc-ui/issues/ice-impl-fn-generic-105737.stderr similarity index 87% rename from tests/rustdoc-ui/issues/issue-105737.stderr rename to tests/rustdoc-ui/issues/ice-impl-fn-generic-105737.stderr index 2c63c345e46a5..49cbebc91d982 100644 --- a/tests/rustdoc-ui/issues/issue-105737.stderr +++ b/tests/rustdoc-ui/issues/ice-impl-fn-generic-105737.stderr @@ -1,5 +1,5 @@ error[E0747]: constant provided when a type was expected - --> $DIR/issue-105737.rs:1:10 + --> $DIR/ice-impl-fn-generic-105737.rs:2:10 | LL | impl Vec {} | ^^^ diff --git a/tests/rustdoc-ui/issues/issue-101076.rs b/tests/rustdoc-ui/issues/ice-macro-hidden-exported-macro-defid-101076.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-101076.rs rename to tests/rustdoc-ui/issues/ice-macro-hidden-exported-macro-defid-101076.rs diff --git a/tests/rustdoc-ui/issues/issue-106226.rs b/tests/rustdoc-ui/issues/ice-placeholder-type-alias-106226.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-106226.rs rename to tests/rustdoc-ui/issues/ice-placeholder-type-alias-106226.rs diff --git a/tests/rustdoc-ui/issues/issue-106226.stderr b/tests/rustdoc-ui/issues/ice-placeholder-type-alias-106226.stderr similarity index 84% rename from tests/rustdoc-ui/issues/issue-106226.stderr rename to tests/rustdoc-ui/issues/ice-placeholder-type-alias-106226.stderr index 4d063b461883a..e90809254504e 100644 --- a/tests/rustdoc-ui/issues/issue-106226.stderr +++ b/tests/rustdoc-ui/issues/ice-placeholder-type-alias-106226.stderr @@ -1,5 +1,5 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases - --> $DIR/issue-106226.rs:2:11 + --> $DIR/ice-placeholder-type-alias-106226.rs:2:11 | LL | type F = [_; ()]; | ^ not allowed in type signatures diff --git a/tests/rustdoc-ui/issues/issue-105334.rs b/tests/rustdoc-ui/issues/ice-raw-str-105334.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-105334.rs rename to tests/rustdoc-ui/issues/ice-raw-str-105334.rs diff --git a/tests/rustdoc-ui/issues/issue-105334.stderr b/tests/rustdoc-ui/issues/ice-raw-str-105334.stderr similarity index 85% rename from tests/rustdoc-ui/issues/issue-105334.stderr rename to tests/rustdoc-ui/issues/ice-raw-str-105334.stderr index d992b219b3bc2..2096757fbb98e 100644 --- a/tests/rustdoc-ui/issues/issue-105334.stderr +++ b/tests/rustdoc-ui/issues/ice-raw-str-105334.stderr @@ -1,5 +1,5 @@ error[E0747]: constant provided when a type was expected - --> $DIR/issue-105334.rs:1:11 + --> $DIR/ice-raw-str-105334.rs:2:11 | LL | impl Vec< br##"*.."## > {} | ^^^^^^^^^^^ diff --git a/tests/rustdoc-ui/issues/issue-102986.rs b/tests/rustdoc-ui/issues/ice-typeof-102986.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-102986.rs rename to tests/rustdoc-ui/issues/ice-typeof-102986.rs diff --git a/tests/rustdoc-ui/issues/issue-102986.stderr b/tests/rustdoc-ui/issues/ice-typeof-102986.stderr similarity index 90% rename from tests/rustdoc-ui/issues/issue-102986.stderr rename to tests/rustdoc-ui/issues/ice-typeof-102986.stderr index d91f93f394a5b..20dbb2661bc2e 100644 --- a/tests/rustdoc-ui/issues/issue-102986.stderr +++ b/tests/rustdoc-ui/issues/ice-typeof-102986.stderr @@ -1,5 +1,5 @@ error[E0516]: `typeof` is a reserved keyword but unimplemented - --> $DIR/issue-102986.rs:2:9 + --> $DIR/ice-typeof-102986.rs:3:9 | LL | y: (typeof("hey"),), | ^^^^^^^^^^^^^ reserved keyword diff --git a/tests/rustdoc-ui/issues/issue-103997.rs b/tests/rustdoc-ui/issues/ice-unresolved-self-103997.rs similarity index 100% rename from tests/rustdoc-ui/issues/issue-103997.rs rename to tests/rustdoc-ui/issues/ice-unresolved-self-103997.rs diff --git a/tests/rustdoc-ui/issues/issue-103997.stderr b/tests/rustdoc-ui/issues/ice-unresolved-self-103997.stderr similarity index 83% rename from tests/rustdoc-ui/issues/issue-103997.stderr rename to tests/rustdoc-ui/issues/ice-unresolved-self-103997.stderr index c06db91496f86..9cb64079c618c 100644 --- a/tests/rustdoc-ui/issues/issue-103997.stderr +++ b/tests/rustdoc-ui/issues/ice-unresolved-self-103997.stderr @@ -1,5 +1,5 @@ warning: unresolved link to `Self::foo` - --> $DIR/issue-103997.rs:5:13 + --> $DIR/ice-unresolved-self-103997.rs:6:13 | LL | /// [`foo`](Self::foo) | ^^^^^^^^^ no item named `Self` in scope