<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/mir-opt/dataflow-const-prop/enum.rs, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-08-18T22:52:23+00:00</updated>
<entry>
<title>Update mir-opt filechecks</title>
<updated>2024-08-18T22:52:23+00:00</updated>
<author>
<name>Scott McMurray</name>
<email>scottmcm@users.noreply.github.com</email>
</author>
<published>2024-08-18T22:51:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=249a36ffbd577fc76153b7ad4cafd33607ee4ddc'/>
<id>urn:sha1:249a36ffbd577fc76153b7ad4cafd33607ee4ddc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use `-Zdump-mir-exclude-alloc-bytes` in some mir-opt tests</title>
<updated>2024-06-26T22:05:01+00:00</updated>
<author>
<name>Josh Stone</name>
<email>jistone@redhat.com</email>
</author>
<published>2024-06-14T23:01:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1a05cb2d9358879468c87645b0c1d5d1e8e12a12'/>
<id>urn:sha1:1a05cb2d9358879468c87645b0c1d5d1e8e12a12</id>
<content type='text'>
</content>
</entry>
<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>MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way</title>
<updated>2024-03-10T13:59:41+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-03-10T13:05:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7d99e80c55486780b59c3b947b20e72344a3bdb2'/>
<id>urn:sha1:7d99e80c55486780b59c3b947b20e72344a3bdb2</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>Always evaluate free constants and statics, even if previous errors occurred</title>
<updated>2024-02-19T22:11:13+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2024-02-14T12:28:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=90626979170da2d6c5ec1622b3d7a9512df9eb71'/>
<id>urn:sha1:90626979170da2d6c5ec1622b3d7a9512df9eb71</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Start blocks eagerly</title>
<updated>2024-02-12T16:37:05+00:00</updated>
<author>
<name>Nadrieril</name>
<email>nadrieril+git@gmail.com</email>
</author>
<published>2024-02-12T03:56:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=faaf81bbbcd5114ad8268190f3cc235868997ae3'/>
<id>urn:sha1:faaf81bbbcd5114ad8268190f3cc235868997ae3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>update enum.rs</title>
<updated>2024-01-23T01:34:49+00:00</updated>
<author>
<name>sfzhu93</name>
<email>zhushuofei@gmail.com</email>
</author>
<published>2024-01-23T01:34:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=65b10839d6cc033d65831666565ffda5077793f8'/>
<id>urn:sha1:65b10839d6cc033d65831666565ffda5077793f8</id>
<content type='text'>
</content>
</entry>
</feed>
