Commit Graph

233333 Commits

Author SHA1 Message Date
BlackHoleFox
2044a2d7fa Raise minimum supported tvOS version to 10.0 2023-09-23 19:14:25 -05:00
BlackHoleFox
3b52befdce Raise minimum supported iOS version to 10.0
Drop the armv7-apple-ios target too because its no longer supported
with the hardware iOS 10 requires.
2023-09-23 19:14:25 -05:00
BlackHoleFox
58bbca958d Raise minimum supported macOS to 10.12 2023-09-23 19:14:25 -05:00
bors
4e5b31c2b0 Auto merge of #115166 - Urgau:invalid_ref_casting-invalid-unsafecell-usage, r=est31
Lint on invalid usage of `UnsafeCell::raw_get` in reference casting

This PR proposes to take into account `UnsafeCell::raw_get` method call for non-Freeze types for the `invalid_reference_casting` lint.

The goal of this is to catch those kind of invalid reference casting:
```rust
fn as_mut<T>(x: &T) -> &mut T {
    unsafe { &mut *std::cell::UnsafeCell::raw_get(x as *const _ as *const _) }
    //~^ ERROR casting `&T` to `&mut T` is undefined behavior
}
```

r? `@est31`
2023-09-07 00:24:45 +00:00
bors
b0d45536ac Auto merge of #115580 - eduardosm:stdarch-intrinsics, r=davidtwco,bjorn3
Update stdarch submodule and remove special handling in cranelift codegen for some AVX and SSE2 LLVM intrinsics

https://github.com/rust-lang/stdarch/pull/1463 reimplemented some x86 intrinsics to avoid using some x86-specific LLVM intrinsics:

* Store unaligned (`_mm*_storeu_*`) use `<*mut _>::write_unaligned` instead of `llvm.x86.*.storeu.*`.
* Shift by immediate (`_mm*_s{ll,rl,ra}i_epi*`) use `if` (srl, sll) or `min` (sra) to simulate the behaviour when the RHS is out of range. RHS is constant, so the `if`/`min` will be optimized away.

This PR updates the stdarch submodule to pull these changes and removes special handling for those LLVM intrinsics from cranelift codegen. I left gcc codegen untouched because there are some autogenerated lists.
2023-09-06 22:26:37 +00:00
bors
e3abbd4994 Auto merge of #114946 - anforowicz:generic-fix-for-asan-lto, r=tmiasko
Preserve ASAN-related symbols during LTO.

Fixes https://github.com/rust-lang/rust/issues/113404
2023-09-06 20:04:03 +00:00
bors
4e2116296c Auto merge of #115615 - matthiaskrgr:rollup-49fosdf, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #114511 (Remove the unhelpful let binding diag comes from FormatArguments)
 - #115473 (Add explanatory note to 'expected item' error)
 - #115574 (Replace `rustc_data_structures` dependency with `rustc_index` in `rustc_parse_format`)
 - #115578 (Clarify cryptic comments)
 - #115587 (fix #115348)
 - #115596 (A small change)
 - #115598 (Fix log formatting in bootstrap)
 - #115605 (Better Debug for `Ty` in smir)
 - #115614 (Fix minor grammar typo)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-06 18:16:06 +00:00
Matthias Krüger
1d3451d495
Rollup merge of #115614 - dariuswiles:patch-1, r=cuviper
Fix minor grammar typo
2023-09-06 19:31:52 +02:00
Matthias Krüger
9a901dad6f
Rollup merge of #115605 - ouz-a:smir_better_debug, r=oli-obk
Better Debug for `Ty` in smir

Similar to what I did here https://github.com/rust-lang/rust/pull/115534.

r? ``@oli-obk``
2023-09-06 19:31:51 +02:00
Matthias Krüger
23537ce47e
Rollup merge of #115598 - GoldsteinE:fix-bootstrap-formatting, r=onur-ozkan
Fix log formatting in bootstrap

`format!()` was missing, so log was just showing `{target}` verbatim.

(I also applied a small clippy suggestion in `builder.info()`)
2023-09-06 19:31:51 +02:00
Matthias Krüger
da44234b64
Rollup merge of #115596 - nnethercote:two-small-changes, r=lqd
A small change

A small change I made while poking around the code.

r? `@lqd`
2023-09-06 19:31:50 +02:00
Matthias Krüger
3e42a12a54
Rollup merge of #115587 - mojave2:issue-115348, r=oli-obk
fix #115348

fix #115348
It looks that:

- In `rustc_mir_build::build`, the body of function will not be built, when the `tcx.check_match(def)` fails due to `non-exhaustive patterns`
- In `rustc_mir_transform::check_unsafety`, the `UnsafetyChecker` collects all `used_unsafe_blocks` in the MIR of a function, and the `UnusedUnsafeVisitor` will visit all `UnsafeBlock`s in the HIR and collect `unused_unsafes`, which are not contained in `used_unsafe_blocks`, and report `unnecessary_unsafe`s
- So the unsafe block in the issue example code will be reported as `unnecessary_unsafe`.
2023-09-06 19:31:50 +02:00
Matthias Krüger
93543bc8bc
Rollup merge of #115578 - ouz-a:rustc_clarify, r=oli-obk
Clarify cryptic comments

Clarifies some unclear comments that lurked in the compiler.

r? ``@oli-obk``
2023-09-06 19:31:49 +02:00
Matthias Krüger
7498dca311
Rollup merge of #115574 - Veykril:rustc_parse_format-dep, r=Nilstrieb
Replace `rustc_data_structures` dependency with `rustc_index` in `rustc_parse_format`

`rustc_data_structures` is only used for the `static_assert_size` macro, yet that is defined in `rustc_index` and merely re-exported. `rustc_index` is a lot more lightweight than `rustc_data_structures` which would make this a lot more reusable for rust-analyzer.
2023-09-06 19:31:49 +02:00
Matthias Krüger
4a31cc859b
Rollup merge of #115473 - gurry:113110-expected-item, r=compiler-errors
Add explanatory note to 'expected item' error

Fixes #113110

It changes the diagnostic from this:

```
error: expected item, found `5`
 --> ../test.rs:1:1
  |
1 | 5
  | ^ expected item
 ```
to this:
```
error: expected item, found `5`
 --> ../test.rs:1:1
  |
1 | 5
  | ^ expected item
  |
  = note: items are things that can appear at the root of a module
  = note: for a full list see https://doc.rust-lang.org/reference/items.html
```
2023-09-06 19:31:48 +02:00
Matthias Krüger
b046541b62
Rollup merge of #114511 - chenyukang:yukang-fix-114374-fmt-args, r=b-naber
Remove the unhelpful let binding diag comes from FormatArguments

Fixes #114374
2023-09-06 19:31:48 +02:00
Darius Wiles
408dca7241
Fix minor grammar typo 2023-09-06 09:47:22 -07:00
bors
a5b2ac6906 Auto merge of #115252 - cjgillot:mir-composite, r=davidtwco
Represent MIR composite debuginfo as projections instead of aggregates

Composite debuginfo for MIR is currently represented as
```
debug name => Type { projection1 => place1, projection2 => place2 };
```
ie. a single `VarDebugInfo` object with that name, and its value a `VarDebugInfoContents::Composite`.

This PR proposes to reverse the representation to be
```
debug name.projection1 => place1;
debug name.projection2 => place2;
```
ie. multiple `VarDebugInfo` objects with each their projection.

This simplifies the handling of composite debuginfo by the compiler by avoiding weird nesting.

Based on https://github.com/rust-lang/rust/pull/115139
2023-09-06 16:10:11 +00:00
ouz-a
cc7c5ad20b Ty Debug now prints id and kind 2023-09-06 15:02:03 +03:00
bors
a0c28cd9dc Auto merge of #115401 - Zoxc:freeze, r=oli-obk
Add `FreezeLock` type and use it to store `Definitions`

This adds a `FreezeLock` type which allows mutation using a lock until the value is frozen where it can be accessed lock-free. It's used to store `Definitions` in `Untracked` instead of a `RwLock`. Unlike the current scheme of leaking read guards this doesn't deadlock if definitions is written to after no mutation are expected.
2023-09-06 11:48:43 +00:00
bors
c1d80ba9e2 Auto merge of #115532 - oli-obk:smir_folder, r=compiler-errors
Implement SMIR generic parameter instantiation

Also demonstrates the use of it with a test.

This required a few smaller changes that may conflict with `@ericmarkmartin` work, but should be easy to resolve any conflicts on my end if their stuff lands first.
2023-09-06 09:50:13 +00:00
mojave2
cfa2119563
add a regression test 2023-09-06 17:46:46 +08:00
mojave2
df6e6a6d08
fix #115348 2023-09-06 17:46:46 +08:00
John Kåre Alsaker
35e8b67fc2 Use a reference to the lock in the guards 2023-09-06 11:44:06 +02:00
ouz-a
7928c5f830 make comments less cryptic 2023-09-06 12:09:29 +03:00
Oli Scherer
0f4ff52e00 Implement and test monomorphization 2023-09-06 08:16:04 +00:00
Oli Scherer
202fbed1a6 Allow fetching the SMIR body of FnDefs 2023-09-06 08:16:04 +00:00
Oli Scherer
98d26d9c4d Deopaquify ParamConst 2023-09-06 08:16:04 +00:00
Oli Scherer
627fa80bdf Add types to all constants 2023-09-06 08:16:04 +00:00
Oli Scherer
a370f1baa3 Also use Const in SMIR instead of just ConstantKind 2023-09-06 08:16:04 +00:00
Oli Scherer
7f009e54bd Fail to test argument instantiation since we don't have types for most constants 2023-09-06 08:16:04 +00:00
Oli Scherer
b43e3b9f41 Add type folder to SMIR 2023-09-06 08:15:42 +00:00
bors
24bece8420 Auto merge of #115453 - ibraheemdev:patch-16, r=joshtriplett
Stabilize `io_error_other` feature

Per the FCP for https://github.com/rust-lang/rust/issues/91946.
2023-09-06 08:00:25 +00:00
Goldstein
e0593f30fb
fix log formatting in bootstrap 2023-09-06 10:14:09 +03:00
Nicholas Nethercote
42dbc72d7b Adjust to_attr_token_stream.
It uses `once` chained with `(0..self.num_calls).map(...)` followed by
`.take(self.num_calls`. I found this hard to read. It's simpler to just
use `repeat_with`.
2023-09-06 17:12:07 +10:00
bors
3767e315ac Auto merge of #115593 - weihanglo:update-cargo, r=weihanglo
Update cargo

21 commits in 96fe1c9e1aecd8f57063e3753969bb6418fd2fd5..d14c85f4e6e7671673b1a1bc87231ff7164761e1
2023-08-29 20:10:34 +0000 to 2023-09-05 22:28:10 +0000
- fix(resolver): Make resolver behavior independent of package order (rust-lang/cargo#12602)
- cargo-credential: change serialization of cache expiration (rust-lang/cargo#12622)
- Update registry-web-api.md yank/unyank comments (rust-lang/cargo#12619)
- test: new options of debuginfo are no longer unstable (rust-lang/cargo#12618)
- use split_once for cleaner code (rust-lang/cargo#12615)
- stop using lazy_static (rust-lang/cargo#12616)
- doc: adjust all doc headings one level up (rust-lang/cargo#12595)
- chore(deps): update compatible (rust-lang/cargo#12609)
- chore(deps): update rust crate cargo_metadata to 0.17.0 (rust-lang/cargo#12610)
- Prepare for partial-version package specs (rust-lang/cargo#12591)
- refactor: Use more serde_untagged (rust-lang/cargo#12581)
- fix(cli): Help users know possible `--target` values (rust-lang/cargo#12607)
- Tab completion for --target uses rustup but fallsback to rustc (rust-lang/cargo#12606)
- Fewer temporary needless strings (rust-lang/cargo#12604)
- fix(help): Provide better commands heading for styling (rust-lang/cargo#12593)
- fix(update): Clarify meaning of --aggressive as --recursive (rust-lang/cargo#12544)
- docs(changelog): Clarify language for Cargo.lock policy (rust-lang/cargo#12601)
- fix typo: "default branch branch" -&gt; "default branch" (rust-lang/cargo#12598)
- fix: add error for unsupported credential provider version (rust-lang/cargo#12590)
- fix(help): Explain --explain (rust-lang/cargo#12592)
- fix(help): Remove redundant information from new/init (rust-lang/cargo#12594)

r? ghost
2023-09-06 06:11:25 +00:00
Weihang Lo
2619a6ea51
Update cargo 2023-09-06 12:58:59 +08:00
bors
51a9df8c70 Auto merge of #115584 - ezekielathome:docs-pattern-inconsistency, r=compiler-errors
replace doc occurrences of ItemLikeVisitor

Solves #114885

ItemLikeVisitor used to have comments describing visit patterns. After it was removed, it was moved to `rustc_hir::intravisit` but references in `intravisit.rs` weren't updated.
2023-09-06 04:24:36 +00:00
Gurinder Singh
6a286e775c Add explanatory note to 'expected item' error 2023-09-06 09:05:07 +05:30
bors
aeddd2ddfd Auto merge of #115529 - chenyukang:yukang-fix-115402-overflowsize, r=compiler-errors
Fix error report for size overflow from transmute

Fixes #115402

The span in the error reporting always points to the `dst`, this is an old issue, I may open another PR to fix it.
2023-09-06 02:37:41 +00:00
bors
25283f4e13 Auto merge of #115371 - matthewjasper:if-let-guard-parsing, r=cjgillot
Make if let guard parsing consistent with normal guards

- Add tests that struct expressions are not allowed in `if let` and `while let` (no change, consistent with `if` and `while`)
- Allow struct expressions in `if let` guards (consistent with `if` guards).

r? `@cjgillot`

Closes #93817
cc #51114
2023-09-06 00:46:21 +00:00
bors
ff902fff1f Auto merge of #115581 - djkoloski:update_llvm_submodule, r=cuviper
Update LLVM submodule to 17.0.0-rc4

Updates the in-tree LLVM submodule to the 17.0.0-rc4 branch from https://github.com/rust-lang/llvm-project/pull/151.
2023-09-05 22:56:02 +00:00
yukang
00010eda8b Fix error report for size overflow from transmute 2023-09-06 06:48:34 +08:00
bors
a991861ec9 Auto merge of #115507 - cjgillot:relative-source-file, r=oli-obk
Use relative positions inside a SourceFile.

This allows to remove the normalization of start positions for hashing, and simplify allocation of global address space.

cc `@Zoxc`
2023-09-05 21:03:56 +00:00
ezekiel
13f17e1a93 replace doc occurrences of ItemLikeVisitor
ItemLikeVisitor was removed, and the visit strategy was moved to `rustc_hir::intravisit`
2023-09-05 22:40:36 +02:00
bors
f91c53d738 Auto merge of #115579 - matthiaskrgr:rollup-n4ijxl7, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #114794 (clarify safety documentation of ptr::swap and ptr::copy)
 - #115397 (Add support to return value in StableMIR interface and not crash due to compilation error)
 - #115559 (implied bounds: do not ICE on unconstrained region vars)

Failed merges:

 - #115532 (Implement SMIR generic parameter instantiation)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-05 19:21:46 +00:00
David Koloski
fba61a8233 Update LLVM submodule to 17.0.0-rc4 2023-09-05 18:34:53 +00:00
Eduardo Sánchez Muñoz
0b6ee86d37 Remove special handling in codegen for some AVX and SSE2 shift by immediate intrinsics
Those were removed from stdarch in https://github.com/rust-lang/stdarch/pull/1463 (`simd_shl` and `simd_shr` are used instead)
2023-09-05 20:17:01 +02:00
Matthias Krüger
8c0490782e
Rollup merge of #115559 - lcnr:implied-bounds-unconstrained, r=aliemjay
implied bounds: do not ICE on unconstrained region vars

fixes #112832

see tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs for a minimal example showing why this is necessary.

r? types

cc ``@compiler-errors`` ``@aliemjay`` https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/assoc.20type.20bound.20in.20super.20trait
2023-09-05 20:15:03 +02:00
Matthias Krüger
c7d5c12cc8
Rollup merge of #115397 - celinval:smir-interface, r=oli-obk
Add support to return value in StableMIR interface and not crash due to compilation error

Invoking `StableMir::run()` on a crate that has any compilation error was crashing the entire process. Instead, return a `CompilerError` so the user knows compilation did not succeed. I believe ICE will also be converted to `CompilerError`.

I'm also adding a possibility for the callback to return a value. I think it will be handy for users (at least it was for my current task of implementing a tool to validate stable-mir). However, if people disagree, I can remove that.
2023-09-05 20:15:02 +02:00