<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/mir-opt/copy-prop/move_projection.rs, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-06-03T04:17:16+00:00</updated>
<entry>
<title>rustfmt `tests/mir-opt`.</title>
<updated>2024-06-03T04:17:16+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-06-03T00:18:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c9c80d2c5f3f07d18c90128e92771355111dff20'/>
<id>urn:sha1:c9c80d2c5f3f07d18c90128e92771355111dff20</id>
<content type='text'>
The only non-obvious changes:
- `building/storage_live_dead_in_statics.rs` has a `#[rustfmt::skip]`
  attribute to avoid reformating a table of data.
- Two `.mir` files have slight changes involving line numbers.
- In `unusual_item_types.rs` an `EMIT_MIR` annotation is moved to
  outside a function, which is the usual spot, because `tidy` complains
  if such a comment is indented.

The commit also tweaks the comments in `rustfmt.toml`.
</content>
</entry>
<entry>
<title>Reformat `mir!` macro invocations to use braces.</title>
<updated>2024-06-03T03:24:44+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-06-03T00:19:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ac242996366cd0d1ec48ff76638320969c65bed3'/>
<id>urn:sha1:ac242996366cd0d1ec48ff76638320969c65bed3</id>
<content type='text'>
The `mir!` macro has multiple parts:
- An optional return type annotation.
- A sequence of zero or more local declarations.
- A mandatory starting anonymous basic block, which is brace-delimited.
- A sequence of zero of more additional named basic blocks.

Some `mir!` invocations use braces with a "block" style, like so:
```
mir! {
    let _unit: ();
    {
	let non_copy = S(42);
	let ptr = std::ptr::addr_of_mut!(non_copy);
	// Inside `callee`, the first argument and `*ptr` are basically
	// aliasing places!
	Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue())
    }
    after_call = {
	Return()
    }
}
```
Some invocations use parens with a "block" style, like so:
```
mir!(
    let x: [i32; 2];
    let one: i32;
    {
	x = [42, 43];
	one = 1;
	x = [one, 2];
	RET = Move(x);
	Return()
    }
)
```
And some invocations uses parens with a "tighter" style, like so:
```
mir!({
    SetDiscriminant(*b, 0);
    Return()
})
```
This last style is generally used for cases where just the mandatory
starting basic block is present. Its braces are placed next to the
parens.

This commit changes all `mir!` invocations to use braces with a "block"
style. Why?

- Consistency is good.

- The contents of the invocation is a block of code, so it's odd to use
  parens. They are more normally used for function-like macros.

- Most importantly, the next commit will enable rustfmt for
  `tests/mir-opt/`. rustfmt is more aggressive about formatting macros
  that use parens than macros that use braces. Without this commit's
  changes, rustfmt would break a couple of `mir!` macro invocations that
  use braces within `tests/mir-opt` by inserting an extraneous comma.
  E.g.:
  ```
  mir!(type RET = (i32, bool);, { // extraneous comma after ';'
      RET.0 = 1;
      RET.1 = true;
      Return()
  })
  ```
  Switching those `mir!` invocations to use braces avoids that problem,
  resulting in this, which is nicer to read as well as being valid
  syntax:
  ```
  mir! {
      type RET = (i32, bool);
      {
	  RET.0 = 1;
	  RET.1 = true;
	  Return()
      }
  }
  ```
</content>
</entry>
<entry>
<title>mir-opt tests: rename unit-test -&gt; test-mir-pass</title>
<updated>2024-04-20T11:19:34+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-04-20T11:19:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=75d0fdd96713874703998cb06dae67ab09b7897e'/>
<id>urn:sha1:75d0fdd96713874703998cb06dae67ab09b7897e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives</title>
<updated>2024-02-22T16:04:04+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2024-02-22T12:10:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6e48b96692d63a79a14563f27fe5185f122434f8'/>
<id>urn:sha1:6e48b96692d63a79a14563f27fe5185f122434f8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix validation and linting of injected MIR</title>
<updated>2024-01-04T22:06:42+00:00</updated>
<author>
<name>Tomasz Miąsko</name>
<email>tomasz.miasko@gmail.com</email>
</author>
<published>2024-01-01T00:00:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a084e063e690697a6ad46545a107228247024393'/>
<id>urn:sha1:a084e063e690697a6ad46545a107228247024393</id>
<content type='text'>
Reevaluate `body.should_skip()` after updating the MIR phase to ensure
that injected MIR is processed correctly.

Update a few custom MIR tests that were ill-formed for the injected
phase.
</content>
</entry>
<entry>
<title>custom mir: make it clear what the return block is</title>
<updated>2023-12-26T19:15:26+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2023-12-26T18:31:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0f9baa8a31a4bf4d38ff90e402d43f0cd19662a8'/>
<id>urn:sha1:0f9baa8a31a4bf4d38ff90e402d43f0cd19662a8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Custom MIR: Support cleanup blocks</title>
<updated>2023-11-14T07:23:58+00:00</updated>
<author>
<name>Tomasz Miąsko</name>
<email>tomasz.miasko@gmail.com</email>
</author>
<published>2023-11-09T00:00:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=78da5776509f4e646a664de3ee7041f8008d5931'/>
<id>urn:sha1:78da5776509f4e646a664de3ee7041f8008d5931</id>
<content type='text'>
Cleanup blocks are declared with `bb (cleanup) = { ... }`.

`Call` and `Drop` terminators take an additional argument describing the
unwind action, which is one of the following:

* `UnwindContinue()`
* `UnwindUnreachable()`
* `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup`
* `UnwindCleanup(block)`

Also support unwind resume and unwind terminate terminators:

* `UnwindResume()`
* `UnwindTerminate(reason)`
</content>
</entry>
<entry>
<title>Allow to run filecheck in mir-opt tests.</title>
<updated>2023-10-19T15:51:52+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2023-10-16T17:36:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4ff03cd1a49dbf08f24c7054d4fd478e87c3a4de'/>
<id>urn:sha1:4ff03cd1a49dbf08f24c7054d4fd478e87c3a4de</id>
<content type='text'>
</content>
</entry>
<entry>
<title>custom_mir: change Call() terminator syntax to something more readable</title>
<updated>2023-08-19T20:41:33+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2023-08-19T16:08:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a6346660e8587fa4c92dc846fdcd8f3bc828ac3'/>
<id>urn:sha1:7a6346660e8587fa4c92dc846fdcd8f3bc828ac3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>properly mark tests that require panic=abort</title>
<updated>2023-06-12T07:34:15+00:00</updated>
<author>
<name>Pietro Albini</name>
<email>pietro.albini@ferrous-systems.com</email>
</author>
<published>2023-06-08T07:18:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=070cc836e95517fff04699ceb9f85ec017befc58'/>
<id>urn:sha1:070cc836e95517fff04699ceb9f85ec017befc58</id>
<content type='text'>
</content>
</entry>
</feed>
