-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not equate Const
's ty in super_combine_const
#125671
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 2 additions & 5 deletions
7
tests/ui/consts/eval_type_mismatch.rs → tests/crashes/121858.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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
//@ known-bug: #121858 | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
struct Outer<const A: i64, const B: usize>(); | ||
impl<const A: usize, const B: usize> Outer<A, B> | ||
//~^ ERROR: `A` is not of type `i64` | ||
//~| ERROR: mismatched types | ||
where | ||
[(); A + (B * 2)]:, | ||
{ | ||
fn o() {} | ||
fn o() -> Union {} | ||
} | ||
|
||
fn main() { | ||
Outer::<1, 1>::o(); | ||
//~^ ERROR: no function or associated item named `o` found | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,22 +1,23 @@ | ||
//@ known-bug: #123141 | ||
trait ConstChunksExactTrait<T> { | ||
fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'_, T, { N }>; | ||
|
||
trait Trait { | ||
fn next(self) -> Self::Item; | ||
type Item; | ||
} | ||
|
||
impl<T> ConstChunksExactTrait<T> for [T] {} | ||
struct Foo<T: ?Sized>(T); | ||
|
||
struct ConstChunksExact<'a, T: 'a, const N: usize> {} | ||
impl<T: ?Sized, U> Trait for Foo<U> { | ||
type Item = Foo<T>; | ||
fn next(self) -> Self::Item { | ||
loop {} | ||
} | ||
} | ||
|
||
impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, { rem }> { | ||
type Item = &'a [T; N]; | ||
fn opaque() -> impl Trait { | ||
Foo::<_>(10_u32) | ||
} | ||
|
||
fn main() { | ||
let slice = &[1i32, 2, 3, 4, 5, 6, 7, 7, 9, 1i32]; | ||
|
||
let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); | ||
|
||
for a in slice.const_chunks_exact::<3>() { | ||
assert_eq!(a, iter.next().unwrap()); | ||
} | ||
opaque().next(); | ||
} |
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: 3 additions & 1 deletion
4
tests/crashes/114456.rs → ...dt_const_params/alias_const_param_ty-1.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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
//@ known-bug: #114456 | ||
//@ check-pass | ||
#![feature(adt_const_params, lazy_type_alias)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was fixed by removing the |
||
//~^ WARN: the feature `adt_const_params` is incomplete | ||
//~| WARN: the feature `lazy_type_alias` is incomplete | ||
|
||
pub type Matrix = [usize; 1]; | ||
const EMPTY_MATRIX: Matrix = [0; 1]; | ||
|
19 changes: 19 additions & 0 deletions
19
tests/ui/const-generics/adt_const_params/alias_const_param_ty-1.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,19 @@ | ||
warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/alias_const_param_ty-1.rs:2:12 | ||
| | ||
LL | #![feature(adt_const_params, lazy_type_alias)] | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/alias_const_param_ty-1.rs:2:30 | ||
| | ||
LL | #![feature(adt_const_params, lazy_type_alias)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information | ||
|
||
warning: 2 warnings emitted | ||
|
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
11 changes: 11 additions & 0 deletions
11
tests/ui/const-generics/adt_const_params/alias_const_param_ty-2.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 @@ | ||
warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/alias_const_param_ty-2.rs:2:12 | ||
| | ||
LL | #![feature(adt_const_params)] | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to rewrite this test as this PR masked the ICE due to the fact that
const N: usize
now introduces a bound that is ambiguous for an inference variable.