-
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 #117641 - matthiaskrgr:rollup-f9c12td, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #117190 (add test for #113381) - #117516 (add test for #113375) - #117631 (Documentation cleanup for core::error::Request.) - #117637 (Check binders with bound vars for global bounds that don't hold) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
6 changed files
with
58 additions
and
5 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
15 changes: 15 additions & 0 deletions
15
tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const_closure-const_trait_impl-ice-113381.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,15 @@ | ||
#![feature(const_closures, const_trait_impl, effects)] | ||
#![allow(incomplete_features)] | ||
|
||
trait Foo { | ||
fn foo(&self); | ||
} | ||
|
||
impl Foo for () { | ||
fn foo(&self) {} | ||
} | ||
|
||
fn main() { | ||
(const || { (()).foo() })(); | ||
//~^ ERROR: cannot call non-const fn | ||
} |
11 changes: 11 additions & 0 deletions
11
...i/rfcs/rfc-2632-const-trait-impl/effects/const_closure-const_trait_impl-ice-113381.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,11 @@ | ||
error[E0015]: cannot call non-const fn `<() as Foo>::foo` in constant functions | ||
--> $DIR/const_closure-const_trait_impl-ice-113381.rs:13:22 | ||
| | ||
LL | (const || { (()).foo() })(); | ||
| ^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
18 changes: 18 additions & 0 deletions
18
tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-113375-index-out-of-bounds-generics.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,18 @@ | ||
// check-pass | ||
|
||
// effects ice https://github.com/rust-lang/rust/issues/113375 index out of bounds | ||
|
||
#![allow(incomplete_features, unused)] | ||
#![feature(effects, adt_const_params)] | ||
|
||
struct Bar<T>(T); | ||
|
||
impl<T> Bar<T> { | ||
const fn value() -> usize { | ||
42 | ||
} | ||
} | ||
|
||
struct Foo<const N: [u8; Bar::<u32>::value()]>; | ||
|
||
pub fn main() {} |