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.
Auto merge of rust-lang#113474 - compiler-errors:rollup-07x1up7, r=co…
…mpiler-errors Rollup of 8 pull requests Successful merges: - rust-lang#113413 (Add needs-triage to all new issues) - rust-lang#113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions) - rust-lang#113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case) - rust-lang#113441 (miri: check that assignments do not self-overlap) - rust-lang#113453 (Remove unused from_method from rustc_on_unimplemented) - rust-lang#113456 (Avoid calling report_forbidden_specialization for RPITITs) - rust-lang#113466 (Update cargo) - rust-lang#113467 (Fix comment of `fn_can_unwind`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
20 changed files
with
251 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#![feature(core_intrinsics)] | ||
#![feature(custom_mir)] | ||
|
||
use std::intrinsics::mir::*; | ||
|
||
// It's not that easy to fool the MIR validity check | ||
// which wants to prevent overlapping assignments... | ||
// So we use two separate pointer arguments, and then arrange for them to alias. | ||
#[custom_mir(dialect = "runtime", phase = "optimized")] | ||
pub fn self_copy(ptr1: *mut [i32; 4], ptr2: *mut [i32; 4]) { | ||
mir! { | ||
{ | ||
*ptr1 = *ptr2; //~ERROR: overlapping ranges | ||
Return() | ||
} | ||
} | ||
} | ||
|
||
pub fn main() { | ||
let mut x = [0; 4]; | ||
let ptr = std::ptr::addr_of_mut!(x); | ||
self_copy(ptr, ptr); | ||
} |
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,20 @@ | ||
error: Undefined Behavior: `copy_nonoverlapping` called on overlapping ranges | ||
--> $DIR/overlapping_assignment.rs:LL:CC | ||
| | ||
LL | *ptr1 = *ptr2; | ||
| ^^^^^^^^^^^^^ `copy_nonoverlapping` called on overlapping ranges | ||
| | ||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior | ||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information | ||
= note: BACKTRACE: | ||
= note: inside `self_copy` at $DIR/overlapping_assignment.rs:LL:CC | ||
note: inside `main` | ||
--> $DIR/overlapping_assignment.rs:LL:CC | ||
| | ||
LL | self_copy(ptr, ptr); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace | ||
|
||
error: aborting due to previous error | ||
|
30 changes: 30 additions & 0 deletions
30
tests/ui/async-await/in-trait/missing-feature-flag.current.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[E0046]: not all trait items implemented, missing: `foo` | ||
--> $DIR/missing-feature-flag.rs:14:1 | ||
| | ||
LL | async fn foo(_: T) -> &'static str; | ||
| ----------------------------------- `foo` from trait | ||
... | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation | ||
|
||
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` | ||
--> $DIR/missing-feature-flag.rs:18:5 | ||
| | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ------------------------------- parent `impl` is here | ||
... | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` | ||
| | ||
= note: to specialize, `foo` in the parent `impl` must be marked `default` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/missing-feature-flag.rs:18:42 | ||
| | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^ expected `&str`, found `()` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0046, E0308, E0520. | ||
For more information about an error, try `rustc --explain E0046`. |
30 changes: 30 additions & 0 deletions
30
tests/ui/async-await/in-trait/missing-feature-flag.next.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[E0046]: not all trait items implemented, missing: `foo` | ||
--> $DIR/missing-feature-flag.rs:14:1 | ||
| | ||
LL | async fn foo(_: T) -> &'static str; | ||
| ----------------------------------- `foo` from trait | ||
... | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation | ||
|
||
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` | ||
--> $DIR/missing-feature-flag.rs:18:5 | ||
| | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ------------------------------- parent `impl` is here | ||
... | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` | ||
| | ||
= note: to specialize, `foo` in the parent `impl` must be marked `default` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/missing-feature-flag.rs:18:42 | ||
| | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^ expected `&str`, found `()` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0046, E0308, E0520. | ||
For more information about an error, try `rustc --explain E0046`. |
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,23 @@ | ||
// edition:2018 | ||
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty | ||
// revisions: current next | ||
|
||
#![feature(async_fn_in_trait)] | ||
#![feature(min_specialization)] | ||
|
||
struct MyStruct; | ||
|
||
trait MyTrait<T> { | ||
async fn foo(_: T) -> &'static str; | ||
} | ||
|
||
impl<T> MyTrait<T> for MyStruct {} | ||
//~^ ERROR: not all trait items implemented, missing: `foo` [E0046] | ||
|
||
impl MyTrait<i32> for MyStruct { | ||
async fn foo(_: i32) -> &'static str {} | ||
//~^ ERROR: `foo` specializes an item from a parent `impl`, but that item is not marked `default` [E0520] | ||
//~| ERROR: mismatched types [E0308] | ||
} | ||
|
||
fn main() {} |
13 changes: 13 additions & 0 deletions
13
tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs
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 @@ | ||
#![feature(return_type_notation)] | ||
//~^ WARN the feature `return_type_notation` is incomplete | ||
|
||
// Shouldn't ICE when we have a (bad) RTN in an impl header | ||
|
||
trait Super1<'a> { | ||
fn bar<'b>() -> bool; | ||
} | ||
|
||
impl Super1<'_, bar(): Send> for () {} | ||
//~^ ERROR associated type bindings are not allowed here | ||
|
||
fn main() {} |
18 changes: 18 additions & 0 deletions
18
tests/ui/async-await/return-type-notation/rtn-in-impl-signature.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,18 @@ | ||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/rtn-in-impl-signature.rs:1:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error[E0229]: associated type bindings are not allowed here | ||
--> $DIR/rtn-in-impl-signature.rs:10:17 | ||
| | ||
LL | impl Super1<'_, bar(): Send> for () {} | ||
| ^^^^^^^^^^^ associated type not allowed here | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0229`. |
16 changes: 16 additions & 0 deletions
16
tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.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,16 @@ | ||
error[E0277]: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied | ||
--> $DIR/return-dont-satisfy-bounds.rs:13:34 | ||
| | ||
LL | fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> { | ||
| ^^^^^^^^^^^^ the trait `Foo<char>` is not implemented for `impl Foo<u8>` | ||
| | ||
= help: the trait `Foo<char>` is implemented for `Bar` | ||
note: required by a bound in `Foo::foo::{opaque#0}` | ||
--> $DIR/return-dont-satisfy-bounds.rs:7:30 | ||
| | ||
LL | fn foo<F2>(self) -> impl Foo<T>; | ||
| ^^^^^^ required by this bound in `Foo::foo::{opaque#0}` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Oops, something went wrong.