forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#67543 - JohnTitor:regression-tests, r=Dylan…
…-DPC Add regression tests for fixed ICEs Closes rust-lang#61747 (fixed from 1.41.0-nightly (4007d4e 2019-12-01)) Closes rust-lang#66205 (fixed from 1.41.0-nightly (4007d4e 2019-12-01)) Closes rust-lang#66270 (fixed by rust-lang#66246) Closes rust-lang#66868 (fixed by rust-lang#67071) Closes rust-lang#67424 (fixed by rust-lang#67160) Also picking a minor nit up from rust-lang#67071 with 101dd7b r? @Centril
- Loading branch information
Showing
11 changed files
with
152 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// check-pass | ||
|
||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
struct Const<const N: usize>; | ||
|
||
impl<const C: usize> Const<{C}> { | ||
fn successor() -> Const<{C + 1}> { | ||
Const | ||
} | ||
} | ||
|
||
fn main() { | ||
let _x: Const::<2> = Const::<1>::successor(); | ||
} |
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,8 @@ | ||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash | ||
--> $DIR/issue-61747.rs:3:12 | ||
| | ||
LL | #![feature(const_generics)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
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 @@ | ||
// check-pass | ||
|
||
#![allow(incomplete_features, dead_code, unconditional_recursion)] | ||
#![feature(const_generics)] | ||
|
||
fn fact<const N: usize>() { | ||
fact::<{ N - 1 }>(); | ||
} | ||
|
||
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,13 @@ | ||
// Fixed by #67160 | ||
|
||
trait Trait1 { | ||
type A; | ||
} | ||
|
||
trait Trait2 { | ||
type Type1<B>: Trait1<A=B>; | ||
//~^ ERROR: generic associated types are unstable | ||
//~| ERROR: type-generic associated types are not yet implemented | ||
} | ||
|
||
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,20 @@ | ||
error[E0658]: generic associated types are unstable | ||
--> $DIR/issue-67424.rs:8:5 | ||
| | ||
LL | type Type1<B>: Trait1<A=B>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/44265 | ||
= help: add `#![feature(generic_associated_types)]` to the crate attributes to enable | ||
|
||
error: type-generic associated types are not yet implemented | ||
--> $DIR/issue-67424.rs:8:5 | ||
| | ||
LL | type Type1<B>: Trait1<A=B>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/44265 | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
14 changes: 14 additions & 0 deletions
14
src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.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,14 @@ | ||
// Regression test for #66270, fixed by #66246 | ||
|
||
struct Bug { | ||
incorrect_field: 0, | ||
//~^ ERROR expected type | ||
} | ||
|
||
struct Empty {} | ||
|
||
fn main() { | ||
let Bug { | ||
any_field: Empty {}, | ||
} = Bug {}; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.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,8 @@ | ||
error: expected type, found `0` | ||
--> $DIR/issue-66270-pat-struct-parser-recovery.rs:4:22 | ||
| | ||
LL | incorrect_field: 0, | ||
| ^ expected type | ||
|
||
error: aborting due to previous error | ||
|
25 changes: 25 additions & 0 deletions
25
src/test/ui/typeck/auxiliary/issue_66868_closure_typeck.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,25 @@ | ||
// edition:2018 | ||
|
||
#![crate_type = "lib"] | ||
|
||
use std::{ | ||
future::Future, | ||
pin::Pin, | ||
sync::RwLock, | ||
task::{Context, Poll}, | ||
}; | ||
|
||
struct S {} | ||
|
||
impl Future for S { | ||
type Output = (); | ||
fn poll(self: Pin<&mut Self>, _: &mut Context) -> Poll<Self::Output> { | ||
Poll::Pending | ||
} | ||
} | ||
|
||
pub async fn f() { | ||
let fo = RwLock::new(S {}); | ||
|
||
(&mut *fo.write().unwrap()).await; | ||
} |
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 @@ | ||
// Fixed by #67071 | ||
// aux-build: issue_66868_closure_typeck.rs | ||
// edition:2018 | ||
|
||
extern crate issue_66868_closure_typeck; | ||
|
||
pub fn g<T>(task: T) | ||
where | ||
T: Send, | ||
{ | ||
} | ||
|
||
fn main() { | ||
g(issue_66868_closure_typeck::f()); //~ ERROR: cannot be sent between threads safely | ||
} |
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,22 @@ | ||
error[E0277]: `std::sync::RwLockWriteGuard<'_, issue_66868_closure_typeck::S>` cannot be sent between threads safely | ||
--> $DIR/issue-66868-closure-typeck.rs:14:5 | ||
| | ||
LL | pub fn g<T>(task: T) | ||
| - | ||
LL | where | ||
LL | T: Send, | ||
| ---- required by this bound in `g` | ||
... | ||
LL | g(issue_66868_closure_typeck::f()); | ||
| ^ `std::sync::RwLockWriteGuard<'_, issue_66868_closure_typeck::S>` cannot be sent between threads safely | ||
| | ||
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::RwLockWriteGuard<'_, issue_66868_closure_typeck::S>` | ||
= note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5> {std::sync::RwLock<issue_66868_closure_typeck::S>, &'r std::sync::RwLock<issue_66868_closure_typeck::S>, std::sync::RwLock<issue_66868_closure_typeck::S>, std::result::Result<std::sync::RwLockWriteGuard<'s, issue_66868_closure_typeck::S>, std::sync::PoisonError<std::sync::RwLockWriteGuard<'t0, issue_66868_closure_typeck::S>>>, &'t1 mut std::sync::RwLockWriteGuard<'t2, issue_66868_closure_typeck::S>, std::sync::RwLockWriteGuard<'t3, issue_66868_closure_typeck::S>, issue_66868_closure_typeck::S, &'t4 mut issue_66868_closure_typeck::S, &'t5 mut issue_66868_closure_typeck::S, ()}` | ||
= note: required because it appears within the type `[static generator@DefId(15:16 ~ issue_66868_closure_typeck[8787]::f[0]::{{closure}}[0]) for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5> {std::sync::RwLock<issue_66868_closure_typeck::S>, &'r std::sync::RwLock<issue_66868_closure_typeck::S>, std::sync::RwLock<issue_66868_closure_typeck::S>, std::result::Result<std::sync::RwLockWriteGuard<'s, issue_66868_closure_typeck::S>, std::sync::PoisonError<std::sync::RwLockWriteGuard<'t0, issue_66868_closure_typeck::S>>>, &'t1 mut std::sync::RwLockWriteGuard<'t2, issue_66868_closure_typeck::S>, std::sync::RwLockWriteGuard<'t3, issue_66868_closure_typeck::S>, issue_66868_closure_typeck::S, &'t4 mut issue_66868_closure_typeck::S, &'t5 mut issue_66868_closure_typeck::S, ()}]` | ||
= note: required because it appears within the type `std::future::GenFuture<[static generator@DefId(15:16 ~ issue_66868_closure_typeck[8787]::f[0]::{{closure}}[0]) for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5> {std::sync::RwLock<issue_66868_closure_typeck::S>, &'r std::sync::RwLock<issue_66868_closure_typeck::S>, std::sync::RwLock<issue_66868_closure_typeck::S>, std::result::Result<std::sync::RwLockWriteGuard<'s, issue_66868_closure_typeck::S>, std::sync::PoisonError<std::sync::RwLockWriteGuard<'t0, issue_66868_closure_typeck::S>>>, &'t1 mut std::sync::RwLockWriteGuard<'t2, issue_66868_closure_typeck::S>, std::sync::RwLockWriteGuard<'t3, issue_66868_closure_typeck::S>, issue_66868_closure_typeck::S, &'t4 mut issue_66868_closure_typeck::S, &'t5 mut issue_66868_closure_typeck::S, ()}]>` | ||
= note: required because it appears within the type `impl std::future::Future` | ||
= note: required because it appears within the type `impl std::future::Future` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |