Closed
Description
Given code such as:
#![crate_type = "rlib"]
#![cfg_attr(crate_level, allow(elided_lifetimes_in_paths))]
#![cfg_attr(crate_level_warnings, allow(warnings))]
mod foo {
#![allow(elided_lifetimes_in_paths)]
#![allow(warnings)]
use std::fmt::*;
struct A;
impl Debug for A {
fn fmt(&self, _f: &mut Formatter) -> Result {
Ok(())
}
}
}
When compiled this generates a warning:
$ rustc +nightly foo.rs -W elided_lifetimes_in_paths
warning: hidden lifetime parameters in types are deprecated
...
I'm not entirely sure why the directives inside mod foo
aren't taking effect. The crate-level ones do take effect, as can be seen with:
$ rustc +nightly foo.rs -W elided_lifetimes_in_paths --cfg crate_level
$ rustc +nightly foo.rs -W elided_lifetimes_in_paths --cfg crate_level_warnings
(no warnings)