Repository: rust
Issue: include!()-ing stuff that uses $[macro_export(local_inner_macros)] triggers #[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]
Labels: A-lints,A-macros,T-compiler,C-bug

### Summary

The following code compiles:
```rust
#[macro_use]
mod some_mod {
    #[macro_export(local_inner_macros)]
    macro_rules! mac {
        () => { _mac_impl!() };
    }
    #[macro_export(local_inner_macros)]
    macro_rules! _mac_impl {
        () => { 3 };
    }
}

fn main() {
    assert_eq!(3, mac!());
}
```

But if you move the contents of the submodule into another file and `include!()` it, it triggers an error:

```rust
#[macro_use]
mod some_mod {
    // a file that contains exactly the former contents of this module
    include!("some-mod-contents.rs");
}

fn main() {
    assert_eq!(3, mac!());
}
```

### Reproduction case

<details>
<summary>Shell script to create and run a reproduction case</summary>

```bash
#!/usr/bin/env bash

rm -rf testcase
cargo new --bin testcase || exit 1
cd testcase || exit 1

cat >generated.rs <<'HERE'
#[macro_export(local_inner_macros)]
macro_rules! generated {
    () => { _generated_impl!() };
}
#[macro_export(local_inner_macros)]
macro_rules! _generated_impl {
    () => { 3 };
}
HERE

cat >src/main.rs <<'HERE'
#[macro_use]
mod plain_mod {
    #[macro_export(local_inner_macros)]
    macro_rules! plain {
        () => { _plain_impl!() };
    }
    #[macro_export(local_inner_macros)]
    macro_rules! _plain_impl {
        () => { 3 };
    }
}

#[macro_use]
mod generated_mod {
    include!("../generated.rs");
}

fn main() {
    println!("{}", plain!());  // this works
    println!("{}", generated!());  // this doesn't
}
HERE

cargo run
```

</details>

### Current compiler output (for reproduction case)

```
   Compiling testcase v0.1.0 (/mnt/f/asd/clone/minimize/testcase)
error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
  --> src/../generated.rs:3:13
   |
3  |     () => { _generated_impl!() };
   |             ^^^^^^^^^^^^^^^
   |
  ::: src/main.rs:20:20
   |
20 |     println!("{}", generated!());
   |                    ------------ in this macro invocation
   |
   = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
note: the macro is defined here
  --> src/../generated.rs:6:1
   |
6  | / macro_rules! _generated_impl {
7  | |     () => { 3 };
8  | | }
   | |_^
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

error: could not compile `testcase`

To learn more, run the command again with --verbose.
```

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.51.0-nightly (bc39d4d9c 2021-01-15)
binary: rustc
commit-hash: bc39d4d9c514e5fdb40a5782e6ca08924f979c35
commit-date: 2021-01-15
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0
```
Running on Windows in WSL 1.