Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 17 pull requests #37118

Merged
merged 55 commits into from
Oct 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d9e6430
Add two functions to check type of SockAddr
achanda Sep 27, 2016
dd19bf0
Support importing inaccessible `extern crate`s with a warning again.
jseyfried Oct 7, 2016
4080efd
Add regression test.
jseyfried Oct 7, 2016
57d6ddd
incr.comp.: Hide concrete hash algorithm used for ICH
michaelwoerister Sep 29, 2016
954d89b
incr.comp.: Cover indirect changes in struct ICH test case
michaelwoerister Sep 29, 2016
2df25ad
Combine `std_inject::{no_core, no_std}` into `std_inject::injected_cr…
jseyfried Sep 28, 2016
09e41b6
Add macros from plugins in `libsyntax_ext::register_builtins`.
jseyfried Sep 28, 2016
21b4369
Refactor away `ext::expand::{expand_crate, expand_crate_with_expander}`.
jseyfried Sep 29, 2016
f3c7333
Cleanup `depth`s.
jseyfried Sep 26, 2016
2cf9649
Immutable `ExpansionData`.
jseyfried Sep 16, 2016
a23bdd2
Rename `resolve::macros::{ExpansionData -> InvocationData}`.
jseyfried Oct 3, 2016
fbc96e1
Persistent macro scopes.
jseyfried Oct 6, 2016
fd073cf
Don't construct `PathBuf` ownership if we don't need it.
frewsxcv Oct 8, 2016
f410da5
Add doc comments describing fields on `externalfiles::ExternalHtml`.
frewsxcv Oct 8, 2016
bf5dfac
run rustfmt on librustc_lint folder
srinivasreddy Oct 9, 2016
7be14ee
Refactor away `load_or_return` macro.
frewsxcv Oct 9, 2016
ba20da1
Make `ExternalHtml::load` short-circuited.
frewsxcv Oct 9, 2016
e4f066f
Remove unnecessary `pub` function classifier.
frewsxcv Oct 9, 2016
b043e11
Avoid allocations in `Decoder::read_str`.
nnethercote Oct 9, 2016
4df0f3f
Error monitor should emit error to stderr instead of stdout
nrc Oct 10, 2016
53fd3b0
Avoid quadratic complexity.
jseyfried Oct 8, 2016
f9c73ad
Add comparison operators to boolean const eval.
Mark-Simulacrum Oct 9, 2016
60a4b69
Expand `#[derive]` attribute macro invocations last.
jseyfried Oct 10, 2016
448d6ad
Test derive expansion ordering.
jseyfried Oct 10, 2016
5e91c07
Move IdxSetBuf and BitSlice to rustc_data_structures
wesleywiser Oct 6, 2016
6808b0a
Check for shadowing errors after all invocations have been expanded.
jseyfried Oct 11, 2016
d5281ef
Merge branch 'persistent_macro_scopes' into cleanup_expanded_macro_us…
jseyfried Oct 11, 2016
31e0e12
Add support for undetermined macro invocations.
jseyfried Oct 11, 2016
111caef
Clean up the scopes of expanded `#[macro_use]` imports.
jseyfried Oct 11, 2016
a4c0daa
Remove `LegacyBindingKind::MacroUse`.
jseyfried Oct 11, 2016
829bd8c
Add test.
jseyfried Oct 11, 2016
b5bedfc
Add missing urls in io module
GuillaumeGomez Oct 11, 2016
62861f8
configure: Fix gcc detection for LLVM
alexcrichton Oct 11, 2016
f2adb70
std: Update liblibc submodule
alexcrichton Oct 11, 2016
9bc6d26
Stabilise `?`
nrc Oct 5, 2016
a94f593
Stabilise attributes on statements.
nrc Oct 6, 2016
14c62f9
Deprecate `Reflect`
nrc Oct 6, 2016
79b5177
Review changes
nrc Oct 6, 2016
7badc32
normalize tuple pair types
TimNN Oct 12, 2016
76fb6e7
Rollup merge of #36762 - achanda:sockaddr_type, r=alexcrichton
alexcrichton Oct 12, 2016
091b547
Rollup merge of #36831 - michaelwoerister:ich-updates, r=nikomatsakis
alexcrichton Oct 12, 2016
d13b102
Rollup merge of #36991 - wesleywiser:fixme_1, r=arielb1
alexcrichton Oct 12, 2016
9d70ff3
Rollup merge of #36995 - nrc:stable, r=@nikomatsakis
alexcrichton Oct 12, 2016
65fc3ef
Rollup merge of #37023 - jseyfried:fix_extern_crate_back_compat, r=nrc
alexcrichton Oct 12, 2016
4e65489
Rollup merge of #37049 - srinivasreddy:librustc_lint, r=nrc
alexcrichton Oct 12, 2016
5ac7f4f
Rollup merge of #37050 - frewsxcv:librustdoc, r=alexcrichton
alexcrichton Oct 12, 2016
a0ad661
Rollup merge of #37056 - Mark-Simulacrum:fix-bool-comparison, r=bluss
alexcrichton Oct 12, 2016
f05bd1b
Rollup merge of #37064 - nnethercote:read_str, r=eddyb
alexcrichton Oct 12, 2016
920f109
Rollup merge of #37066 - nrc:stderr, r=alexcrichton
alexcrichton Oct 12, 2016
2d71be5
Rollup merge of #37067 - jseyfried:expand_derives_last, r=alexcrichton
alexcrichton Oct 12, 2016
2099182
Rollup merge of #37084 - jseyfried:cleanup_expanded_macro_use_scopes,…
alexcrichton Oct 12, 2016
8f10d66
Rollup merge of #37089 - GuillaumeGomez:io_urls, r=frewsxcv
alexcrichton Oct 12, 2016
8149484
Rollup merge of #37091 - alexcrichton:configure, r=brson
alexcrichton Oct 12, 2016
25ad6a3
Rollup merge of #37092 - alexcrichton:update-libc, r=japaric
alexcrichton Oct 12, 2016
27043b1
Rollup merge of #37110 - TimNN:fix-37109, r=eddyb
alexcrichton Oct 12, 2016
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
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1635,8 +1635,8 @@ do
("ccache gcc")
LLVM_CXX_32="ccache"
LLVM_CC_32="ccache"
LLVM_CXX_32_ARG1="clang++"
LLVM_CC_32_ARG1="clang"
LLVM_CXX_32_ARG1="g++"
LLVM_CC_32_ARG1="gcc"

LLVM_CXX_64="ccache"
LLVM_CC_64="ccache"
Expand Down
3 changes: 1 addition & 2 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2472,8 +2472,7 @@ The currently implemented features of the reference compiler are:
* - `default_type_parameter_fallback` - Allows type parameter defaults to
influence type inference.

* - `stmt_expr_attributes` - Allows attributes on expressions and
non-item statements.
* - `stmt_expr_attributes` - Allows attributes on expressions.

* - `type_ascription` - Allows type ascription expressions `expr: Type`.

Expand Down
7 changes: 3 additions & 4 deletions src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@

use fmt;
use intrinsics;
use marker::Reflect;

///////////////////////////////////////////////////////////////////////////////
// Any trait
Expand All @@ -86,7 +85,7 @@ use marker::Reflect;
///
/// [mod]: index.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Any: Reflect + 'static {
pub trait Any: 'static {
/// Gets the `TypeId` of `self`.
///
/// # Examples
Expand All @@ -112,7 +111,7 @@ pub trait Any: Reflect + 'static {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Reflect + 'static + ?Sized > Any for T {
impl<T: 'static + ?Sized > Any for T {
fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
}

Expand Down Expand Up @@ -366,7 +365,7 @@ impl TypeId {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn of<T: ?Sized + Reflect + 'static>() -> TypeId {
pub fn of<T: ?Sized + 'static>() -> TypeId {
TypeId {
t: unsafe { intrinsics::type_id::<T>() },
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#![feature(specialization)]
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(question_mark)]
#![cfg_attr(stage0, feature(question_mark))]
#![feature(never_type)]
#![feature(prelude_import)]

Expand Down
3 changes: 3 additions & 0 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ macro_rules! debug_assert_ne {
/// Helper macro for reducing boilerplate code for matching `Result` together
/// with converting downstream errors.
///
/// Prefer using `?` syntax to `try!`. `?` is built in to the language and is
/// more succinct than `try!`. It is the standard method for error propagation.
///
/// `try!` matches the given `Result`. In case of the `Ok` variant, the
/// expression has the value of the wrapped value.
///
Expand Down
3 changes: 3 additions & 0 deletions src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,14 @@ mod impls {
#[unstable(feature = "reflect_marker",
reason = "requires RFC and more experience",
issue = "27749")]
#[rustc_deprecated(since = "1.14.0", reason = "Specialization makes parametricity impossible")]
#[rustc_on_unimplemented = "`{Self}` does not implement `Any`; \
ensure all type parameters are bounded by `Any`"]
pub trait Reflect {}

#[unstable(feature = "reflect_marker",
reason = "requires RFC and more experience",
issue = "27749")]
#[rustc_deprecated(since = "1.14.0", reason = "Specialization makes parametricity impossible")]
#[allow(deprecated)]
impl Reflect for .. { }
2 changes: 1 addition & 1 deletion src/libgraphviz/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
#![cfg_attr(not(stage0), deny(warnings))]

#![feature(str_escape)]
#![feature(question_mark)]
#![cfg_attr(stage0, feature(question_mark))]

use self::LabelText::*;

Expand Down
24 changes: 0 additions & 24 deletions src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,30 +1327,6 @@ let x: i32 = "I am not a number!";
// |
// type `i32` assigned to variable `x`
```

Another situation in which this occurs is when you attempt to use the `try!`
macro inside a function that does not return a `Result<T, E>`:

```compile_fail,E0308
use std::fs::File;

fn main() {
let mut f = try!(File::create("foo.txt"));
}
```

This code gives an error like this:

```text
<std macros>:5:8: 6:42 error: mismatched types:
expected `()`,
found `core::result::Result<_, _>`
(expected (),
found enum `core::result::Result`) [E0308]
```

`try!` returns a `Result<T, E>`, and so the function must. But `main()` has
`()` as its return type, hence the error.
"##,

E0309: r##"
Expand Down
8 changes: 1 addition & 7 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,7 @@ pub fn lower_crate(sess: &Session,
let _ignore = sess.dep_graph.in_ignore();

LoweringContext {
crate_root: if std_inject::no_core(krate) {
None
} else if std_inject::no_std(krate) {
Some("core")
} else {
Some("std")
},
crate_root: std_inject::injected_crate_name(krate),
sess: sess,
parent_def: None,
resolver: resolver,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#![feature(rustc_private)]
#![feature(slice_patterns)]
#![feature(staged_api)]
#![feature(question_mark)]
#![cfg_attr(stage0, feature(question_mark))]
#![cfg_attr(test, feature(test))]

extern crate arena;
Expand Down
8 changes: 8 additions & 0 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ pub struct PerfStats {
pub incr_comp_hashes_time: Cell<Duration>,
// The number of incr. comp. hash computations performed
pub incr_comp_hashes_count: Cell<u64>,
// The number of bytes hashed when computing ICH values
pub incr_comp_bytes_hashed: Cell<u64>,
// The accumulated time spent on computing symbol hashes
pub symbol_hash_time: Cell<Duration>,
}
Expand Down Expand Up @@ -439,6 +441,11 @@ impl Session {
duration_to_secs_str(self.perf_stats.incr_comp_hashes_time.get()));
println!("Total number of incr. comp. hashes computed: {}",
self.perf_stats.incr_comp_hashes_count.get());
println!("Total number of bytes hashed for incr. comp.: {}",
self.perf_stats.incr_comp_bytes_hashed.get());
println!("Average bytes hashed per incr. comp. HIR node: {}",
self.perf_stats.incr_comp_bytes_hashed.get() /
self.perf_stats.incr_comp_hashes_count.get());
println!("Total time spent computing symbol hashes: {}",
duration_to_secs_str(self.perf_stats.symbol_hash_time.get()));
}
Expand Down Expand Up @@ -571,6 +578,7 @@ pub fn build_session_(sopts: config::Options,
svh_time: Cell::new(Duration::from_secs(0)),
incr_comp_hashes_time: Cell::new(Duration::from_secs(0)),
incr_comp_hashes_count: Cell::new(0),
incr_comp_bytes_hashed: Cell::new(0),
symbol_hash_time: Cell::new(Duration::from_secs(0)),
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_back/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(step_by)]
#![feature(question_mark)]
#![cfg_attr(stage0, feature(question_mark))]
#![cfg_attr(test, feature(test, rand))]

extern crate syntax;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_borrowck/borrowck/mir/dataflow/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

use syntax::ast::NodeId;
use rustc::mir::repr::{BasicBlock, Mir};
use rustc_data_structures::bitslice::bits_to_string;
use rustc_data_structures::indexed_set::{IdxSet};
use rustc_data_structures::indexed_vec::Idx;

use dot;
Expand All @@ -27,8 +29,6 @@ use std::path::Path;

use super::super::MoveDataParamEnv;
use super::super::MirBorrowckCtxtPreDataflow;
use bitslice::bits_to_string;
use indexed_set::{IdxSet};
use super::{BitDenotation, DataflowState};

impl<O: BitDenotation> DataflowState<O> {
Expand Down
7 changes: 3 additions & 4 deletions src/librustc_borrowck/borrowck/mir/dataflow/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

use rustc::ty::TyCtxt;
use rustc::mir::repr::{self, Mir, Location};
use rustc_data_structures::bitslice::BitSlice; // adds set_bit/get_bit to &[usize] bitvector rep.
use rustc_data_structures::bitslice::{BitwiseOperator};
use rustc_data_structures::indexed_set::{IdxSet};
use rustc_data_structures::indexed_vec::Idx;

use super::super::gather_moves::{MoveOutIndex, MovePathIndex};
Expand All @@ -21,10 +24,6 @@ use super::super::on_lookup_result_bits;

use super::{BitDenotation, BlockSets, DataflowOperator};

use bitslice::BitSlice; // adds set_bit/get_bit to &[usize] bitvector rep.
use bitslice::{BitwiseOperator};
use indexed_set::{IdxSet};

// Dataflow analyses are built upon some interpretation of the
// bitvectors attached to each basic block, represented via a
// zero-sized structure.
Expand Down
5 changes: 2 additions & 3 deletions src/librustc_borrowck/borrowck/mir/dataflow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use rustc_data_structures::indexed_set::{IdxSet, IdxSetBuf};
use rustc_data_structures::indexed_vec::Idx;
use rustc_data_structures::bitslice::{bitwise, BitwiseOperator};

use rustc::ty::TyCtxt;
use rustc::mir::repr::{self, Mir};
Expand All @@ -22,9 +24,6 @@ use std::usize;
use super::MirBorrowckCtxtPreDataflow;
use super::MoveDataParamEnv;

use bitslice::{bitwise, BitwiseOperator};
use indexed_set::{IdxSet, IdxSetBuf};

pub use self::sanity_check::sanity_check_via_rustc_peek;
pub use self::impls::{MaybeInitializedLvals, MaybeUninitializedLvals};
pub use self::impls::{DefinitelyInitializedLvals, MovingOutStatements};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/borrowck/mir/elaborate_drops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use indexed_set::IdxSetBuf;
use super::gather_moves::{MoveData, MovePathIndex, LookupResult};
use super::dataflow::{MaybeInitializedLvals, MaybeUninitializedLvals};
use super::dataflow::{DataflowResults};
Expand All @@ -23,6 +22,7 @@ use rustc::mir::transform::{Pass, MirPass, MirSource};
use rustc::middle::const_val::ConstVal;
use rustc::middle::lang_items;
use rustc::util::nodemap::FnvHashMap;
use rustc_data_structures::indexed_set::IdxSetBuf;
use rustc_data_structures::indexed_vec::Idx;
use syntax_pos::Span;

Expand Down
4 changes: 1 addition & 3 deletions src/librustc_borrowck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#![feature(staged_api)]
#![feature(associated_consts)]
#![feature(nonzero)]
#![feature(question_mark)]
#![cfg_attr(stage0, feature(question_mark))]
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
extern crate syntax_pos;
Expand All @@ -50,8 +50,6 @@ pub use borrowck::{AnalysisData, BorrowckCtxt, ElaborateDrops};
pub mod diagnostics;

mod borrowck;
mod bitslice;
mod indexed_set;

pub mod graphviz;

Expand Down
4 changes: 4 additions & 0 deletions src/librustc_const_eval/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,10 @@ pub fn eval_const_expr_partial<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
hir::BiBitOr => a | b,
hir::BiEq => a == b,
hir::BiNe => a != b,
hir::BiLt => a < b,
hir::BiLe => a <= b,
hir::BiGe => a >= b,
hir::BiGt => a > b,
_ => signal!(e, InvalidOpForBools(op.node)),
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_const_eval/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#![feature(staged_api)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_patterns)]
#![feature(question_mark)]
#![cfg_attr(stage0, feature(question_mark))]
#![feature(box_patterns)]
#![feature(box_syntax)]

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_const_math/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(question_mark)]
#![cfg_attr(stage0, feature(question_mark))]

#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// FIXME: move this to `rustc_data_structures` and potentially merge
// with `bitvec` there.
// FIXME: merge with `bitvec`

use std::mem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// FIXME: move this to `rustc_data_structures`

use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ops::{Deref, DerefMut, Range};
use bitslice::{BitSlice, Word};
use bitslice::{bitwise, Union, Subtract};

use rustc_data_structures::indexed_vec::Idx;
use indexed_vec::Idx;

/// Represents a set (or packed family of sets), of some element type
/// E, where each E is identified by some unique index type `T`.
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ extern crate serialize as rustc_serialize; // used by deriving
#[cfg(unix)]
extern crate libc;

pub mod bitslice;
pub mod bitvec;
pub mod graph;
pub mod ivar;
pub mod indexed_set;
pub mod indexed_vec;
pub mod obligation_forest;
pub mod snapshot_map;
Expand Down
12 changes: 9 additions & 3 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ pub fn phase_2_configure_and_expand<'a, F>(sess: &Session,
let resolver_arenas = Resolver::arenas();
let mut resolver =
Resolver::new(sess, &krate, make_glob_map, &mut crate_loader, &resolver_arenas);
syntax_ext::register_builtins(&mut resolver, sess.features.borrow().quote);
syntax_ext::register_builtins(&mut resolver, syntax_exts, sess.features.borrow().quote);

krate = time(time_passes, "expansion", || {
// Windows dlls do not have rpaths, so they don't know how to find their
Expand Down Expand Up @@ -686,11 +686,17 @@ pub fn phase_2_configure_and_expand<'a, F>(sess: &Session,
..syntax::ext::expand::ExpansionConfig::default(crate_name.to_string())
};
let mut ecx = ExtCtxt::new(&sess.parse_sess, krate.config.clone(), cfg, &mut resolver);
let ret = syntax::ext::expand::expand_crate(&mut ecx, syntax_exts, krate);
let err_count = ecx.parse_sess.span_diagnostic.err_count();

let krate = ecx.monotonic_expander().expand_crate(krate);

if ecx.parse_sess.span_diagnostic.err_count() - ecx.resolve_err_count > err_count {
ecx.parse_sess.span_diagnostic.abort_if_errors();
}
if cfg!(windows) {
env::set_var("PATH", &old_path);
}
ret
krate
});

krate.exported_macros = mem::replace(&mut resolver.exported_macros, Vec::new());
Expand Down
Loading