summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2015-12-09Auto merge of #30145 - petrochenkov:hyg, r=nrcbors-6/+7
Instead of `ast::Ident`, bindings, paths and labels in HIR now keep a new structure called `hir::Ident` containing mtwt-renamed `name` and the original not-renamed `unhygienic_name`. `name` is supposed to be used by default, `unhygienic_name` is rarely used. This is not ideal, but better than the status quo for two reasons: - MTWT tables can be cleared immediately after lowering to HIR - This is less bug-prone, because it is impossible now to forget applying `mtwt::resolve` to a name. It is still possible to use `name` instead of `unhygienic_name` by mistake, but `unhygienic_name`s are used only in few very special circumstances, so it shouldn't be a problem. Besides name resolution `unhygienic_name` is used in some lints and debuginfo. `unhygienic_name` can be very well approximated by "reverse renaming" `token::intern(name.as_str())` or even plain string `name.as_str()`, except that it would break gensyms like `iter` in desugared `for` loops. This approximation is likely good enough for lints and debuginfo, but not for name resolution, unfortunately (see https://github.com/rust-lang/rust/issues/27639), so `unhygienic_name` has to be kept. cc https://github.com/rust-lang/rust/issues/29782 r? @nrc
2015-12-06Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturonbors-7/+6
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-7/+6
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05Auto merge of #30185 - fhahn:improve-borrowck-public-accessibility, r=pnkfelixbors-3/+4
This PR makes `AnalysisData` and`BorrowckCtxt` public. Those types are returned by the public function `build_borrowck_dataflow_data_for_fn` and are needed if a caller wants to pass on the return values. It also removes `FnPartsWithCFG`, which required callers of `build_borrowck_dataflow_data_for_fn` to have a reference to a `CFG` with the same lifetime as `FnParts`, which is more limiting than required.
2015-12-05Do MTWT resolution during lowering to HIRVadim Petrochenkov-6/+7
2015-12-04Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelixbors-0/+1
See https://github.com/rust-lang/rfcs/pull/16 and https://github.com/rust-lang/rust/issues/15701 - Added syntax support for attributes on expressions and all syntax nodes in statement position. - Extended `#[cfg]` folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. - Extended lint checker to recognize lint levels on expressions and locals. - As per RFC, attributes are not yet accepted on `if` expressions. Examples: ```rust let x = y; { ... } assert_eq!((1, #[cfg(unset)] 2, 3), (1, 3)); let FOO = 0; ``` Implementation wise, there are a few rough corners and open questions: - The parser work ended up a bit ugly. - The pretty printer change was based mostly on guessing. - Similar to the `if` case, there are some places in the grammar where a new `Expr` node starts, but where it seemed weird to accept attributes and hence the parser doesn't. This includes: - const expressions in patterns - in the middle of an postfix operator chain (that is, after `.`, before indexing, before calls) - on range expressions, since `#[attr] x .. y` parses as `(#[attr] x) .. y`, which is inconsistent with `#[attr] .. y` which would parse as `#[attr] (.. y)` - Attributes are added as additional `Option<Box<Vec<Attribute>>>` fields in expressions and locals. - Memory impact has not been measured yet. - A cfg-away trailing expression in a block does not currently promote the previous `StmtExpr` in a block to a new trailing expr. That is to say, this won't work: ```rust let x = { #[cfg(foo)] Foo { data: x } #[cfg(not(foo))] Foo { data: y } }; ``` - One-element tuples can have their inner expression removed to become Unit, but just Parenthesis can't. Eg, `(#[cfg(unset)] x,) == ()` but `(#[cfg(unset)] x) == error`. This seemed reasonable to me since tuples and unit are type constructors, but could probably be argued either way. - Attributes on macro nodes are currently unconditionally dropped during macro expansion, which seemed fine since macro disappear at that point? - Attributes on `ast::ExprParens` will be prepend-ed to the inner expression in the hir folder. - The work on pretty printer tests for this did trigger, but not fix errors regarding macros: - expression `foo![]` prints as `foo!()` - expression `foo!{}` prints as `foo!()` - statement `foo![];` prints as `foo!();` - statement `foo!{};` prints as `foo!();` - statement `foo!{}` triggers a `None` unwrap ICE.
2015-12-03Make public borrowck api more accessibleFlorian Hahn-3/+4
2015-12-02Now that MIR regressions are fixed, re-enable MIR for all users.Niko Matsakis-15/+4
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-0/+1
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-26fix rustc-testAriel Ben-Yehuda-3/+5
2015-11-26fix tidyAriel Ben-Yehuda-1/+4
2015-11-26fix tests & rustdocAriel Ben-Yehuda-1/+1
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-9/+10
tests & rustdoc still broken
2015-11-26move librustc/plugin to librustc_pluginAriel Ben-Yehuda-2/+3
this is a [breaking-change] to all plugin authors - sorry
2015-11-26make CrateStore a trait objectAriel Ben-Yehuda-9/+48
rustdoc still broken
2015-11-26Auto merge of #30054 - Ms2ger:TypeOrigin, r=eddybbors-2/+2
2015-11-26Use the TypeOrigin variants qualified.Ms2ger-2/+2
2015-11-26Consider a crate staged if it has `stable` or `unstable` in its rootVadim Petrochenkov-2/+2
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-25Remove `#[staged_api]`Vadim Petrochenkov-2/+2
2015-11-22Auto merge of #29980 - Manishearth:missing-diag, r=eddybbors-0/+2
None
2015-11-22Register diagnostics for rustc_privacy and rustc_trans properlyManish Goregaokar-0/+2
fixes #29665
2015-11-22Look up macro names as well when suggesting replacements for function ↵Manish Goregaokar-6/+7
resolve errors fixes #5780
2015-11-19Changes to data produced by privacy passVadim Petrochenkov-9/+6
2015-11-18Update unit tests in driver.Niko Matsakis-2/+3
2015-11-18Port a bunch of code new-visitor; all of these ports wereNiko Matsakis-2/+3
straightforward uses of `visit_all_items`. In some cases I had to remove empty `visit_item` calls that were just to suppress visiting nested items.
2015-11-18Auto merge of #29083 - petrochenkov:stability3, r=alexcrichtonbors-2/+1
What this patch does: - Stability annotations are now based on "exported items" supplied by rustc_privacy and not "public items". Exported items are as accessible for external crates as directly public items and should be annotated with stability attributes. - Trait impls require annotations now. - Reexports require annotations now. - Crates themselves didn't require annotations, now they do. - Exported macros are annotated now, but these annotations are not used yet. - Some useless annotations are detected and result in errors - Finally, some small bugs are fixed - deprecation propagates from stable deprecated parents, items in blocks are traversed correctly (fixes https://github.com/rust-lang/rust/issues/29034) + some code cleanup.
2015-11-18MIR: Add pass that erases all regions right before transMichael Woerister-3/+7
2015-11-18Rework stability annotation passVadim Petrochenkov-2/+1
2015-11-16rename `ast::ImplItem_::*ImplItem` to `ast::ImplItemKind::*`Oliver Schneider-1/+1
2015-11-12Make the mir_map available to the after_analysis CompileController step.Scott Olson-0/+5
2015-11-12Auto merge of #29764 - nrc:stats, r=nikomatsakisbors-0/+17
Emits loc, and node count - before and after expansion. E.g., ``` rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore Lines of code: 32060 Pre-expansion node count: 120205 Post-expansion node count: 482749 ``` r? @nikomatsakis
2015-11-12Fix hygiene regression in patternsVadim Petrochenkov-1/+2
2015-11-12Add -Zinput-statsNick Cameron-0/+17
Emits loc, and node count - before and after expansion. E.g., ``` rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore Lines of code: 32060 Pre-expansion node count: 120205 Post-expansion node count: 482749 ```
2015-11-10Manual fixups.Jose Narvaez-1/+1
2015-11-10Rustfmting librustc_driver.Jose Narvaez-743/+797
2015-11-07Fixed text alignment for output of "rustc -Z help"inrustwetrust-12/+18
2015-11-04Remove use of RefCell<DefMap> in resolve_lifetimeJonathan S-3/+3
2015-11-04Remove use of RefCell<DefMap> in check_static_recursionJonathan S-1/+1
2015-11-03Pass the mir map to transNiko Matsakis-13/+18
2015-10-28Remove contraction. The contraction rules predated the notion of anNiko Matsakis-10/+14
empty region, and they complicate region inference to no particular end. They also lead in some cases to spurious errors like #29048 (though in some cases these errors are helpful in tracking down missing constraints).
2015-10-26Disable MIR on beta/stable until we've resolved #29227 is resolved.Niko Matsakis-3/+13
2015-10-22fix bug in hir,identifiedNiko Matsakis-1/+1
2015-10-21save-analysis: don't recompute crate nameNick Cameron-9/+13
2015-10-09review commentsNick Cameron-16/+16
2015-10-09Misc fixupsNick Cameron-5/+6
2015-10-09Cache ids between lowering runsNick Cameron-7/+5
So that lowering is reproducible
2015-10-09Move `for` loop desugaring to loweringNick Cameron-46/+46
2015-10-09Add a lowering contextNick Cameron-8/+21
2015-10-08Rollup merge of #28872 - iwillspeak:master, r=ManishearthSteve Klabnik-1/+6
Currently the explain command line flag requires full error codes, complete with the leading zeros and the E at the beginning. This commit changes that, if you don't supply a full error code then the error number is padded out to the required size and the E is added to the beginning. This means that where previously you would need to write E0001, you can now write 0001, 001, 01 or just 1 to refer to the same error.