forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#76502 - Dylan-DPC:rollup-2c4zz0t, r=Dylan-DPC
Rollup of 10 pull requests Successful merges: - rust-lang#76162 (Make duration_since documentation more clear) - rust-lang#76355 (remove public visibility previously needed for rustfmt) - rust-lang#76374 (Improve ayu doc source line number contrast) - rust-lang#76379 (rustbuild: Remove `Mode::Codegen`) - rust-lang#76389 (Fix HashMap visualizers in Visual Studio (Code)) - rust-lang#76396 (Fix typo in tracking issue template) - rust-lang#76401 (Add help note to unconstrained const parameter) - rust-lang#76402 (Update linker-plugin-lto.md to contain up to rust 1.46) - rust-lang#76403 (Fix documentation for TyCtxt::all_impls) - rust-lang#76498 (Update cargo) Failed merges: - rust-lang#76458 (Add drain_filter method to HashMap and HashSet) r? `@ghost`
- Loading branch information
Showing
13 changed files
with
85 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Checks that const expressions have a useful note explaining why they can't be evaluated. | ||
// The note should relate to the fact that it cannot be shown forall N that it maps 1-1 to a new | ||
// type. | ||
|
||
#![feature(const_generics)] | ||
#![allow(incomplete_features)] | ||
|
||
struct Collatz<const N: Option<usize>>; | ||
|
||
impl <const N: usize> Collatz<{Some(N)}> {} | ||
//~^ ERROR the const parameter | ||
|
||
struct Foo; | ||
|
||
impl<const N: usize> Foo {} | ||
//~^ ERROR the const parameter | ||
|
||
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,21 @@ | ||
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates | ||
--> $DIR/issue-68366.rs:10:13 | ||
| | ||
LL | impl <const N: usize> Collatz<{Some(N)}> {} | ||
| ^ unconstrained const parameter | ||
| | ||
= note: expressions using a const parameter must map each value to a distinct output value | ||
= note: proving the result of expressions other than the parameter are unique is not supported | ||
|
||
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates | ||
--> $DIR/issue-68366.rs:15:12 | ||
| | ||
LL | impl<const N: usize> Foo {} | ||
| ^ unconstrained const parameter | ||
| | ||
= note: expressions using a const parameter must map each value to a distinct output value | ||
= note: proving the result of expressions other than the parameter are unique is not supported | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0207`. |
Submodule cargo
updated
26 files