-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// regression test for #83466- tests that generic arg mismatch errors between | ||
// consts and types are not supressed when there are explicit late bound lifetimes | ||
|
||
struct S; | ||
impl S { | ||
fn func<'a, U>(self) -> U { | ||
todo!() | ||
} | ||
} | ||
fn dont_crash<'a, U>() { | ||
S.func::<'a, 10_u32>() | ||
//~^ WARNING cannot specify lifetime arguments explicitly if late bound lifetime parameters are present | ||
//~^^ WARNING this was previously accepted by | ||
//~^^^ ERROR constant provided when a type was expected [E0747] | ||
} | ||
|
||
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,22 @@ | ||
warning: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present | ||
--> $DIR/issue-83466.rs:11:14 | ||
| | ||
LL | fn func<'a, U>(self) -> U { | ||
| -- the late bound lifetime parameter is introduced here | ||
... | ||
LL | S.func::<'a, 10_u32>() | ||
| ^^ | ||
| | ||
= note: `#[warn(late_bound_lifetime_arguments)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> | ||
|
||
error[E0747]: constant provided when a type was expected | ||
--> $DIR/issue-83466.rs:11:18 | ||
| | ||
LL | S.func::<'a, 10_u32>() | ||
| ^^^^^^ | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0747`. |