forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#125131 - jieyouxu:rollup-oqprchr, r=jieyouxu
Rollup of 5 pull requests Successful merges: - rust-lang#124746 (`rustc --explain E0582` additional example) - rust-lang#124975 (Use an helper to move the files) - rust-lang#125027 (Migrate `run-make/c-link-to-rust-staticlib` to `rmake`) - rust-lang#125084 (`rustc_hir_typeck`: Account for `skipped_ref_pats` in `expr_use_visitor`) - rust-lang#125104 (Migrate `run-make/no-cdylib-as-rdylib` to `rmake`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
13 changed files
with
146 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// This test checks that C linking with Rust does not encounter any errors, with a static library. | ||
// See https://github.com/rust-lang/rust/issues/10434 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib}; | ||
use std::fs; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
cc().input("bar.c") | ||
.input(static_lib("foo")) | ||
.out_exe("bar") | ||
.args(&extra_c_flags()) | ||
.run(); | ||
run("bar"); | ||
fs::remove_file(static_lib("foo")); | ||
run("bar"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This test produces an rlib and a cdylib from bar.rs. | ||
// Then, foo.rs attempts to link to the bar library. | ||
// If the test passes, that means rustc favored the rlib and ignored the cdylib. | ||
// If the test fails, that is because the cdylib was picked, which does not export | ||
// any Rust symbols. | ||
// See https://github.com/rust-lang/rust/pull/113695 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().input("bar.rs").crate_type("rlib").crate_type("cdylib").run(); | ||
rustc().input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
run("foo"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@ run-pass | ||
//@ edition: 2024 | ||
//@ compile-flags: -Zunstable-options | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(ref_pat_eat_one_layer_2024)] | ||
|
||
struct Foo; | ||
//~^ WARN struct `Foo` is never constructed | ||
|
||
fn main() { | ||
|| { | ||
//~^ WARN unused closure that must be used | ||
if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { | ||
let _: u32 = x; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
warning: struct `Foo` is never constructed | ||
--> $DIR/skipped-ref-pats-issue-125058.rs:8:8 | ||
| | ||
LL | struct Foo; | ||
| ^^^ | ||
| | ||
= note: `#[warn(dead_code)]` on by default | ||
|
||
warning: unused closure that must be used | ||
--> $DIR/skipped-ref-pats-issue-125058.rs:12:5 | ||
| | ||
LL | / || { | ||
LL | | | ||
LL | | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { | ||
LL | | let _: u32 = x; | ||
LL | | } | ||
LL | | }; | ||
| |_____^ | ||
| | ||
= note: closures are lazy and do nothing unless called | ||
= note: `#[warn(unused_must_use)]` on by default | ||
|
||
warning: 2 warnings emitted | ||
|