-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #112563 - matthiaskrgr:rollup-ebetrzi, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #112302 (Suggest using `ptr::null_mut` when user provided `ptr::null` to a function expecting `ptr::null_mut`) - #112416 (Fix debug ICE for extern type with where clauses) - #112527 (Add windows_sys type definitions for ARM32 manually) - #112546 (new solver: extend assert to other aliases) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
16 changed files
with
219 additions
and
10 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 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,20 @@ | ||
// Begin of ARM32 shim | ||
// The raw content of this file should be processed by `generate-windows-sys` | ||
// to be merged with the generated binding. It is not supposed to be used as | ||
// a normal Rust module. | ||
cfg_if::cfg_if! { | ||
if #[cfg(target_arch = "arm")] { | ||
#[repr(C)] | ||
pub struct WSADATA { | ||
pub wVersion: u16, | ||
pub wHighVersion: u16, | ||
pub szDescription: [u8; 257], | ||
pub szSystemStatus: [u8; 129], | ||
pub iMaxSockets: u16, | ||
pub iMaxUdpDg: u16, | ||
pub lpVendorInfo: PSTR, | ||
} | ||
pub enum CONTEXT {} | ||
} | ||
} | ||
// End of ARM32 shim |
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
10 changes: 10 additions & 0 deletions
10
tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs
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,10 @@ | ||
extern "C" { | ||
type Item = [T] where [T]: Sized; | ||
//~^ incorrect `type` inside `extern` block | ||
//~| `type`s inside `extern` blocks cannot have `where` clauses | ||
//~| cannot find type `T` in this scope | ||
//~| cannot find type `T` in this scope | ||
//~| extern types are experimental | ||
} | ||
|
||
fn main() {} |
47 changes: 47 additions & 0 deletions
47
tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.stderr
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,47 @@ | ||
error: incorrect `type` inside `extern` block | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:10 | ||
| | ||
LL | extern "C" { | ||
| ---------- `extern` blocks define existing foreign types and types inside of them cannot have a body | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^^^^ --- the invalid body | ||
| | | ||
| cannot have a body | ||
| | ||
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html | ||
|
||
error: `type`s inside `extern` blocks cannot have `where` clauses | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:21 | ||
| | ||
LL | extern "C" { | ||
| ---------- `extern` block begins here | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^^^^^^^^^^^^^^^^ help: remove the `where` clause | ||
| | ||
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html | ||
|
||
error[E0412]: cannot find type `T` in this scope | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:28 | ||
| | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^ not found in this scope | ||
|
||
error[E0412]: cannot find type `T` in this scope | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:18 | ||
| | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^ not found in this scope | ||
|
||
error[E0658]: extern types are experimental | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:5 | ||
| | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #43467 <https://github.com/rust-lang/rust/issues/43467> for more information | ||
= help: add `#![feature(extern_types)]` to the crate attributes to enable | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
Some errors have detailed explanations: E0412, E0658. | ||
For more information about an error, try `rustc --explain E0412`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// run-rustfix | ||
|
||
#[allow(unused_imports)] | ||
use std::ptr; | ||
|
||
fn expecting_null_mut(_: *mut u8) {} | ||
|
||
fn main() { | ||
expecting_null_mut(core::ptr::null_mut()); | ||
//~^ ERROR mismatched types | ||
} |
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,11 @@ | ||
// run-rustfix | ||
|
||
#[allow(unused_imports)] | ||
use std::ptr; | ||
|
||
fn expecting_null_mut(_: *mut u8) {} | ||
|
||
fn main() { | ||
expecting_null_mut(ptr::null()); | ||
//~^ ERROR mismatched types | ||
} |
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,21 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/ptr-null-mutability-suggestions.rs:9:24 | ||
| | ||
LL | expecting_null_mut(ptr::null()); | ||
| ------------------ ^^^^^^^^^^^ | ||
| | | | ||
| | types differ in mutability | ||
| | help: consider using `core::ptr::null_mut` instead: `core::ptr::null_mut()` | ||
| arguments to this function are incorrect | ||
| | ||
= note: expected raw pointer `*mut u8` | ||
found raw pointer `*const _` | ||
note: function defined here | ||
--> $DIR/ptr-null-mutability-suggestions.rs:6:4 | ||
| | ||
LL | fn expecting_null_mut(_: *mut u8) {} | ||
| ^^^^^^^^^^^^^^^^^^ ---------- | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |