forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#88750 - jackh726:rollup-w57i9fp, r=jackh726
Rollup of 9 pull requests Successful merges: - rust-lang#86263 (Rustdoc: Report Layout of enum variants) - rust-lang#88541 (Add regression test for rust-lang#74400) - rust-lang#88553 (Improve diagnostics for unary plus operators (rust-lang#88276)) - rust-lang#88594 (More symbolic doc aliases) - rust-lang#88648 (Correct “copies” to “moves” in `<Option<T> as From<T>>::from` doc, and other copyediting) - rust-lang#88691 (Add a regression test for rust-lang#88649) - rust-lang#88694 (Drop 1.56 stabilizations from 1.55 release notes) - rust-lang#88712 (Fix docs for `uX::checked_next_multiple_of`) - rust-lang#88726 (Fix typo in `const_generics` replaced with `adt_const_params` note) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
22 changed files
with
260 additions
and
45 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
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,8 +1,14 @@ | ||
error: expected expression, found `+` | ||
error: leading `+` is not supported | ||
--> $DIR/issue-36499.rs:4:9 | ||
| | ||
LL | 2 + +2; | ||
| ^ expected expression | ||
| ^ unexpected `+` | ||
| | ||
help: try removing the `+` | ||
| | ||
LL - 2 + +2; | ||
LL + 2 + 2; | ||
| | ||
|
||
error: aborting due to previous error | ||
|
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 @@ | ||
// check-pass | ||
#![crate_type = "lib"] | ||
|
||
enum Foo { | ||
Variant1(bool), | ||
Variant2(bool), | ||
} | ||
|
||
const _: () = { | ||
let mut n = 0; | ||
while n < 2 { | ||
match Foo::Variant1(true) { | ||
Foo::Variant1(x) | Foo::Variant2(x) if x => {} | ||
_ => {} | ||
} | ||
n += 1; | ||
} | ||
}; |
30 changes: 30 additions & 0 deletions
30
src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.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,30 @@ | ||
error[E0310]: the parameter type `T` may not live long enough | ||
--> $DIR/issue_74400.rs:12:5 | ||
| | ||
LL | f(data, identity) | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: consider adding an explicit lifetime bound `T: 'static`... | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue_74400.rs:12:5 | ||
| | ||
LL | f(data, identity) | ||
| ^^^^^^^^^^^^^^^^^ one type is more general than the other | ||
| | ||
= note: expected type `for<'r> Fn<(&'r T,)>` | ||
found type `Fn<(&T,)>` | ||
|
||
error: implementation of `FnOnce` is not general enough | ||
--> $DIR/issue_74400.rs:12:5 | ||
| | ||
LL | f(data, identity) | ||
| ^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough | ||
| | ||
= note: `fn(&'2 T) -> &'2 T {identity::<&'2 T>}` must implement `FnOnce<(&'1 T,)>`, for any lifetime `'1`... | ||
= note: ...but it actually implements `FnOnce<(&'2 T,)>`, for some specific lifetime `'2` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0308, E0310. | ||
For more information about an error, try `rustc --explain E0308`. |
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,13 @@ | ||
//! Regression test for #74400: Type mismatch in function arguments E0631, E0271 are falsely | ||
//! recognized as E0308 mismatched types. | ||
|
||
use std::convert::identity; | ||
|
||
fn main() {} | ||
|
||
fn f<T, S>(data: &[T], key: impl Fn(&T) -> S) { | ||
} | ||
|
||
fn g<T>(data: &[T]) { | ||
f(data, identity) //~ ERROR implementation of `FnOnce` is not general | ||
} |
Oops, something went wrong.