public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #785
@ 2022-06-08 11:47 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 11:47 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8e992e371bbd896c8b605e1ebade5cad80b1b411

commit 8e992e371bbd896c8b605e1ebade5cad80b1b411
Merge: 674221a3b27 1657ee53d57
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Wed Nov 3 18:00:24 2021 +0000

    Merge #785
    
    785: rust: track inline module scopes for module file resolution r=CohenArthur a=mathstuf
    
    The set of inline modules is required to find the expected location of a
    module file. Track this information with an RAII object
    (`InlineModuleStackScope`) and pass it down to any out-of-line modules
    so that, when requested, the set of inline modules can be added to the
    search path.
    
    Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
    
    ---
    Note that this does not include a test case because I have no idea how to mark up this for all the warnings that come out (#676):
    
    ```diff
    diff --git a/gcc/testsuite/rust/compile/missing_middle/sub/mod.rs b/gcc/testsuite/rust/compile/missing_middle/sub/mod.rs
    new file mode 100644
    index 00000000000..f099d61e04a
    --- /dev/null
    +++ b/gcc/testsuite/rust/compile/missing_middle/sub/mod.rs
    `@@` -0,0 +1,3 `@@`
    +pub fn f() -> u32 {
    +    1
    +}
    diff --git a/gcc/testsuite/rust/compile/mod_missing_middle.rs b/gcc/testsuite/rust/compile/mod_missing_middle.rs
    new file mode 100644
    index 00000000000..d9cdf0a54f1
    --- /dev/null
    +++ b/gcc/testsuite/rust/compile/mod_missing_middle.rs
    `@@` -0,0 +1,11 `@@`
    +pub mod missing_middle {
    +    pub mod sub;
    +}
    ```
    
    Observed warnings:
    
    ```
    /home/boeckb/code/depot/group-compilers/gcc/src-gccrs/gcc/testsuite/rust/compile/missing_middle/sub/mod.rs:1:5: warning: unused name 'f'
    /home/boeckb/code/depot/group-compilers/gcc/src-gccrs/gcc/testsuite/rust/compile/mod_missing_middle.rs:2:9: warning: unused name 'sub'
    /home/boeckb/code/depot/group-compilers/gcc/src-gccrs/gcc/testsuite/rust/compile/missing_middle/sub/mod.rs:1:5: warning: unused name 'sub::f'
    /home/boeckb/code/depot/group-compilers/gcc/src-gccrs/gcc/testsuite/rust/compile/mod_missing_middle.rs:2:9: warning: unused name 'missing_middle::sub'
    /home/boeckb/code/depot/group-compilers/gcc/src-gccrs/gcc/testsuite/rust/compile/mod_missing_middle.rs:1:5: warning: unused name 'missing_middle'
    /home/boeckb/code/depot/group-compilers/gcc/src-gccrs/gcc/testsuite/rust/compile/missing_middle/sub/mod.rs:1:5: warning: unused name 'missing_middle::sub::f'
    ```
    
    Fixes: #645
    
    Here is a checklist to help you with your PR.
    
    - \[x] GCC development requires copyright assignment or the Developer's Certificate of Origin sign-off, see https://gcc.gnu.org/contribute.html or https://gcc.gnu.org/dco.html
    - \[x] Read contributing guidlines
    - \[x] `make check-rust` passes locally
    - \[x] Run `clang-format` (leaving to CI)
    - \[x] Added any relevant test cases to `gcc/testsuite/rust/` (see above)
    
    Co-authored-by: Ben Boeckel <mathstuf@gmail.com>

Diff:

 gcc/rust/ast/rust-ast-full-test.cc                 | 71 ++++++---------------
 gcc/rust/ast/rust-item.h                           | 11 +++-
 gcc/rust/parse/rust-parse-impl.h                   |  8 ++-
 gcc/rust/parse/rust-parse.cc                       | 73 ++++++++++++++++++++++
 gcc/rust/parse/rust-parse.h                        | 19 ++++++
 .../rust/compile/missing_middle/both_path.rs       |  3 +
 .../rust/compile/missing_middle/explicit.not.rs    |  1 +
 .../rust/compile/missing_middle/inner_path.rs      |  3 +
 gcc/testsuite/rust/compile/missing_middle/other.rs |  3 +
 .../rust/compile/missing_middle/outer_path.rs      |  3 +
 .../rust/compile/missing_middle/sub/mod.rs         |  3 +
 gcc/testsuite/rust/compile/mod_missing_middle.rs   | 29 +++++++++
 12 files changed, 169 insertions(+), 58 deletions(-)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 11:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:47 [gcc/devel/rust/master] Merge #785 Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).