-
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.
Auto merge of #103009 - Dylan-DPC:rollup-9c2tng6, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #102765 (Suggest `==` to the first expr which has `ExprKind::Assign` kind) - #102854 (openbsd: don't reallocate a guard page on the stack.) - #102904 (Print return-position `impl Trait` in trait verbosely if `-Zverbose`) - #102947 (Sort elaborated existential predicates in `object_ty_for_trait`) - #102956 (Use `full_res` instead of `expect_full_res`) - #102999 (Delay `is_intrinsic` query until after we've determined the callee is a function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
13 changed files
with
164 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// check-pass | ||
|
||
use std::future::Future; | ||
|
||
pub trait Service { | ||
type Response; | ||
type Future: Future<Output = Self::Response>; | ||
} | ||
|
||
pub trait A1: Service<Response = i32> {} | ||
|
||
pub trait A2: Service<Future = Box<dyn Future<Output = i32>>> + A1 { | ||
fn foo(&self) {} | ||
} | ||
|
||
pub trait B1: Service<Future = Box<dyn Future<Output = i32>>> {} | ||
|
||
pub trait B2: Service<Response = i32> + B1 { | ||
fn foo(&self) {} | ||
} | ||
|
||
fn main() { | ||
let x: &dyn A2 = todo!(); | ||
let x: &dyn B2 = todo!(); | ||
} |
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,7 @@ | ||
impl Error for str::Utf8Error { | ||
//~^ ERROR cannot find trait `Error` in this scope | ||
//~| ERROR ambiguous associated type | ||
fn description(&self) {} | ||
} | ||
|
||
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,26 @@ | ||
error[E0405]: cannot find trait `Error` in this scope | ||
--> $DIR/issue-102946.rs:1:6 | ||
| | ||
LL | impl Error for str::Utf8Error { | ||
| ^^^^^ not found in this scope | ||
| | ||
help: consider importing this trait | ||
| | ||
LL | use std::error::Error; | ||
| | ||
|
||
error[E0223]: ambiguous associated type | ||
--> $DIR/issue-102946.rs:1:16 | ||
| | ||
LL | impl Error for str::Utf8Error { | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
help: you are looking for the module in `std`, not the primitive type | ||
| | ||
LL | impl Error for std::str::Utf8Error { | ||
| +++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0223, E0405. | ||
For more information about an error, try `rustc --explain E0223`. |
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 @@ | ||
#![feature(const_trait_impl)] | ||
|
||
struct Bug { | ||
inner: [(); match || 1 { | ||
n => n(), | ||
//~^ ERROR the trait bound | ||
//~| ERROR cannot call non-const fn `Bug::inner::{constant#0}::{closure#0}` in constants | ||
}], | ||
} | ||
|
||
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,26 @@ | ||
error[E0277]: the trait bound `[closure@$DIR/issue-102985.rs:4:23: 4:25]: ~const Fn<()>` is not satisfied | ||
--> $DIR/issue-102985.rs:5:14 | ||
| | ||
LL | n => n(), | ||
| ^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-102985.rs:4:23: 4:25]` | ||
| | ||
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-102985.rs:4:23: 4:25]` | ||
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-102985.rs:4:23: 4:25]`, but that implementation is not `const` | ||
--> $DIR/issue-102985.rs:5:14 | ||
| | ||
LL | n => n(), | ||
| ^^^ | ||
= note: wrap the `[closure@$DIR/issue-102985.rs:4:23: 4:25]` in a closure with no arguments: `|| { /* code */ }` | ||
|
||
error[E0015]: cannot call non-const fn `Bug::inner::{constant#0}::{closure#0}` in constants | ||
--> $DIR/issue-102985.rs:5:14 | ||
| | ||
LL | n => n(), | ||
| ^^^ | ||
| | ||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0015, E0277. | ||
For more information about an error, try `rustc --explain E0015`. |
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