Skip to content
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

Rollup of 7 pull requests #108661

Closed

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 2, 2023

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

CraftSpider and others added 25 commits February 20, 2023 13:47
…ons for miri. Credit to emarteca for the code.
Support allocations with non-Box<[u8]> bytes

This is prep work for allowing miri to support passing pointers to C code, which will require `Allocation`s to be correctly aligned. Currently, it just makes `Allocation` generic and plumbs the necessary changes through the right places.

The follow-up to this will be adding a type in the miri interpreter which correctly aligns the bytes, using that for the Miri engine, then allowing Miri to pass pointers into these allocations to C calls.

Based off of rust-lang#100467, credit to `@emarteca` for the code
… r=pietroalbini

Re-apply "switch to the macos-12-xl builder"

This reverts commit e63ec2e, essentially re-applying fcbae98.

r? ``@pietroalbini``
…-span-fix-Some, r=WaffleLapkin

Point error span at Some constructor argument when trait resolution fails

This is a follow up to rust-lang#108254 and rust-lang#106477 which extends error span refinement to handle a case which I mistakenly believed was handled in rust-lang#106477. The goal is to refine the error span depicted below:

```rs
trait Fancy {}
impl <T> Fancy for Option<T> where T: Iterator {}

fn want_fancy<F>(f: F) where F: Fancy {}

fn example() {
    want_fancy(Some(5));
//  (BEFORE)   ^^^^^^^ `{integer}` is not an iterator
//  (AFTER)         ^  `{integer}` is not an iterator
}
```

I had used a (slightly more complex) example as an illustrative example in rust-lang#108254 , but hadn't actually turned it into a test, because I had (incorrectly) believed at the time it was covered by existing behavior. It turns out that `Some` is slightly "special" in that it resolves differently from the other `enum` constructors I had tried, and therefore this test was actually broken.

I've now updated the tests to include this example, and fixed the code to correctly resolve the `Some` constructor so that the span of the error is reduced.
Explain compile-time vs run-time difference in env!() error message

This PR is clarifying error message of `env!()` based on this user question: https://users.rust-lang.org/t/environment-variable-out-dir-is-undefined/90067

It makes it clear that `env!()` is for env variables defined at compile-time. There's special-case help text for common Cargo build script variables.

I've also rearranged the code to avoid allocating error message on the happy path when the env var is defined.
…arsan68

Allow setting hashmap toml values in `./configure`

Fixes rust-lang#108621
…ure-on-main, r=Nilstrieb

Forbid the use of `#[target_feature]` on `main`

Fixes rust-lang#108645.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Mar 2, 2023
@rustbot rustbot added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Mar 2, 2023
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Mar 2, 2023

📌 Commit b5aec1c has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2023
@bors
Copy link
Contributor

bors commented Mar 2, 2023

⌛ Testing commit b5aec1c with merge fd314c37eaa7f402bc78c907a79a147720d5be1f...

@bors
Copy link
Contributor

bors commented Mar 2, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 2, 2023
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [ui] tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs stdout ----
diff of stderr:

- error: `start` is not allowed to have `#[target_feature]`
-   --> $DIR/issue-108645-target-feature-on-start.rs:4:1
+ error: the feature named `avx2` is not valid for this target
3    |
3    |
4 LL | #[target_feature(enable = "avx2")]
- LL |
- LL |
- LL | fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }
-    | -------------------------------------------------------- `start` is not allowed to have `#[target_feature]`
+    |                  ^^^^^^^^^^^^^^^ `avx2` is not valid for this target
10 error: aborting due to previous error
11 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start/issue-108645-target-feature-on-start.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs" "-Zthreads=1" "--target=wasm32-unknown-unknown" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "--emit" "metadata" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start/auxiliary"
stdout: none
--- stderr -------------------------------
error: the feature named `avx2` is not valid for this target
  --> fake-test-src-base/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs:4:18
   |
LL | #[target_feature(enable = "avx2")]
   |                  ^^^^^^^^^^^^^^^ `avx2` is not valid for this target
error: aborting due to previous error
------------------------------------------



---- [ui] tests/ui/target-feature/wasm-safe.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/target-feature/wasm-safe.rs" "-Zthreads=1" "--target=wasm32-unknown-unknown" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "--emit" "metadata" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/target-feature/wasm-safe" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/target-feature/wasm-safe/auxiliary"
stdout: none
--- stderr -------------------------------
error: `main` function is not allowed to have `#[target_feature]`
  --> fake-test-src-base/target-feature/wasm-safe.rs:44:1
LL | fn main() {}
LL | fn main() {}
   | ^^^^^^^^^ `main` function is not allowed to have `#[target_feature]`
error: aborting due to previous error
------------------------------------------


@compiler-errors compiler-errors deleted the rollup-ytdm3bj branch August 11, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.