about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-09-29 10:11:12 +0200
committerGitHub <noreply@github.com>2023-09-29 10:11:12 +0200
commitf777e8cf22c5094e2f0801a50b1057de7b0e1606 (patch)
tree980d6911513829ba98abf0af98fca85d5ca225b7 /compiler/rustc_pattern_analysis/src
parentc1f86f0bc87eaa0cf16bcf3de38793096ec4db94 (diff)
parent598f11a1eebbb35f47907519dd59bd7a3d6c2e9e (diff)
downloadrust-f777e8cf22c5094e2f0801a50b1057de7b0e1606.tar.gz
rust-f777e8cf22c5094e2f0801a50b1057de7b0e1606.zip
Rollup merge of #116133 - pouriya:refactor-bootstrap.py, r=albertlarsan68
ref(bootstrap.py): add `eprint` function

Implemented a 3-line function called `eprint` which is just like `print` but for `stderr`. So each `print(..., file=sys.stderr)` becomes `eprint(...)`.

<br/>

Testing `eprint` function:
```sh
$ cat eprint.py
```
```python
import sys

def eprint(*args, **kwargs):
	kwargs['file'] = sys.stderr
	print(*args, **kwargs)

eval('eprint({})'.format(sys.argv[1]))
```
```sh
$ python3 eprint.py '"hello"'
hello
$
```
```sh
$ python3 eprint.py '"hello"' 2>/dev/null
$
```
```sh
$ python3 eprint.py '"hello", "world", flush=True, file=sys.stdout'
hello world
$
```
```sh
$ python3 eprint.py '"hello", "world", flush=True, file=sys.stdout' 2>/dev/null
$
```
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions