Account for let foo = expr; to suggest const foo: Ty = expr; · rust-lang/rust@cbe7548 (original) (raw)

`@@ -376,8 +376,8 @@ LL | asm!("{}", options(), const foo);

`

376

376

` |

`

377

377

`` help: consider using const instead of let

``

378

378

` |

`

379

``

`-

LL | const foo = 0;

`

380

``

`-

| ~~~~~

`

``

379

`+

LL | const foo: /* Type */ = 0;

`

``

380

`+

| ~~~~~ ++++++++++++

`

381

381

``

382

382

`error[E0435]: attempt to use a non-constant value in a constant

`

383

383

` --> $DIR/parse-error.rs:71:44

`

`@@ -387,8 +387,8 @@ LL | asm!("{}", clobber_abi("C"), const foo);

`

387

387

` |

`

388

388

`` help: consider using const instead of let

``

389

389

` |

`

390

``

`-

LL | const foo = 0;

`

391

``

`-

| ~~~~~

`

``

390

`+

LL | const foo: /* Type */ = 0;

`

``

391

`+

| ~~~~~ ++++++++++++

`

392

392

``

393

393

`error[E0435]: attempt to use a non-constant value in a constant

`

394

394

` --> $DIR/parse-error.rs:74:55

`

`@@ -398,8 +398,8 @@ LL | asm!("{}", options(), clobber_abi("C"), const foo);

`

398

398

` |

`

399

399

`` help: consider using const instead of let

``

400

400

` |

`

401

``

`-

LL | const foo = 0;

`

402

``

`-

| ~~~~~

`

``

401

`+

LL | const foo: /* Type */ = 0;

`

``

402

`+

| ~~~~~ ++++++++++++

`

403

403

``

404

404

`error[E0435]: attempt to use a non-constant value in a constant

`

405

405

` --> $DIR/parse-error.rs:76:31

`

`@@ -409,8 +409,8 @@ LL | asm!("{a}", a = const foo, a = const bar);

`

409

409

` |

`

410

410

`` help: consider using const instead of let

``

411

411

` |

`

412

``

`-

LL | const foo = 0;

`

413

``

`-

| ~~~~~

`

``

412

`+

LL | const foo: /* Type */ = 0;

`

``

413

`+

| ~~~~~ ++++++++++++

`

414

414

``

415

415

`error[E0435]: attempt to use a non-constant value in a constant

`

416

416

` --> $DIR/parse-error.rs:76:46

`

`@@ -420,8 +420,8 @@ LL | asm!("{a}", a = const foo, a = const bar);

`

420

420

` |

`

421

421

`` help: consider using const instead of let

``

422

422

` |

`

423

``

`-

LL | const bar = 0;

`

424

``

`-

| ~~~~~

`

``

423

`+

LL | const bar: /* Type */ = 0;

`

``

424

`+

| ~~~~~ ++++++++++++

`

425

425

``

426

426

`error: aborting due to 64 previous errors

`

427

427

``