Auto merge of #126284 - jieyouxu:rollup-nq7bf9k, r=jieyouxu

Rollup of 6 pull requests

Successful merges:

 - #115974 (Split core's PanicInfo and std's PanicInfo)
 - #125659 (Remove usage of `isize` in example)
 - #125669 (CI: Update riscv64gc-linux job to Ubuntu 22.04, rename to riscv64gc-gnu)
 - #125684 (Account for existing bindings when suggesting `pin!()`)
 - #126055 (Expand list of trait implementers in E0277 when calling rustc with --verbose)
 - #126174 (Migrate `tests/run-make/prefer-dylib` to `rmake.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-06-11 22:20:35 +00:00
commit ebcb862bbb
24 changed files with 521 additions and 350 deletions

View file

@ -1,9 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib -C prefer-dynamic
$(RUSTC) foo.rs -C prefer-dynamic
$(call RUN,foo)
rm $(TMPDIR)/*bar*
$(call FAIL,foo)

View file

@ -0,0 +1,16 @@
//@ ignore-cross-compile
use run_make_support::{cwd, dynamic_lib_name, read_dir, run, run_fail, rustc};
use std::fs::remove_file;
use std::process::Command;
fn main() {
rustc().input("bar.rs").crate_type("dylib").crate_type("rlib").arg("-Cprefer-dynamic").run();
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
run("foo");
remove_file(dynamic_lib_name("bar")).unwrap();
// This time the command should fail.
run_fail("foo");
}

View file

@ -0,0 +1,25 @@
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
struct FutureWrapper<F> {
fut: F,
}
impl<F> Future for FutureWrapper<F>
where
F: Future,
{
type Output = F::Output;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let res = self.fut.poll(cx);
//~^ ERROR no method named `poll` found for type parameter `F` in the current scope
res
}
}
fn main() {}

View file

@ -0,0 +1,18 @@
error[E0599]: no method named `poll` found for type parameter `F` in the current scope
--> $DIR/pin-needed-to-poll-3.rs:19:28
|
LL | impl<F> Future for FutureWrapper<F>
| - method `poll` not found for this type parameter
...
LL | let res = self.fut.poll(cx);
| ^^^^ method not found in `F`
|
help: consider pinning the expression
|
LL ~ let mut pinned = std::pin::pin!(self.fut);
LL ~ let res = pinned.as_mut().poll(cx);
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0599`.

View file

@ -5,7 +5,9 @@
#![feature(lang_items)]
use std::panic::PanicInfo;
extern crate core;
use core::panic::PanicInfo;
#[lang = "panic_impl"]
fn panic_impl(info: &PanicInfo) -> ! {

View file

@ -1,5 +1,5 @@
error[E0152]: found duplicate lang item `panic_impl`
--> $DIR/duplicate_entry_error.rs:11:1
--> $DIR/duplicate_entry_error.rs:13:1
|
LL | / fn panic_impl(info: &PanicInfo) -> ! {
LL | |

View file

@ -1,8 +1,9 @@
//@ normalize-stderr-test "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
//@ error-pattern: found duplicate lang item `panic_impl`
extern crate core;
use std::panic::PanicInfo;
use core::panic::PanicInfo;
#[panic_handler]
fn panic(info: PanicInfo) -> ! {

View file

@ -1,5 +1,5 @@
error[E0152]: found duplicate lang item `panic_impl`
--> $DIR/panic-handler-std.rs:8:1
--> $DIR/panic-handler-std.rs:9:1
|
LL | / fn panic(info: PanicInfo) -> ! {
LL | | loop {}