-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #65661 - JohnTitor:rollup-68la1fq, r=JohnTitor
Rollup of 5 pull requests Successful merges: - #65544 (Added doc on keyword break) - #65620 (Correctly note code as Ok not error for E0573) - #65624 ([mir-opt] Improve SimplifyLocals pass so it can remove unused consts) - #65650 (use unwrap_or in lint code) - #65652 (Fix `canonicalize_const_var` leaking inference variables) Failed merges: r? @ghost
- Loading branch information
Showing
18 changed files
with
298 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// revisions:rpass1 | ||
|
||
#![feature(const_generics)] | ||
|
||
struct Struct<T>(T); | ||
|
||
impl<T, const N: usize> Struct<[T; N]> { | ||
fn f() {} | ||
fn g() { Self::f(); } | ||
} | ||
|
||
fn main() { | ||
Struct::<[u32; 3]>::g(); | ||
} |
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 @@ | ||
// revisions:rpass1 | ||
|
||
#![feature(const_generics)] | ||
|
||
struct FakeArray<T, const N: usize>(T); | ||
|
||
impl<T, const N: usize> FakeArray<T, { N }> { | ||
fn len(&self) -> usize { | ||
N | ||
} | ||
} | ||
|
||
fn main() { | ||
let fa = FakeArray::<u32, { 32 }>(1); | ||
assert_eq!(fa.len(), 32); | ||
} |
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,12 @@ | ||
// revisions:cfail1 | ||
#![feature(const_generics)] | ||
//[cfail1]~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
struct S<T, const N: usize>([T; N]); | ||
|
||
fn f<T, const N: usize>(x: T) -> S<T, {N}> { panic!() } | ||
|
||
fn main() { | ||
f(0u8); | ||
//[cfail1]~^ ERROR type annotations needed | ||
} |
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 @@ | ||
// revisions:cfail1 | ||
#![feature(const_generics)] | ||
//[cfail1]~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
fn combinator<T, const S: usize>() -> [T; S] {} | ||
//[cfail1]~^ ERROR mismatched types | ||
|
||
fn main() { | ||
combinator().into_iter(); | ||
//[cfail1]~^ ERROR type annotations needed | ||
} |
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 @@ | ||
// revisions:rpass1 | ||
#![feature(const_generics)] | ||
|
||
pub struct Foo<T, const N: usize>([T; 0]); | ||
|
||
impl<T, const N: usize> Foo<T, {N}> { | ||
pub fn new() -> Self { | ||
Foo([]) | ||
} | ||
} | ||
|
||
fn main() { | ||
let _: Foo<u32, 0> = Foo::new(); | ||
} |
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
Oops, something went wrong.