Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
fba4177
Simplify assignments.
cjgillot Jun 23, 2025
ac70dc8
Introduce Value::RawPtr as it behaves differently from other aggregates.
cjgillot Jun 30, 2025
be41333
Store a full Ty with each Value.
cjgillot Jun 30, 2025
4750dff
Remove extraneous types.
cjgillot Jun 30, 2025
cbc3cf7
Avoid computing layouts inside coroutines.
cjgillot Jul 1, 2025
4a95b16
Move crashes tests.
cjgillot Jul 2, 2025
92144e1
Remove `josh-sync` tooling and update README
Kobzol Jul 4, 2025
13dca5e
Update CI workflow to use rustc-josh-sync
Kobzol Jul 4, 2025
9d83749
Document `rustc-josh-sync`
Kobzol Jul 4, 2025
dbad976
Merge pull request #2491 from Kobzol/switch-to-rustc-josh-sync
jieyouxu Jul 4, 2025
f167f9b
external-repos.md: small fixes
tshepang Jul 4, 2025
33c70d9
Merge pull request #2492 from rust-lang/tshepang-patch-1
tshepang Jul 4, 2025
922ee88
Mention that stdarch is managed by josh-sync
Kobzol Jul 8, 2025
342d78d
Merge pull request #2495 from Kobzol/josh-sync-stdarch
jieyouxu Jul 8, 2025
24a25db
Revert `tests/run-make/mte-ffi` changes
jieyouxu Jun 10, 2025
37136dd
Disable `tests/run-make/mte-ffi`
jieyouxu Jul 8, 2025
6b8bc68
use a consistent (and recommended) invocation
tshepang Jul 9, 2025
120a361
Merge pull request #2496 from rust-lang/tshepang-a-convenience
tshepang Jul 9, 2025
7b394d2
tweak some git clone commands
tshepang Jul 9, 2025
42472f2
add missing word
tshepang Jul 9, 2025
d99af0b
distcheck had only one possible invocation
tshepang Jul 9, 2025
99fc05b
do not invent a name
tshepang Jul 9, 2025
1a6e543
Merge pull request #2498 from rust-lang/tshepang-patch-1
Noratrieb Jul 10, 2025
7c76abc
Merge pull request #2500 from rust-lang/tshepang-patch-3
Noratrieb Jul 10, 2025
1ef0072
Merge pull request #2499 from rust-lang/tshepang-patch-2
Noratrieb Jul 10, 2025
f1ae43f
Mention that compiler-builtins is now using `rustc-josh-sync`
Kobzol Jul 10, 2025
c6bedc1
Migrate rustc-pull to CI workflow from `josh-sync`
Kobzol Jul 10, 2025
c7cdd14
Merge pull request #2501 from Kobzol/compiler-builtins-josh
jieyouxu Jul 10, 2025
c46e385
Merge pull request #2502 from Kobzol/rustc-josh-sync-ci
jieyouxu Jul 11, 2025
7803c25
directives.md: build-aux-docs does not work with aux-crate
lolbinarycat Jul 11, 2025
f58accb
pass --gc-sections if -Zexport-executable-symbols is enabled and impr…
usamoi Jul 12, 2025
39f269c
Merge pull request #2497 from rust-lang/tshepang-git-clone
ZuseZ4 Jul 14, 2025
8ec7e6f
Merge pull request #2504 from lolbinarycat/lolbinarycat-patch-2
jieyouxu Jul 15, 2025
0e423f4
Boostrap: add warning on `optimize = false`
xdoardo Jul 16, 2025
4e054fc
Port `#[coverage]` to the new attribute system
scrabsha Jul 13, 2025
af39c0c
Emit warning when there is no space between `-o` and confusing arg
xizheyin Jul 10, 2025
9ef3be2
go over invariants again :3
lcnr Jul 16, 2025
6237eaf
Merge pull request #2506 from lcnr/type-system-invariants
lcnr Jul 16, 2025
f100767
fix `-Zsanitizer=kcfi` on `#[naked]` functions
folkertdev Jul 1, 2025
ec0ff72
add `codegen_instance_attrs` query
folkertdev Jul 2, 2025
9c8ab89
use `codegen_instance_attrs` where an instance is (easily) available
folkertdev Jul 2, 2025
fad8dec
fix: false positive double_negations when it jumps macro boundary
anatawa12 Jul 16, 2025
8df6a1d
some improvements to "Invariants of the type system"
tshepang Jul 17, 2025
c113a60
Merge pull request #2507 from rust-lang/tshepang-misc
tshepang Jul 17, 2025
2faf5ed
Prepare for merging from rust-lang/rust
invalid-email-address Jul 17, 2025
ce0de76
Merge ref 'fd2eb391d032' from rust-lang/rust
invalid-email-address Jul 17, 2025
b2474c8
Merge pull request #2508 from rust-lang/rustc-pull
tshepang Jul 17, 2025
dd364bd
copy-paste convenience
tshepang Jul 17, 2025
41c0c5b
Merge pull request #2510 from rust-lang/tshepang-patch-1
tshepang Jul 17, 2025
5bb6b9d
remove no_gc_sections
usamoi Jul 14, 2025
6645bf5
Copy GCC sources into the build directory even outside CI
Kobzol Jul 17, 2025
853333d
constify `Option` methods
oli-obk Jul 15, 2025
e943b3b
Rollup merge of #142300 - jieyouxu:exp-partial-revert-141576, r=Waffl…
matthiaskrgr Jul 18, 2025
b252014
Rollup merge of #143271 - cjgillot:gvn-types, r=oli-obk
matthiaskrgr Jul 18, 2025
accf61d
Rollup merge of #143293 - folkertdev:naked-function-kcfi, r=compiler-…
matthiaskrgr Jul 18, 2025
26f5936
Rollup merge of #143719 - xizheyin:142812-1, r=jieyouxu
matthiaskrgr Jul 18, 2025
79c8f90
Rollup merge of #143846 - usamoi:gc, r=bjorn3
matthiaskrgr Jul 18, 2025
03734ae
Rollup merge of #143891 - scrabsha:push-xxtttopqoprr, r=jdonszelmann
matthiaskrgr Jul 18, 2025
a7009e9
Rollup merge of #143967 - oli-obk:const-option-methods, r=fee1-dead
matthiaskrgr Jul 18, 2025
19ed2f1
Rollup merge of #144008 - anatawa12:fix-double-negations, r=compiler-…
matthiaskrgr Jul 18, 2025
3023a28
Rollup merge of #144010 - xdoardo:bootstrap-warning-optimize-false, r…
matthiaskrgr Jul 18, 2025
37e7bc1
Rollup merge of #144049 - tshepang:rust-push, r=jieyouxu
matthiaskrgr Jul 18, 2025
c22e2ea
Rollup merge of #144056 - Kobzol:gcc-build-src, r=nikic
matthiaskrgr Jul 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
553 changes: 255 additions & 298 deletions compiler/rustc_mir_transform/src/gvn.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/mir-opt/const_prop/transmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub unsafe fn undef_union_as_integer() -> u32 {
pub unsafe fn unreachable_direct() -> ! {
// CHECK-LABEL: fn unreachable_direct(
// CHECK: = const ();
// CHECK: = const () as Never (Transmute);
// CHECK: = const ZeroSized: Never;
let x: Never = unsafe { transmute(()) };
match x {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- _2 = ();
- _1 = move _2 as Never (Transmute);
+ _2 = const ();
+ _1 = const () as Never (Transmute);
+ _1 = const ZeroSized: Never;
unreachable;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- _2 = ();
- _1 = move _2 as Never (Transmute);
+ _2 = const ();
+ _1 = const () as Never (Transmute);
+ _1 = const ZeroSized: Never;
unreachable;
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

bb0: {
_4 = copy _1 as *const T (PtrToPtr);
_5 = PtrMetadata(copy _4);
- _5 = PtrMetadata(copy _4);
+ _5 = const ();
_6 = copy _1 as *const (&A, [T]) (PtrToPtr);
- _7 = PtrMetadata(copy _6);
+ _7 = PtrMetadata(copy _1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

bb0: {
_4 = copy _1 as *const T (PtrToPtr);
_5 = PtrMetadata(copy _4);
- _5 = PtrMetadata(copy _4);
+ _5 = const ();
_6 = copy _1 as *const (&A, [T]) (PtrToPtr);
- _7 = PtrMetadata(copy _6);
+ _7 = PtrMetadata(copy _1);
Expand Down
2 changes: 1 addition & 1 deletion tests/mir-opt/gvn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ fn generic_cast_metadata<T, A: ?Sized, B: ?Sized>(ps: *const [T], pa: *const A,

// Metadata usize -> (), do not optimize.
// CHECK: [[T:_.+]] = copy _1 as
// CHECK-NEXT: PtrMetadata(copy [[T]])
// CHECK-NEXT: const ();
let t1 = CastPtrToPtr::<_, *const T>(ps);
let m1 = PtrMetadata(t1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
}

bb4: {
StorageLive(_15);
_14 = &mut _13;
_15 = <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next(move _14) -> [return: bb5, unwind: bb11];
}
Expand All @@ -120,7 +119,6 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
}

bb6: {
StorageDead(_15);
StorageDead(_13);
drop(_2) -> [return: bb7, unwind continue];
}
Expand All @@ -135,14 +133,13 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
StorageLive(_19);
_19 = &_2;
StorageLive(_20);
_20 = (copy _17, copy _18);
_20 = copy ((_15 as Some).0: (usize, &T));
_21 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _19, move _20) -> [return: bb9, unwind: bb11];
}

bb9: {
StorageDead(_20);
StorageDead(_19);
StorageDead(_15);
goto -> bb4;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
//@ known-bug: rust-lang/rust#128094
//! Verify that we do not ICE when a coroutine body is malformed.
//@ compile-flags: -Zmir-enable-passes=+GVN
//@ edition: 2018

pub enum Request {
TestSome(T),
//~^ ERROR cannot find type `T` in this scope [E0412]
}

pub async fn handle_event(event: Request) {
async move {
static instance: Request = Request { bar: 17 };
//~^ ERROR expected struct, variant or union type, found enum `Request` [E0574]
&instance
}
.await;
}

fn main() {}
26 changes: 26 additions & 0 deletions tests/ui/mir/gvn-nonsensical-coroutine-layout.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error[E0412]: cannot find type `T` in this scope
--> $DIR/gvn-nonsensical-coroutine-layout.rs:6:14
|
LL | TestSome(T),
| ^ not found in this scope
|
help: you might be missing a type parameter
|
LL | pub enum Request<T> {
| +++

error[E0574]: expected struct, variant or union type, found enum `Request`
--> $DIR/gvn-nonsensical-coroutine-layout.rs:12:36
|
LL | static instance: Request = Request { bar: 17 };
| ^^^^^^^ not a struct, variant or union type
|
help: consider importing this struct instead
|
LL + use std::error::Request;
|

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0412, E0574.
For more information about an error, try `rustc --explain E0412`.
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
//@ known-bug: #135128
//! Verify that we do not ICE when optimizing bodies with nonsensical bounds.
//@ compile-flags: -Copt-level=1
//@ edition: 2021
//@ build-pass

#![feature(trivial_bounds)]

async fn return_str() -> str
where
str: Sized,
//~^ WARN trait bound str: Sized does not depend on any type or lifetime parameters
{
*"Sized".to_string().into_boxed_str()
}

fn main() {}
10 changes: 10 additions & 0 deletions tests/ui/mir/gvn-nonsensical-sized-str.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
warning: trait bound str: Sized does not depend on any type or lifetime parameters
--> $DIR/gvn-nonsensical-sized-str.rs:10:10
|
LL | str: Sized,
| ^^^^^
|
= note: `#[warn(trivial_bounds)]` on by default

warning: 1 warning emitted