Commit Graph

1430 Commits

Author SHA1 Message Date
mubarak23
193d165e22 add back lto-abort.rs to the list 2024-03-21 16:47:20 +01:00
mubarak23
3cb807b6d3 remove more pass test from the lists 2024-03-21 16:19:49 +01:00
mubarak23
6a2f725a45 remove pass test 2024-03-21 16:00:30 +01:00
Guillaume Gomez
9b17b3d184 Simplify directory creation 2024-03-20 15:48:59 +01:00
Guillaume Gomez
51d27a63b8 Move cleanup of sysroot build into its own function 2024-03-20 15:16:52 +01:00
antoyo
17abfa7041
Merge pull request #1 from mubarak23/remove-debug-info
remove debug info from emitting
2024-03-19 09:27:02 -04:00
mubarak23
09dbab8fab change the debug option from true to limited 2024-03-19 13:49:07 +01:00
mubarak23
4ef3bac2a6 remove debug info from emitting 2024-03-19 08:54:11 +01:00
bors
678e62405f Auto merge of #122055 - compiler-errors:stabilize-atb, r=oli-obk
Stabilize associated type bounds (RFC 2289)

This PR stabilizes associated type bounds, which were laid out in [RFC 2289]. This gives us a shorthand to express nested type bounds that would otherwise need to be expressed with nested `impl Trait` or broken into several `where` clauses.

### What are we stabilizing?

We're stabilizing the associated item bounds syntax, which allows us to put bounds in associated type position within other bounds, i.e. `T: Trait<Assoc: Bounds...>`. See [RFC 2289] for motivation.

In all position, the associated type bound syntax expands into a set of two (or more) bounds, and never anything else (see "How does this differ[...]" section for more info).

Associated type bounds are stabilized in four positions:
* **`where` clauses (and APIT)** - This is equivalent to breaking up the bound into two (or more) `where` clauses. For example, `where T: Trait<Assoc: Bound>` is equivalent to `where T: Trait, <T as Trait>::Assoc: Bound`.
* **Supertraits** - Similar to above, `trait CopyIterator: Iterator<Item: Copy> {}`. This is almost equivalent to breaking up the bound into two (or more) `where` clauses; however, the bound on the associated item is implied whenever the trait is used. See #112573/#112629.
* **Associated type item bounds** - This allows constraining the *nested* rigid projections that are associated with a trait's associated types. e.g. `trait Trait { type Assoc: Trait2<Assoc2: Copy>; }`.
* **opaque item bounds (RPIT, TAIT)** - This allows constraining associated types that are associated with the opaque without having to *name* the opaque. For example, `impl Iterator<Item: Copy>` defines an iterator whose item is `Copy` without having to actually name that item bound.

The latter three are not expressible in surface Rust (though for associated type item bounds, this will change in #120752, which I don't believe should block this PR), so this does represent a slight expansion of what can be expressed in trait bounds.

### How does this differ from the RFC?

Compared to the RFC, the current implementation *always* desugars associated type bounds to sets of `ty::Clause`s internally. Specifically, it does *not* introduce a position-dependent desugaring as laid out in [RFC 2289], and in particular:
* It does *not* desugar to anonymous associated items in associated type item bounds.
* It does *not* desugar to nested RPITs in RPIT bounds, nor nested TAITs in TAIT bounds.

This position-dependent desugaring laid out in the RFC existed simply to side-step limitations of the trait solver, which have mostly been fixed in #120584. The desugaring laid out in the RFC also added unnecessary complication to the design of the feature, and introduces its own limitations to, for example:
* Conditionally lowering to nested `impl Trait` in certain positions such as RPIT and TAIT means that we inherit the limitations of RPIT/TAIT, namely lack of support for higher-ranked opaque inference. See this code example: https://github.com/rust-lang/rust/pull/120752#issuecomment-1979412531.
* Introducing anonymous associated types makes traits no longer object safe, since anonymous associated types are not nameable, and all associated types must be named in `dyn` types.

This last point motivates why this PR is *not* stabilizing support for associated type bounds in `dyn` types, e.g, `dyn Assoc<Item: Bound>`. Why? Because `dyn` types need to have *concrete* types for all associated items, this would necessitate a distinct lowering for associated type bounds, which seems both complicated and unnecessary compared to just requiring the user to write `impl Trait` themselves. See #120719.

### Implementation history:

Limited to the significant behavioral changes and fixes and relevant PRs, ping me if I left something out--
* #57428
* #108063
* #110512
* #112629
* #120719
* #120584

Closes #52662

[RFC 2289]: https://rust-lang.github.io/rfcs/2289-associated-type-bounds.html
2024-03-19 00:04:09 +00:00
Erik Desjardins
ff2b405a3c revert changes and just delete the fixme
Avoiding the naming didn't have any meaningful perf impact.
2024-03-16 11:11:53 -04:00
antoyo
7ff5d39980
Merge pull request #469 from tempdragon/master
Clippy related fixes
2024-03-16 10:34:22 -04:00
tempdragon
0a493514d7 fix(lifetime): Add lifetimes back. 2024-03-16 21:30:04 +08:00
tempdragon
3b01fba0f5 fix(intrinsic/mod.rs): Update comments 2024-03-16 21:16:41 +08:00
tempdragon
4e4efb9b9e feat(ci): Add clippy check for both master and non-master 2024-03-16 12:30:52 +08:00
tempdragon
89acb108b4 feat(ci): Install clippy in ci.yml(But no testing)
Done incrementally to avoid potential failure.
2024-03-16 12:24:05 +08:00
tempdragon
225a32f7d0 Revert "feat(CI): Add clippy check to workflow."
This reverts commit f6cab2cd1e.
2024-03-16 12:14:01 +08:00
tempdragon
653118e797 feat(clippy): Suppress lint suspicious_else_formatting temporarily 2024-03-16 12:08:39 +08:00
tempdragon
f6cab2cd1e feat(CI): Add clippy check to workflow. 2024-03-16 12:05:56 +08:00
tempdragon
390f9064e1 revert(lifetime): Add "needless" lifetime(s) and allow it in clippy
This reverts commit ad97b8c061.
2024-03-16 10:17:35 +08:00
tempdragon
878f572d0e fix(comments): Add some info and revert else if
1. Put the `else if` comment in intrinsic/mod.rs away
2. Add TODO to debuginfo.rs in `make_mir_scope()`
2024-03-16 10:07:52 +08:00
tempdragon
817d2f298e fix(pattern_type_mismatch)): Fix mismatch with ref/deref 2024-03-16 09:43:16 +08:00
Erik Desjardins
9476fe7c3b avoid naming LLVM basic blocks when fewer_names is true 2024-03-15 15:53:49 -04:00
antoyo
b5d61f1c9e
Merge pull request #471 from GuillaumeGomez/intrinsics-conversions
Regen intrinsics conversions
2024-03-14 14:28:03 -04:00
Guillaume Gomez
6c9156717e Regen intrinsics conversions 2024-03-13 16:44:54 +01:00
Arthur Carcano
a64942a3e9 Mark codegen_gcc fields used only on feature master as such
The dead_code lint was previously eroneously missing those.
Since this lint bug has been fixed, the unused fields need
to be feature gated.
2024-03-12 10:59:41 +01:00
Oli Scherer
e7795ed0fe Some comment nits 2024-03-12 08:51:20 +00:00
Oli Scherer
6d573e9e31 Ensure nested allocations in statics do not get deduplicated 2024-03-12 05:53:46 +00:00
Oli Scherer
8fdfbf54ff Make some functions private that are only ever used in the same module 2024-03-12 05:53:46 +00:00
Oli Scherer
e3a9b1dbec Check whether a static is mutable instead of passing it down 2024-03-12 05:53:46 +00:00
Guillaume Gomez
be24d391bc Use published gccjit dependency instead of git repository 2024-03-11 16:29:00 +01:00
Jacob Pratt
a6202e2a77 Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
Expose the Freeze trait again (unstably) and forbid implementing it manually

non-emoji version of https://github.com/rust-lang/rust/pull/121501

cc #60715

This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue.

It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: https://github.com/google/zerocopy/issues/941

cc ```@RalfJung```

T-lang signed off on reexposing this unstably: https://github.com/rust-lang/rust/pull/121501#issuecomment-1969827742
2024-03-11 03:47:19 -04:00
tempdragon
a7d39b852a fix(from_low_high): Renamed according to clippy requirements
Changed for clippy naming convention requirement:
```
warning: methods called `from_*` usually take no `self`
   --> src/int.rs:996:22
    |
996 |     fn from_low_high(&self, typ: Type<'gcc>, low: i64, high: i64) -> RValue<'gcc> {
    |                      ^^^^^
    |
    = help: consider choosing a less ambiguous name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
    = note: `#[warn(clippy::wrong_self_convention)]` on by default
```
2024-03-11 12:55:28 +08:00
tempdragon
3fd9db31bf fix(fmt): Rewrite a condition according to clippy
This looks like an (inverted) exclusive-or but I still leave it as it is in clippy.
2024-03-11 12:41:37 +08:00
tempdragon
d2cda90e4e fix(clippy): redundant variables in simd.rs 2024-03-11 12:36:39 +08:00
tempdragon
091de55db8 fix(fmt): Try to comply to the format requirement 2024-03-11 12:31:16 +08:00
tempdragon
ad97b8c061 fix(liftime): Gen. by cargo clippy
cmd: `cargo clippy --fix --lib -p rustc_codegen_gcc --allow-dirtyxs`
2024-03-11 12:20:36 +08:00
tempdragon
8d4d87859b fix(clippy): Clone-related clippy workarounds
1. Use `clone_from` in place of `clone()` in `builder.rs`
2. Change `&name` to `name.clone()` in `debuginfo.rs`(Is this really
efficient? But I can't find other workarounds.)
2024-03-11 12:13:30 +08:00
tempdragon
c6b75581d0 fix(declare.rs): Clone name when buiding without the master feat. 2024-03-11 10:24:22 +08:00
tempdragon
9ea3c19055 fix(fmt/style): Further apply Clippy suggestions manually
1. Fix Pattern Type Mismatch by Adding deref's
2. Move commented `else if` to previous block in `intrinsic.rs`
2024-03-11 10:24:22 +08:00
tempdragon
6f76488b2f fix(fmt/style): Remove unncessary clones, into's and deref's 2024-03-11 10:24:22 +08:00
bors
0031b219b6 Auto merge of #122132 - nnethercote:diag-renaming3, r=nnethercote
Diagnostic renaming 3

A sequel to https://github.com/rust-lang/rust/pull/121780.

r? `@davidtwco`
2024-03-11 00:34:44 +00:00
antoyo
47207949ae
Merge pull request #468 from GuillaumeGomez/sync
Sync Rust 2024-03-10
2024-03-10 18:57:50 -04:00
Guillaume Gomez
ca883bdbe4 Remove unused files 2024-03-10 23:34:00 +01:00
Nicholas Nethercote
915646fe79 Rename IntoDiagnostic as Diagnostic.
To match `derive(Diagnostic)`.

Also rename `into_diagnostic` as `into_diag`.
2024-03-11 09:15:09 +11:00
Guillaume Gomez
ba52317518 Add code comment about the --backend option usage 2024-03-10 22:10:05 +01:00
Guillaume Gomez
fc2d1edad7 Add new failing tests 2024-03-10 22:08:21 +01:00
Guillaume Gomez
f7622d11a7 fmt 2024-03-10 22:08:21 +01:00
Guillaume Gomez
45aa965bd5 Update rustc version to 2024-03-10 2024-03-10 17:19:48 +01:00
Guillaume Gomez
5a89328710 Merge branch 'master' into sync_branch_name 2024-03-10 17:18:06 +01:00
Ralf Jung
dd9407dcbe use Instance::expect_resolve() instead of unwraping Instance::resolve() 2024-03-10 11:49:33 +01:00