Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
71ebc61
resolve: Simplify `fn report_privacy_error`
petrochenkov Mar 7, 2020
580c6a2
resolve: Print import chains on privacy errors
petrochenkov Mar 7, 2020
f4083c6
Add the "consider importing it directly" label to public imports as well
petrochenkov Mar 11, 2020
e80cb20
resolve: Fix regression in resolution of raw keywords in paths
petrochenkov Mar 14, 2020
81099c2
VariantSizeDifferences: bail on SizeOverflow
Centril Mar 10, 2020
f53f9a8
Bump the bootstrap compiler
jonas-schievink Mar 15, 2020
ce5e49f
Use sublice patterns to avoid computing the len
tesuji Mar 16, 2020
e1bc9af
Fix wrong deref
tesuji Mar 16, 2020
7894509
Fiddle `ParamEnv` through to a place that used to use `ParamEnv::empt…
oli-obk Mar 16, 2020
a4125a6
submod_path_from_attr: simplify & document
Centril Mar 7, 2020
48b9526
extract error_cannot_declare_mod_here
Centril Mar 7, 2020
bbd2129
extract error_decl_mod_in_block
Centril Mar 7, 2020
7042554
simplify submod_path
Centril Mar 7, 2020
586c9b5
submod_path: use id.span
Centril Mar 7, 2020
d06031c
extract parse_mod
Centril Mar 7, 2020
a2a32c7
extract error_on_circular_module
Centril Mar 7, 2020
4d05f90
detach submod_path from Parser
Centril Mar 8, 2020
c824f5d
decouple push_directory from Parser
Centril Mar 8, 2020
4a70313
decouple eval_src_mod from Parser
Centril Mar 8, 2020
033f8a2
expand: use push_directory
Centril Mar 8, 2020
60a00b0
de-fatalize outline module parsing
Centril Mar 8, 2020
16d444a
extract parse_external_module
Centril Mar 8, 2020
a1f9953
extract error_on_circular_module
Centril Mar 8, 2020
97fa2bd
outline modules: parse -> expand.
Centril Mar 8, 2020
fb540a9
parse: module parsing -> item.rs
Centril Mar 8, 2020
e2cd4d0
move Directory -> parser::module
Centril Mar 8, 2020
e830157
{rustc_parse::parser -> rustc_expand}::module
Centril Mar 8, 2020
c16f0d3
{rustc_parse -> rustc_expand}::config
Centril Mar 8, 2020
2454395
add test for stripped nested outline module
Centril Mar 8, 2020
ed9d81e
parser/expand: minor cleanup
Centril Mar 9, 2020
9741bb6
tweak outline module parsing spans
Centril Mar 9, 2020
48b8ecc
use pretty-compare-only in a test
Centril Mar 10, 2020
998b33e
fix pre-expansion linting infra
Centril Mar 15, 2020
5cc4e94
fix rebase fallout
Centril Mar 15, 2020
9b26188
Rollup merge of #69811 - petrochenkov:privdiag2, r=estebank
Centril Mar 16, 2020
b158edc
Rollup merge of #69838 - Centril:expand-module, r=petrochenkov
Centril Mar 16, 2020
1e3b445
Rollup merge of #69881 - Centril:fix-69485, r=oli-obk
Centril Mar 16, 2020
6255941
Rollup merge of #70000 - petrochenkov:rawkeypars, r=davidtwco
Centril Mar 16, 2020
140529e
Rollup merge of #70029 - jonas-schievink:bootstrap, r=Centril
Centril Mar 16, 2020
a56761d
Rollup merge of #70046 - lzutao:patch-1, r=Centril
Centril Mar 16, 2020
c898394
Rollup merge of #70049 - oli-obk:param_env_empty_considered_unimpleme…
Centril Mar 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move Directory -> parser::module
  • Loading branch information
Centril committed Mar 16, 2020
commit e2cd4d0bfa723c0df9f68d8d3a7531ca5d7d5f3b
3 changes: 2 additions & 1 deletion src/librustc_expand/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use rustc_attr::{self as attr, Deprecation, HasAttrs, Stability};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::{self, Lrc};
use rustc_errors::{DiagnosticBuilder, DiagnosticId};
use rustc_parse::{self, parser, DirectoryOwnership, MACRO_ARGUMENTS};
use rustc_parse::parser::module::DirectoryOwnership;
use rustc_parse::{self, parser, MACRO_ARGUMENTS};
use rustc_session::parse::ParseSess;
use rustc_span::edition::Edition;
use rustc_span::hygiene::{AstPass, ExpnData, ExpnId, ExpnKind};
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_expand/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ use rustc_attr::{self as attr, is_builtin_attr, HasAttrs};
use rustc_errors::{Applicability, FatalError, PResult};
use rustc_feature::Features;
use rustc_parse::configure;
use rustc_parse::parser::module::{parse_external_mod, push_directory};
use rustc_parse::parser::module::{
parse_external_mod, push_directory, Directory, DirectoryOwnership,
};
use rustc_parse::parser::Parser;
use rustc_parse::validate_attr;
use rustc_parse::{Directory, DirectoryOwnership};
use rustc_session::lint::builtin::UNUSED_DOC_COMMENTS;
use rustc_session::lint::BuiltinLintDiagnostics;
use rustc_session::parse::{feature_err, ParseSess};
Expand Down
18 changes: 1 addition & 17 deletions src/librustc_parse/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc_errors::{Diagnostic, FatalError, Level, PResult};
use rustc_session::parse::ParseSess;
use rustc_span::{FileName, SourceFile, Span};

use std::path::{Path, PathBuf};
use std::path::Path;
use std::str;

use log::info;
Expand All @@ -29,22 +29,6 @@ pub mod validate_attr;
#[macro_use]
pub mod config;

#[derive(Clone)]
pub struct Directory {
pub path: PathBuf,
pub ownership: DirectoryOwnership,
}

#[derive(Copy, Clone)]
pub enum DirectoryOwnership {
Owned {
// None if `mod.rs`, `Some("foo")` if we're in `foo.rs`.
relative: Option<ast::Ident>,
},
UnownedViaBlock,
UnownedViaMod,
}

// A bunch of utility functions of the form `parse_<thing>_from_<source>`
// where <thing> includes crate, expr, item, stmt, tts, and one that
// uses a HOF to parse anything, and <source> includes file and
Expand Down
21 changes: 18 additions & 3 deletions src/librustc_parse/parser/module.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
use crate::{new_sub_parser_from_file, Directory, DirectoryOwnership};
use crate::new_sub_parser_from_file;

use rustc_ast::ast::{self, Attribute, Ident, Mod};
use rustc_ast::attr;
use rustc_ast::token;
use rustc_ast::{attr, token};
use rustc_errors::{struct_span_err, PResult};
use rustc_session::parse::ParseSess;
use rustc_span::source_map::{FileName, Span};
use rustc_span::symbol::sym;

use std::path::{self, Path, PathBuf};

#[derive(Clone)]
pub struct Directory {
pub path: PathBuf,
pub ownership: DirectoryOwnership,
}

#[derive(Copy, Clone)]
pub enum DirectoryOwnership {
Owned {
// None if `mod.rs`, `Some("foo")` if we're in `foo.rs`.
relative: Option<ast::Ident>,
},
UnownedViaBlock,
UnownedViaMod,
}

/// Information about the path to a module.
// Public for rustfmt usage.
pub struct ModulePath<'a> {
Expand Down