rust/tests/ui/lint/non-local-defs/cargo-update.rs
Urgau 0c0dfb88ee Switch back non_local_definitions lint to allow-by-default
as request T-lang is requesting some major changes in the lint inner
workings in #126768#issuecomment-2192634762
2024-06-27 08:05:07 +02:00

23 lines
574 B
Rust

//@ check-pass
//@ edition:2021
//@ aux-build:non_local_macro.rs
//
// To suggest any Cargo specific help/note rustc wants
// the `CARGO_CRATE_NAME` env to be set, so we set it
//@ rustc-env:CARGO_CRATE_NAME=non_local_def
//
// and since we specifically want to check the presence
// of the `cargo update` suggestion we assert it here.
//@ error-pattern: `cargo update -p non_local_macro`
#![warn(non_local_definitions)]
extern crate non_local_macro;
struct LocalStruct;
non_local_macro::non_local_impl!(LocalStruct);
//~^ WARN non-local `impl` definition
fn main() {}