forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#71111 - Dylan-DPC:rollup-esp17qn, r=Dylan-DPC
Rollup of 4 pull requests Successful merges: - rust-lang#70654 (Explain how to work with subtree) - rust-lang#71092 (Remove some usage of `DUMMY_HIR_ID`) - rust-lang#71103 (Add test case for type aliasing `impl Sized`) - rust-lang#71109 (allow const generics in const fn) Failed merges: r? @ghost
- Loading branch information
Showing
14 changed files
with
108 additions
and
73 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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// run-pass | ||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
const fn const_u32_identity<const X: u32>() -> u32 { | ||
//~^ ERROR const parameters are not permitted in const functions | ||
X | ||
} | ||
|
||
fn main() { | ||
println!("{:?}", const_u32_identity::<18>()); | ||
assert_eq!(const_u32_identity::<18>(), 18); | ||
} |
17 changes: 2 additions & 15 deletions
17
src/test/ui/const-generics/const-fn-with-const-param.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,23 +1,10 @@ | ||
error: const parameters are not permitted in const functions | ||
--> $DIR/const-fn-with-const-param.rs:4:1 | ||
| | ||
LL | const fn const_u32_identity<const X: u32>() -> u32 { | ||
| ^---- | ||
| | | ||
| _`const` because of this | ||
| | | ||
LL | | | ||
LL | | X | ||
LL | | } | ||
| |_^ | ||
|
||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash | ||
--> $DIR/const-fn-with-const-param.rs:1:12 | ||
--> $DIR/const-fn-with-const-param.rs:2:12 | ||
| | ||
LL | #![feature(const_generics)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
warning: 1 warning emitted | ||
|
17 changes: 17 additions & 0 deletions
17
src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.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,17 @@ | ||
// check-pass | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
type A = impl Sized; | ||
fn f1() -> A { 0 } | ||
|
||
type B = impl ?Sized; | ||
fn f2() -> &'static B { &[0] } | ||
|
||
type C = impl ?Sized + 'static; | ||
fn f3() -> &'static C { &[0] } | ||
|
||
type D = impl ?Sized; | ||
fn f4() -> &'static D { &1 } | ||
|
||
fn main() {} |