]> git.lizzy.rs Git - rust.git/commit
rustc: Disallow machine applicability in foreign macros
authorAlex Crichton <alex@alexcrichton.com>
Thu, 26 Jul 2018 21:53:15 +0000 (14:53 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 30 Jul 2018 14:48:59 +0000 (07:48 -0700)
commitca762ba9547649f57e2d8a3e56b83d0a6298fbb2
tree62c5b96306e300e3bed07f9a98ef99a5c80811bb
parent54628c8ea844956f3f4f416b82067c634eb09f7b
rustc: Disallow machine applicability in foreign macros

Recent changes to lints disallowed lints from being emitted against code located
in foreign macros, except for future-incompatible lints. For a future
incompatible lint, however, the automatic suggestions may not be applicable!

This commit updates this code path to force all applicability suggestions made
to foreign macros to never be `MachineApplicable`. This should avoid rustfix
actually attempting fixing these suggestions, causing non-compiling code to be
produced.

Closes rust-lang/cargo#5799
src/librustc/lint/mod.rs
src/librustc_errors/diagnostic_builder.rs
src/test/ui-fulldeps/rust-2018/auxiliary/suggestions-not-always-applicable.rs [new file with mode: 0644]
src/test/ui-fulldeps/rust-2018/suggestions-not-always-applicable.fixed [new file with mode: 0644]
src/test/ui-fulldeps/rust-2018/suggestions-not-always-applicable.rs [new file with mode: 0644]
src/test/ui-fulldeps/rust-2018/suggestions-not-always-applicable.stderr [new file with mode: 0644]
src/tools/compiletest/src/header.rs
src/tools/compiletest/src/runtest.rs