parser: Fix handling of #[path] attributes inside inline submodules.

As seen in hashbrown:

    #[cfg(feature = "raw")]
    /// Experimental and unsafe `RawTable` API. This module is only available if the
    /// `raw` feature is enabled.
    pub mod raw {
        // The RawTable API is still experimental and is not properly documented yet.
        #[allow(missing_docs)]
        #[path = "mod.rs"]
        mod inner;
        pub use inner::*;

        #[cfg(feature = "rayon")]
        pub mod rayon {
            pub use crate::external_trait_impls::rayon::raw::*;
        }
    }
This commit is contained in:
Emilio Cobos Álvarez
2021-04-07 12:37:05 +02:00
parent 54dfcf89e4
commit 52de917d25
23 changed files with 96 additions and 9 deletions
+2
View File
@@ -10,3 +10,5 @@ typedef struct ExportMe {
} ExportMe;
void export_me(struct ExportMe *val);
void from_really_nested_mod(void);
@@ -15,6 +15,8 @@ extern "C" {
void export_me(struct ExportMe *val);
void from_really_nested_mod(void);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+2
View File
@@ -10,3 +10,5 @@ typedef struct {
} ExportMe;
void export_me(ExportMe *val);
void from_really_nested_mod(void);
+2
View File
@@ -15,6 +15,8 @@ extern "C" {
void export_me(ExportMe *val);
void from_really_nested_mod(void);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+2
View File
@@ -14,4 +14,6 @@ extern "C" {
void export_me(ExportMe *val);
void from_really_nested_mod();
} // extern "C"
+2
View File
@@ -12,3 +12,5 @@ cdef extern from *:
uint64_t val;
void export_me(ExportMe *val);
void from_really_nested_mod();
+2
View File
@@ -10,3 +10,5 @@ struct ExportMe {
};
void export_me(struct ExportMe *val);
void from_really_nested_mod(void);
+2
View File
@@ -15,6 +15,8 @@ extern "C" {
void export_me(struct ExportMe *val);
void from_really_nested_mod(void);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+2
View File
@@ -12,3 +12,5 @@ cdef extern from *:
uint64_t val;
void export_me(ExportMe *val);
void from_really_nested_mod();
+2
View File
@@ -16,3 +16,5 @@ typedef struct ExportMe2 {
void export_me(struct ExportMe *val);
void export_me_2(struct ExportMe2*);
void from_really_nested_mod(void);
@@ -21,6 +21,8 @@ void export_me(struct ExportMe *val);
void export_me_2(struct ExportMe2*);
void from_really_nested_mod(void);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+2
View File
@@ -16,3 +16,5 @@ typedef struct {
void export_me(ExportMe *val);
void export_me_2(ExportMe2*);
void from_really_nested_mod(void);
+2
View File
@@ -21,6 +21,8 @@ void export_me(ExportMe *val);
void export_me_2(ExportMe2*);
void from_really_nested_mod(void);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+2
View File
@@ -20,4 +20,6 @@ void export_me(ExportMe *val);
void export_me_2(ExportMe2*);
void from_really_nested_mod();
} // extern "C"
+2
View File
@@ -17,3 +17,5 @@ cdef extern from *:
void export_me(ExportMe *val);
void export_me_2(ExportMe2*);
void from_really_nested_mod();
+2
View File
@@ -16,3 +16,5 @@ struct ExportMe2 {
void export_me(struct ExportMe *val);
void export_me_2(struct ExportMe2*);
void from_really_nested_mod(void);
+2
View File
@@ -21,6 +21,8 @@ void export_me(struct ExportMe *val);
void export_me_2(struct ExportMe2*);
void from_really_nested_mod(void);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
+2
View File
@@ -17,3 +17,5 @@ cdef extern from *:
void export_me(ExportMe *val);
void export_me_2(ExportMe2*);
void from_really_nested_mod();
+5
View File
@@ -1 +1,6 @@
pub mod other;
mod other3 {
#[path = "other4.rs"]
mod other4;
}
@@ -0,0 +1,2 @@
#[no_mangle]
pub unsafe extern "C" fn from_really_nested_mod() { }
+5
View File
@@ -2,3 +2,8 @@ pub mod other;
#[path = "other2.rs"]
pub mod other2;
pub mod other3 {
#[path = "other4.rs"]
pub mod other4;
}
@@ -0,0 +1,2 @@
#[no_mangle]
pub unsafe extern "C" fn from_really_nested_mod() { }