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#86348 - JohnTitor:rollup-o6a6k67, r=JohnTitor
Rollup of 8 pull requests Successful merges: - rust-lang#85283 (Avoid possible filename collision in coverage tests) - rust-lang#86200 (Updates `Clone` docs for `Copy` comparison.) - rust-lang#86209 (fix minor wording/typo issues in core::option docs) - rust-lang#86242 (rustdoc- dont ICE on `ConstEvaluatable` predicates) - rust-lang#86280 (Add a regression test for issue-76510) - rust-lang#86293 (Allow to run only a few GUI tests) - rust-lang#86327 (Don't mark "safe" intrinsics as unsafe) - rust-lang#86345 (Remove some duplicate `char` assoc items on RELEASES.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
12 changed files
with
160 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ endif | |
# Run it in order to generate some profiling data, | ||
# with `LLVM_PROFILE_FILE=<profdata_file>` environment variable set to | ||
# output the coverage stats for this run. | ||
LLVM_PROFILE_FILE="$(TMPDIR)"/$@-%p.profraw \ | ||
LLVM_PROFILE_FILE="$(TMPDIR)"/[email protected] \ | ||
$(call RUN,$@) || \ | ||
( \ | ||
status=$$?; \ | ||
|
@@ -97,16 +97,19 @@ endif | |
) \ | ||
) | ||
|
||
# Run it through rustdoc as well to cover doctests | ||
LLVM_PROFILE_FILE="$(TMPDIR)"/$@-%p.profraw \ | ||
# Run it through rustdoc as well to cover doctests. | ||
# `%p` is the pid, and `%m` the binary signature. We suspect that the pid alone | ||
# might result in overwritten files and failed tests, as rustdoc spawns each | ||
# doctest as its own process, so make sure the filename is as unique as possible. | ||
LLVM_PROFILE_FILE="$(TMPDIR)"/$@-%p-%m.profraw \ | ||
$(RUSTDOC) --crate-name workaround_for_79771 --test $(SOURCEDIR)/[email protected] \ | ||
$$( sed -n 's/^\/\/ compile-flags: \([^#]*\).*/\1/p' $(SOURCEDIR)/[email protected] ) \ | ||
-L "$(TMPDIR)" -Zinstrument-coverage \ | ||
-Z unstable-options --persist-doctests=$(TMPDIR)/rustdoc-$@ | ||
|
||
# Postprocess the profiling data so it can be used by the llvm-cov tool | ||
"$(LLVM_BIN_DIR)"/llvm-profdata merge --sparse \ | ||
"$(TMPDIR)"/$@-*.profraw \ | ||
"$(TMPDIR)"/$@*.profraw \ | ||
-o "$(TMPDIR)"/[email protected] | ||
|
||
# Generate a coverage report using `llvm-cov show`. | ||
|
@@ -118,8 +121,7 @@ endif | |
--instr-profile="$(TMPDIR)"/[email protected] \ | ||
$(call BIN,"$(TMPDIR)"/$@) \ | ||
$$( \ | ||
for file in $(TMPDIR)/rustdoc-$@/*/rust_out; \ | ||
do \ | ||
for file in $(TMPDIR)/rustdoc-$@/*/rust_out; do \ | ||
[ -x "$$file" ] && printf "%s %s " -object $$file; \ | ||
done \ | ||
) \ | ||
|
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 @@ | ||
#![crate_name = "foo"] | ||
#![feature(const_evaluatable_checked, const_generics)] | ||
#![allow(incomplete_features)] | ||
// make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647 | ||
// @has foo/struct.Ice.html '//pre[@class="rust struct"]' \ | ||
// 'pub struct Ice<const N: usize> where [(); N + 1]: ;' | ||
pub struct Ice<const N: usize> where [(); N + 1]:; |
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 @@ | ||
#![feature(intrinsics)] | ||
#![feature(no_core)] | ||
|
||
#![no_core] | ||
#![crate_name = "foo"] | ||
|
||
extern "rust-intrinsic" { | ||
// @has 'foo/fn.abort.html' | ||
// @has - '//pre[@class="rust fn"]' 'pub extern "rust-intrinsic" fn abort() -> !' | ||
pub fn abort() -> !; | ||
// @has 'foo/fn.unreachable.html' | ||
// @has - '//pre[@class="rust fn"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !' | ||
pub fn unreachable() -> !; | ||
} | ||
|
||
extern "C" { | ||
// @has 'foo/fn.needs_drop.html' | ||
// @has - '//pre[@class="rust fn"]' 'pub unsafe extern "C" fn needs_drop() -> !' | ||
pub fn needs_drop() -> !; | ||
} |
36 changes: 36 additions & 0 deletions
36
src/test/ui/consts/const-mut-refs/issue-76510.32bit.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,36 @@ | ||
error[E0764]: mutable references are not allowed in the final value of constants | ||
--> $DIR/issue-76510.rs:5:29 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error[E0658]: mutation through a reference is not allowed in constants | ||
--> $DIR/issue-76510.rs:5:29 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information | ||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable | ||
|
||
error[E0596]: cannot borrow data in a `&` reference as mutable | ||
--> $DIR/issue-76510.rs:5:29 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^ cannot borrow as mutable | ||
|
||
error[E0080]: it is undefined behavior to use this value | ||
--> $DIR/issue-76510.rs:5:1 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered mutable reference in a `const` | ||
| | ||
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. | ||
= note: the raw bytes of the constant (size: 8, align: 4) { | ||
╾─alloc2──╼ 07 00 00 00 │ ╾──╼.... | ||
} | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0080, E0596, E0658, E0764. | ||
For more information about an error, try `rustc --explain E0080`. |
36 changes: 36 additions & 0 deletions
36
src/test/ui/consts/const-mut-refs/issue-76510.64bit.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,36 @@ | ||
error[E0764]: mutable references are not allowed in the final value of constants | ||
--> $DIR/issue-76510.rs:5:29 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error[E0658]: mutation through a reference is not allowed in constants | ||
--> $DIR/issue-76510.rs:5:29 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information | ||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable | ||
|
||
error[E0596]: cannot borrow data in a `&` reference as mutable | ||
--> $DIR/issue-76510.rs:5:29 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^ cannot borrow as mutable | ||
|
||
error[E0080]: it is undefined behavior to use this value | ||
--> $DIR/issue-76510.rs:5:1 | ||
| | ||
LL | const S: &'static mut str = &mut " hello "; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered mutable reference in a `const` | ||
| | ||
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. | ||
= note: the raw bytes of the constant (size: 16, align: 8) { | ||
╾───────alloc2────────╼ 07 00 00 00 00 00 00 00 │ ╾──────╼........ | ||
} | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0080, E0596, E0658, E0764. | ||
For more information about an error, try `rustc --explain E0080`. |
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 @@ | ||
// stderr-per-bitwidth | ||
|
||
use std::mem::{transmute, ManuallyDrop}; | ||
|
||
const S: &'static mut str = &mut " hello "; | ||
//~^ ERROR: mutable references are not allowed in the final value of constants | ||
//~| ERROR: mutation through a reference is not allowed in constants | ||
//~| ERROR: cannot borrow data in a `&` reference as mutable | ||
//~| ERROR: it is undefined behavior to use this value | ||
|
||
const fn trigger() -> [(); unsafe { | ||
let s = transmute::<(*const u8, usize), &ManuallyDrop<str>>((S.as_ptr(), 3)); | ||
0 | ||
}] { | ||
[(); 0] | ||
} | ||
|
||
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