about summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2016-01-07Auto merge of #30728 - athaeryn:mention-warning-lint-group, r=Manishearthbors-5/+9
Fixes #30203. This is my first time writing Rust, and I think this code could be a bit better. Any suggestions?
2016-01-07Refactor away extension traits RegionEscape and HasTypeFlagsJeffrey Seyfried-1/+1
2016-01-06std::cmp::max -> maxMike Anderson-6/+6
2016-01-05Annotate the compiler with information about what it is doing when.Niko Matsakis-1/+2
2016-01-04Add mention of warnings lint group to help messageMike Anderson-0/+4
2015-12-30RefactoringNick Cameron-1/+1
2015-12-30use structured errorsNick Cameron-2/+3
2015-12-28rewrite the method-receiver matching codeAriel Ben-Yehuda-1/+0
the old code was *so terrible*.
2015-12-25Delete the AST after loweringJonas Schievink-3/+11
2015-12-24ast_map => hir_mapJonas Schievink-22/+20
2015-12-22Auto merge of #30417 - alexcrichton:better-detect-elf-tls, r=alexcrichtonbors-1/+1
Currently a compiler can be built with the `--disable-elf-tls` option for compatibility with OSX 10.6 which doesn't have ELF TLS. This is unfortunate, however, as a whole new compiler must be generated which can take some time. These commits add a new (feature gated) `cfg(target_thread_local)` annotation set by the compiler which indicates whether `#[thread_local]` is available for use. The compiler now interprets `MACOSX_DEPLOYMENT_TARGET` (a standard environment variable) to set this flag on OSX. With this we may want to start compiling our OSX nightlies with `MACOSX_DEPLOYMENT_TARGET` set to 10.6 which would allow the compiler out-of-the-box to generate 10.6-compatible binaries. For now the compiler still by default targets OSX 10.7 by allowing ELF TLS by default (e.g. if `MACOSX_DEPLOYMENT_TARGET` isn't set).
2015-12-21syntax: Respect allow_internal_unstable in macrosAlex Crichton-1/+1
This change modifies the feature gating of special `#[cfg]` attributes to not require a `#![feature]` directive in the crate-of-use if the source of the macro was declared with `#[allow_internal_unstable]`. This enables the standard library's macro for `thread_local!` to make use of the `#[cfg(target_thread_local)]` attribute despite it being feature gated (e.g. it's a hidden implementation detail).
2015-12-21Register new snapshotsAlex Crichton-26/+4
Lots of cruft to remove!
2015-12-17test errorsNick Cameron-20/+10
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-13/+12
Also split out emitters into their own module.
2015-12-15Move built-in syntax extensions to a separate crateSeo Sanghyeon-6/+11
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 ```