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#97401 - Dylan-DPC:rollup-fh9e61o, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#97302 (Do writeback of Closure params before visiting the parent expression) - rust-lang#97328 (rustc: Fix ICE in native library error reporting) - rust-lang#97351 (Output correct type responsible for structural match violation) - rust-lang#97398 (Add regression test for rust-lang#82830) - rust-lang#97400 (Fix a typo on Struct `Substructure`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
16 changed files
with
164 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
4 changes: 2 additions & 2 deletions
4
src/test/ui/const-generics/issues/issue-63322-forbid-dyn.full.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
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,14 @@ | ||
#![feature(adt_const_params)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::sync::Arc; | ||
|
||
#[derive(PartialEq, Eq)] | ||
enum Bar { | ||
Bar(Arc<i32>) | ||
} | ||
|
||
fn test<const BAR: Bar>() {} | ||
//~^ ERROR `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]` | ||
|
||
fn main() {} |
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,9 @@ | ||
error[E0741]: `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter | ||
--> $DIR/issue-97278.rs:11:20 | ||
| | ||
LL | fn test<const BAR: Bar>() {} | ||
| ^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0741`. |
7 changes: 7 additions & 0 deletions
7
src/test/ui/native-library-link-flags/modifiers-override-3.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,7 @@ | ||
// Regression test for issue #97299, one command line library with modifiers | ||
// overrides another command line library with modifiers. | ||
|
||
// compile-flags:-lstatic:+whole-archive=foo -lstatic:+whole-archive=foo | ||
// error-pattern: overriding linking modifiers from command line is not supported | ||
|
||
fn main() {} |
4 changes: 4 additions & 0 deletions
4
src/test/ui/native-library-link-flags/modifiers-override-3.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,4 @@ | ||
error: overriding linking modifiers from command line is not supported | ||
|
||
error: aborting due to previous error | ||
|
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 @@ | ||
trait A<Y, N> { | ||
type B; | ||
} | ||
|
||
type MaybeBox<T> = <T as A<T, Box<T>>>::B; | ||
struct P { | ||
t: MaybeBox<P>, //~ ERROR: overflow evaluating the requirement `P: Sized` | ||
} | ||
|
||
impl<Y, N> A<Y, N> for P { | ||
type B = N; | ||
} | ||
|
||
fn main() { | ||
let t: MaybeBox<P>; | ||
} |
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,15 @@ | ||
error[E0275]: overflow evaluating the requirement `P: Sized` | ||
--> $DIR/issue-82830.rs:7:8 | ||
| | ||
LL | t: MaybeBox<P>, | ||
| ^^^^^^^^^^^ | ||
| | ||
note: required because of the requirements on the impl of `A<P, Box<P>>` for `P` | ||
--> $DIR/issue-82830.rs:10:12 | ||
| | ||
LL | impl<Y, N> A<Y, N> for P { | ||
| ^^^^^^^ ^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0275`. |
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 |
---|---|---|
@@ -1,3 +1,17 @@ | ||
fn main() { | ||
let x = |_| { }; //~ ERROR type annotations needed | ||
fn infer_in_arg() { | ||
let x = |b: Vec<_>| {}; //~ ERROR E0282 | ||
} | ||
|
||
fn empty_pattern() { | ||
let x = |_| {}; //~ ERROR type annotations needed | ||
} | ||
|
||
fn infer_ty() { | ||
let x = |k: _| {}; //~ ERROR type annotations needed | ||
} | ||
|
||
fn ambig_return() { | ||
let x = || -> Vec<_> { Vec::new() }; //~ ERROR type annotations needed for the closure `fn() -> Vec<_>` | ||
} | ||
|
||
fn main() {} |
29 changes: 26 additions & 3 deletions
29
src/test/ui/type/type-check/unknown_type_for_closure.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 |
---|---|---|
@@ -1,9 +1,32 @@ | ||
error[E0282]: type annotations needed | ||
error[E0282]: type annotations needed for `Vec<_>` | ||
--> $DIR/unknown_type_for_closure.rs:2:14 | ||
| | ||
LL | let x = |_| { }; | ||
LL | let x = |b: Vec<_>| {}; | ||
| ^ consider giving this closure parameter a type | ||
|
||
error: aborting due to previous error | ||
error[E0282]: type annotations needed | ||
--> $DIR/unknown_type_for_closure.rs:6:14 | ||
| | ||
LL | let x = |_| {}; | ||
| ^ consider giving this closure parameter a type | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/unknown_type_for_closure.rs:10:14 | ||
| | ||
LL | let x = |k: _| {}; | ||
| ^ consider giving this closure parameter a type | ||
|
||
error[E0282]: type annotations needed for the closure `fn() -> Vec<_>` | ||
--> $DIR/unknown_type_for_closure.rs:14:28 | ||
| | ||
LL | let x = || -> Vec<_> { Vec::new() }; | ||
| ^^^^^^^^ cannot infer type for type parameter `T` | ||
| | ||
help: give this closure an explicit return type without `_` placeholders | ||
| | ||
LL | let x = || -> Vec<_> { Vec::new() }; | ||
| ~~~~~~ | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0282`. |