forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#91388 - JohnTitor:rollup-640o1e5, r=JohnTitor
Rollup of 8 pull requests Successful merges: - rust-lang#91243 (Don't treat unnormalized function arguments as well-formed) - rust-lang#91250 (Refactor EmitterWriter::emit_suggestion_default ) - rust-lang#91317 (tests: Ignore `test/debuginfo/rc_arc.rs` on windows-gnu) - rust-lang#91323 (CTFE: support assert_zero_valid and assert_uninit_valid) - rust-lang#91358 (Fix small typo) - rust-lang#91360 (:arrow_up: rust-analyzer) - rust-lang#91368 (Don't re-export `MirPass`) - rust-lang#91383 (Add `drop_while` as doc alias to `Iterator::skip_while`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
22 changed files
with
172 additions
and
100 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
pub mod check_consts; | ||
pub mod promote_consts; | ||
pub mod validate; | ||
|
||
pub use rustc_middle::mir::MirPass; |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// error-pattern: any use of this value will cause an error | ||
|
||
#![feature(never_type)] | ||
#![feature(const_maybe_uninit_assume_init, const_assert_type2)] | ||
#![feature(core_intrinsics)] | ||
|
||
use std::intrinsics; | ||
|
||
#[allow(invalid_value)] | ||
fn main() { | ||
use std::mem::MaybeUninit; | ||
|
||
const _BAD1: () = unsafe { | ||
MaybeUninit::<!>::uninit().assume_init(); | ||
}; | ||
const _BAD2: () = unsafe { | ||
intrinsics::assert_uninit_valid::<bool>(); | ||
}; | ||
const _BAD3: () = unsafe { | ||
intrinsics::assert_zero_valid::<&'static i32>(); | ||
}; | ||
} |
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,39 @@ | ||
error: any use of this value will cause an error | ||
--> $DIR/assert-type-intrinsics.rs:14:9 | ||
| | ||
LL | / const _BAD1: () = unsafe { | ||
LL | | MaybeUninit::<!>::uninit().assume_init(); | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!` | ||
LL | | }; | ||
| |______- | ||
| | ||
= note: `#[deny(const_err)]` 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 #71800 <https://github.com/rust-lang/rust/issues/71800> | ||
|
||
error: any use of this value will cause an error | ||
--> $DIR/assert-type-intrinsics.rs:17:9 | ||
| | ||
LL | / const _BAD2: () = unsafe { | ||
LL | | intrinsics::assert_uninit_valid::<bool>(); | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid | ||
LL | | }; | ||
| |______- | ||
| | ||
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800> | ||
|
||
error: any use of this value will cause an error | ||
--> $DIR/assert-type-intrinsics.rs:20:9 | ||
| | ||
LL | / const _BAD3: () = unsafe { | ||
LL | | intrinsics::assert_zero_valid::<&'static i32>(); | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid | ||
LL | | }; | ||
| |______- | ||
| | ||
= 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 #71800 <https://github.com/rust-lang/rust/issues/71800> | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
src/test/ui/fn/implied-bounds-unnorm-associated-type.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,14 @@ | ||
error: lifetime may not live long enough | ||
--> $DIR/implied-bounds-unnorm-associated-type.rs:14:5 | ||
| | ||
LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { | ||
| -- -- lifetime `'b` defined here | ||
| | | ||
| lifetime `'a` defined here | ||
LL | s | ||
| ^ returning this value requires that `'b` must outlive `'a` | ||
| | ||
= help: consider adding the following bound: `'b: 'a` | ||
|
||
error: aborting due to previous error | ||
|
Oops, something went wrong.