forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#105248 - matthiaskrgr:rollup-d56k6bc, r=matth…
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#104856 (Don't suggest associated function call for associated const.) - rust-lang#105123 (Fix passing MACOSX_DEPLOYMENT_TARGET to the linker) - rust-lang#105142 (Make inline const block `ExprWithBlock`) - rust-lang#105237 (Add regression test for rust-lang#79450) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
15 changed files
with
152 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# only-macos | ||
# | ||
# Check that a set deployment target actually makes it to the linker. | ||
# This is important since its a compatibility hazard. The linker will | ||
# generate load commands differently based on what minimum OS it can assume. | ||
|
||
include ../../run-make-fulldeps/tools.mk | ||
|
||
ifeq ($(strip $(shell uname -m)),arm64) | ||
GREP_PATTERN = "minos 11.0" | ||
else | ||
GREP_PATTERN = "version 10.9" | ||
endif | ||
|
||
OUT_FILE=$(TMPDIR)/with_deployment_target.dylib | ||
all: | ||
env MACOSX_DEPLOYMENT_TARGET=10.9 $(RUSTC) with_deployment_target.rs -o $(OUT_FILE) | ||
# XXX: The check is for either the x86_64 minimum OR the aarch64 minimum (M1 starts at macOS 11). | ||
# They also use different load commands, so we let that change with each too. The aarch64 check | ||
# isn't as robust as the x86 one, but testing both seems unneeded. | ||
vtool -show-build $(OUT_FILE) | $(CGREP) -e $(GREP_PATTERN) |
4 changes: 4 additions & 0 deletions
4
src/test/run-make/macos-deployment-target/with_deployment_target.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,4 @@ | ||
#![crate_type = "cdylib"] | ||
|
||
#[allow(dead_code)] | ||
fn something_and_nothing() {} |
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,6 @@ | ||
#![feature(inline_const)] | ||
|
||
fn main() { | ||
const { 2 } - const { 1 }; | ||
//~^ ERROR mismatched types | ||
} |
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,9 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/expr-with-block-err.rs:4:13 | ||
| | ||
LL | const { 2 } - const { 1 }; | ||
| ^ expected `()`, found integer | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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,10 @@ | ||
// check-pass | ||
#![feature(inline_const)] | ||
fn main() { | ||
match true { | ||
true => const {} | ||
false => () | ||
} | ||
const {} | ||
() | ||
} |
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(const_fmt_arguments_new)] | ||
#![feature(const_trait_impl)] | ||
|
||
#[const_trait] | ||
trait Tr { | ||
fn req(&self); | ||
|
||
fn prov(&self) { | ||
println!("lul"); //~ ERROR: cannot call non-const fn `_print` in constant functions | ||
self.req(); | ||
} | ||
} | ||
|
||
struct S; | ||
|
||
impl const Tr for S { | ||
fn req(&self) {} | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0015]: cannot call non-const fn `_print` in constant functions | ||
--> $DIR/issue-79450.rs:9:9 | ||
| | ||
LL | println!("lul"); | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
= note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
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