forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit bcdd3d7)
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//! Ensure we don't allow accessing const effect parameters from stable Rust. | ||
fn main() { | ||
i8::checked_sub::<true>(42, 43); | ||
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied | ||
} | ||
|
||
const FOO: () = { | ||
i8::checked_sub::<false>(42, 43); | ||
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied | ||
}; |
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 @@ | ||
error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied | ||
--> $DIR/effect_param.rs:9:9 | ||
| | ||
LL | i8::checked_sub::<false>(42, 43); | ||
| ^^^^^^^^^^^--------- help: remove these generics | ||
| | | ||
| expected 0 generic arguments | ||
|
||
error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied | ||
--> $DIR/effect_param.rs:4:9 | ||
| | ||
LL | i8::checked_sub::<true>(42, 43); | ||
| ^^^^^^^^^^^-------- help: remove these generics | ||
| | | ||
| expected 0 generic arguments | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0107`. |