Skip to content

Rollup of 10 pull requests #142392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d66e66
add `body` to `ClosureDef`
b-naber May 20, 2025
8604e58
add doc comment and a test with a generic closure
b-naber Jun 2, 2025
46326e1
Use non-2015 edition paths in tests that do not test for their resolu…
Veykril Jun 5, 2025
1d7c1b1
Add more missing 2015 edition directives
Veykril Jun 5, 2025
2549962
Add missing `dyn` keywords to tests that do not test for them
Veykril Jun 5, 2025
4882ea4
rustc_resolve: Improve `resolve_const_param_in_non_trivial_anon_const…
Enselic Jun 7, 2025
e9eae28
transmutability: shift abstraction boundary
jswrenn Jun 4, 2025
2c82574
use correct edition when warning for unsafe attributes
folkertdev Jun 9, 2025
f461997
Rename `build` to `host_target`
Kobzol Jun 10, 2025
20e8325
Improve documentation of the `Rustc` step and rename `compiler` to `b…
Kobzol Jun 10, 2025
208f2e4
Remove useless and wrong std crates special casing when un-remap sysroot
Urgau Jun 10, 2025
b88c006
compiler: Change c_int_width to be an integer type
workingjubilee Jun 11, 2025
87feee9
compiler: Update all targets to the new c_int_width type
workingjubilee Jun 11, 2025
0994063
cleaned up some tests
Kivooeo Jun 8, 2025
c6c55cc
cleaned up some tests
Kivooeo Jun 8, 2025
9f6e81c
Rollup merge of #141307 - b-naber:closure-body, r=celinval
matthiaskrgr Jun 12, 2025
bdf7b74
Rollup merge of #142040 - jswrenn:transmute-ty-region-generic, r=comp…
matthiaskrgr Jun 12, 2025
b3ddf3c
Rollup merge of #142066 - ferrocene:lw/edition-2015-tests, r=compiler…
matthiaskrgr Jun 12, 2025
2d9513b
Rollup merge of #142157 - Enselic:trivial-anon-const-use-cases, r=com…
matthiaskrgr Jun 12, 2025
c557695
Rollup merge of #142217 - Kivooeo:tf10, r=jieyouxu
matthiaskrgr Jun 12, 2025
e2e201f
Rollup merge of #142219 - Kivooeo:tf11, r=wesleywiser
matthiaskrgr Jun 12, 2025
75c186b
Rollup merge of #142261 - folkertdev:unstable-attr-correct-edition, r…
matthiaskrgr Jun 12, 2025
bb9dda1
Rollup merge of #142303 - Kobzol:bootstrap-cleanup-1, r=jieyouxu
matthiaskrgr Jun 12, 2025
78d8395
Rollup merge of #142318 - Urgau:cleanup-rust-src-remap, r=jieyouxu
matthiaskrgr Jun 12, 2025
2407761
Rollup merge of #142352 - workingjubilee:c-int-width-is-an-integer, r…
matthiaskrgr Jun 12, 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
10 changes: 10 additions & 0 deletions tests/ui/box/empty-alloc-deref-rvalue.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Smoke test: dereferencing boxed zero-sized types (ZSTs) should not crash.
//!
//! Originally a regression test of github.com/rust-lang/rust/issues/13360
//! but repurposed for a smoke test.

//@ run-pass

pub fn main() {
let _: () = *Box::new(());
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// issue #20126
//! Regression test for issue #20126: Copy and Drop traits are mutually exclusive

#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
struct Foo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/exclusive-drop-and-copy.rs:3:10
--> $DIR/copy-drop-mutually-exclusive.rs:3:10
|
LL | #[derive(Copy, Clone)]
| ^^^^ `Copy` not allowed on types with destructors

error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/exclusive-drop-and-copy.rs:10:10
--> $DIR/copy-drop-mutually-exclusive.rs:10:10
|
LL | #[derive(Copy, Clone)]
| ^^^^ `Copy` not allowed on types with destructors
Expand Down
7 changes: 0 additions & 7 deletions tests/ui/empty-allocation-rvalue-non-null.rs

This file was deleted.

24 changes: 0 additions & 24 deletions tests/ui/empty-type-parameter-list.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests/ui/error-should-say-copy-not-pod.rs

This file was deleted.

22 changes: 0 additions & 22 deletions tests/ui/error-should-say-copy-not-pod.stderr

This file was deleted.

13 changes: 0 additions & 13 deletions tests/ui/explicit-i-suffix.rs

This file was deleted.

2 changes: 0 additions & 2 deletions tests/ui/ext-nonexistent.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/ext-nonexistent.stderr

This file was deleted.

26 changes: 0 additions & 26 deletions tests/ui/fact.rs

This file was deleted.

27 changes: 27 additions & 0 deletions tests/ui/generics/empty-generic-brackets-equiv.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//! Test that empty type parameter list <> is equivalent to no type parameters
//!
//! Checks` that empty angle brackets <> are syntactically valid and equivalent
//! to omitting type parameters entirely across various language constructs.

//@ run-pass

struct S<>;
trait T<> {} //~ WARN trait `T` is never used
enum E<> {
V
}
impl<> T<> for S<> {}
impl T for E {}
fn foo<>() {}
fn bar() {}
fn main() {
let _ = S;
let _ = S::<>;
let _ = E::V;
let _ = E::<>::V;
foo();
foo::<>();
// Test that we can supply <> to non-generic things
bar::<>();
let _: i32<>;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: trait `T` is never used
--> $DIR/empty-type-parameter-list.rs:6:7
--> $DIR/empty-generic-brackets-equiv.rs:9:7
|
LL | trait T<> {}
| ^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Test nested macro expansion with concat! macros

//@ run-pass

static FOO : &'static str = concat!(concat!("hel", "lo"), "world");
Expand Down
6 changes: 6 additions & 0 deletions tests/ui/resolve/nonexistent-macro.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! Test error handling for undefined macro calls

fn main() {
iamnotanextensionthatexists!("");
//~^ ERROR cannot find macro `iamnotanextensionthatexists` in this scope
}
8 changes: 8 additions & 0 deletions tests/ui/resolve/nonexistent-macro.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: cannot find macro `iamnotanextensionthatexists` in this scope
--> $DIR/nonexistent-macro.rs:4:5
|
LL | iamnotanextensionthatexists!("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
//! Regression test for issue #38412: interaction between stability attributes and privacy
//!
//! Tests that the compiler correctly handles the interaction between feature gates
//! and privacy/visibility rules. Specifically verifies that enabled unstable features
//! are accessible while disabled ones are properly rejected.

//@ aux-build:pub-and-stability.rs

// A big point of this test is that we *enable* `unstable_declared`,
// but do *not* enable `unstable_undeclared`. This way we can check
// that the compiler is letting in uses of enabled feature-gated
// stuff but still rejecting uses of disabled feature-gated stuff.
// Enable `unstable_declared` but not `unstable_undeclared` to test
// that the compiler allows enabled features but rejects disabled ones
#![feature(unstable_declared)]

extern crate pub_and_stability;
use pub_and_stability::{Record, Trait, Tuple};

fn main() {
// Okay
// Test struct field access patterns
let Record { .. } = Record::new();

// Okay
let Record { a_stable_pub: _, a_unstable_declared_pub: _, .. } = Record::new();
let Record {
a_stable_pub: _,
a_unstable_declared_pub: _,
..
} = Record::new();

let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_undeclared_pub: _, .. } =
Record::new();
//~^^ ERROR use of unstable library feature `unstable_undeclared`
let Record {
a_stable_pub: _,
a_unstable_declared_pub: _,
a_unstable_undeclared_pub: _, //~ ERROR use of unstable library feature `unstable_undeclared`
..
} = Record::new();

let r = Record::new();
let t = Tuple::new();

// Test field access with different stability/privacy combinations
r.a_stable_pub;
r.a_unstable_declared_pub;
r.a_unstable_undeclared_pub; //~ ERROR use of unstable library feature
Expand All @@ -37,10 +48,12 @@ fn main() {
t.4; //~ ERROR is private
t.5; //~ ERROR is private

// Test trait method access
r.stable_trait_method();
r.unstable_declared_trait_method();
r.unstable_undeclared_trait_method(); //~ ERROR use of unstable library feature

// Test inherent method access
r.stable();
r.unstable_declared();
r.unstable_undeclared(); //~ ERROR use of unstable library feature
Expand All @@ -49,6 +62,7 @@ fn main() {
r.pub_mod(); //~ ERROR `pub_mod` is private
r.private(); //~ ERROR `private` is private

// Repeat tests for tuple struct
let t = Tuple::new();
t.stable_trait_method();
t.unstable_declared_trait_method();
Expand Down
Loading