rust/tests/ui-fulldeps/internal-lints/span_use_eq_ctxt.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
347 B
Rust
Raw Normal View History

2023-10-16 03:05:11 -05:00
// Test the `rustc::span_use_eq_ctxt` internal lint
2023-09-25 02:15:00 -05:00
// compile-flags: -Z unstable-options
#![feature(rustc_private)]
#![deny(rustc::span_use_eq_ctxt)]
2023-10-16 03:05:11 -05:00
#![crate_type = "lib"]
2023-09-25 02:15:00 -05:00
extern crate rustc_span;
use rustc_span::Span;
pub fn f(s: Span, t: Span) -> bool {
2023-10-16 03:05:11 -05:00
s.ctxt() == t.ctxt() //~ ERROR use `.eq_ctxt()` instead of `.ctxt() == .ctxt()`
2023-09-25 02:15:00 -05:00
}