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 5 pull requests #64597

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
166719a
Update installed compiler dependencies
andjo403 Aug 31, 2019
9f4351d
Bless output of test borrowck/return-local-binding-from-desugaring.rs…
lqd Sep 17, 2019
222e920
Bless output of test borrowck/return-local-binding-from-desugaring.rs…
lqd Sep 17, 2019
3ef980a
Update expectations of test ui/dropck/dropck_trait_cycle_checked.rs f…
lqd Sep 17, 2019
34d3167
Bless json output of test ui/json-multiple.rs for Polonius
lqd Sep 17, 2019
f9c7329
Bless json output of test ui/json-options.rs for Polonius
lqd Sep 17, 2019
ceb72e4
Add generic dataflow impl
ecstatic-morse Sep 17, 2019
5496a1f
Document new dataflow analysis
ecstatic-morse Sep 18, 2019
2886037
Temporarily add `#[allow(unused)]` for CI
ecstatic-morse Sep 18, 2019
d583fef
Add ignore reason to placate `tidy`
ecstatic-morse Sep 18, 2019
cbaaf05
Fix `Analysis` example
ecstatic-morse Sep 18, 2019
a526e4f
Use an associated const for `name`
ecstatic-morse Sep 18, 2019
19bf0f4
Fix typo
ecstatic-morse Sep 18, 2019
08aff1a
Publish `rustc_mir::dataflow` and remove `#[allow(unused)]`
ecstatic-morse Sep 18, 2019
a7f5252
Add summary of the current state and future plans
ecstatic-morse Sep 18, 2019
b4e94d9
Fix bug where `is_call_return_effect_applied` was never set
ecstatic-morse Sep 18, 2019
3fc34a1
On obligation errors point at the unfulfilled binding when possible
estebank Sep 4, 2019
71f7b1c
Point at correct span for parenthesized types
estebank Sep 5, 2019
404a488
review comments
estebank Sep 5, 2019
f43376a
ignore musl target in tests to avoid issues with output differences
estebank Sep 16, 2019
f233a4c
Fix a minor grammar nit, update UI tests
Sep 18, 2019
829c3c3
Fix rebase
estebank Sep 18, 2019
333230f
Restore whitespace
Sep 18, 2019
f4f16cd
Rollup merge of #63630 - andjo403:bump_compiler, r=nikomatsakis
Centril Sep 19, 2019
e314d39
Rollup merge of #64151 - estebank:binding-error, r=varkor
Centril Sep 19, 2019
9f8b6bd
Rollup merge of #64554 - lqd:polonius_tests4, r=nikomatsakis
Centril Sep 19, 2019
ce48352
Rollup merge of #64566 - ecstatic-morse:generic-dataflow, r=oli-obk
Centril Sep 19, 2019
77bae1c
Rollup merge of #64591 - jamesmunns:grammar-fix, r=jonas-schievink
Centril Sep 19, 2019
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
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ or reading the [rustc guide][rustcguidebuild].
### Building on *nix
1. Make sure you have installed the dependencies:

* `g++` 4.7 or later or `clang++` 3.x or later
* `g++` 5.1 or later or `clang++` 3.5 or later
* `python` 2.7 (but not 3.x)
* GNU `make` 3.81 or later
* `cmake` 3.4.3 or later
Expand Down Expand Up @@ -151,6 +151,17 @@ by manually calling the appropriate vcvars file before running the bootstrap.
> python x.py build
```

### Building rustc with older host toolchains
It is still possible to build Rust with the older toolchain versions listed below, but only if the
LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN option is set to true in the config.toml file.

* Clang 3.1
* Apple Clang 3.1
* GCC 4.8
* Visual Studio 2015 (Update 3)

Toolchain versions older than what is listed above cannot be used to build rustc.

#### Specifying an ABI

Each specific ABI can also be used from either environment (for example, using
Expand Down
2 changes: 2 additions & 0 deletions src/etc/generate-deriving-span-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
os.path.join(os.path.dirname(__file__), '../test/ui/derives/'))

TEMPLATE = """\
// ignore-musl
// ^ due to stderr output differences
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'

{error_deriving}
Expand Down
5 changes: 4 additions & 1 deletion src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1893,10 +1893,13 @@ impl<'a> LoweringContext<'a> {
if let Ok(snippet) = self.sess.source_map().span_to_snippet(data.span) {
// Do not suggest going from `Trait()` to `Trait<>`
if data.inputs.len() > 0 {
let split = snippet.find('(').unwrap();
let trait_name = &snippet[0..split];
let args = &snippet[split + 1 .. snippet.len() - 1];
err.span_suggestion(
data.span,
"use angle brackets instead",
format!("<{}>", &snippet[1..snippet.len() - 1]),
format!("{}<{}>", trait_name, args),
Applicability::MaybeIncorrect,
);
}
Expand Down
12 changes: 12 additions & 0 deletions src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2750,3 +2750,15 @@ pub enum Node<'hir> {

Crate,
}

impl Node<'_> {
pub fn ident(&self) -> Option<Ident> {
match self {
Node::TraitItem(TraitItem { ident, .. }) |
Node::ImplItem(ImplItem { ident, .. }) |
Node::ForeignItem(ForeignItem { ident, .. }) |
Node::Item(Item { ident, .. }) => Some(*ident),
_ => None,
}
}
}
22 changes: 18 additions & 4 deletions src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ use syntax::symbol::{sym, kw};
use syntax_pos::{DUMMY_SP, Span, ExpnKind};

impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub fn report_fulfillment_errors(&self,
errors: &[FulfillmentError<'tcx>],
body_id: Option<hir::BodyId>,
fallback_has_occurred: bool) {
pub fn report_fulfillment_errors(
&self,
errors: &[FulfillmentError<'tcx>],
body_id: Option<hir::BodyId>,
fallback_has_occurred: bool,
) {
#[derive(Debug)]
struct ErrorDescriptor<'tcx> {
predicate: ty::Predicate<'tcx>,
Expand Down Expand Up @@ -1623,6 +1625,18 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
err.note(&msg);
}
}
ObligationCauseCode::BindingObligation(item_def_id, span) => {
let item_name = tcx.def_path_str(item_def_id);
let msg = format!("required by this bound in `{}`", item_name);
if let Some(ident) = tcx.opt_item_name(item_def_id) {
err.span_label(ident.span, "");
}
if span != DUMMY_SP {
err.span_label(span, &msg);
} else {
err.note(&msg);
}
}
ObligationCauseCode::ObjectCastObligation(object_ty) => {
err.note(&format!("required for the cast to the object type `{}`",
self.ty_to_string(object_ty)));
Expand Down
3 changes: 3 additions & 0 deletions src/librustc/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ pub enum ObligationCauseCode<'tcx> {
/// also implement all supertraits of `X`.
ItemObligation(DefId),

/// Like `ItemObligation`, but with extra detail on the source of the obligation.
BindingObligation(DefId, Span),

/// A type like `&'a T` is WF only if `T: 'a`.
ReferenceOutlivesReferent(Ty<'tcx>),

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl IntercrateAmbiguityCause {
String::new()
};
format!(
"upstream crates may add new impl of trait `{}`{} \
"upstream crates may add a new impl of trait `{}`{} \
in future versions",
trait_desc, self_desc
)
Expand Down
1 change: 1 addition & 0 deletions src/librustc/traits/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
super::TupleElem => Some(super::TupleElem),
super::ProjectionWf(proj) => tcx.lift(&proj).map(super::ProjectionWf),
super::ItemObligation(def_id) => Some(super::ItemObligation(def_id)),
super::BindingObligation(def_id, span) => Some(super::BindingObligation(def_id, span)),
super::ReferenceOutlivesReferent(ty) => {
tcx.lift(&ty).map(super::ReferenceOutlivesReferent)
}
Expand Down
4 changes: 4 additions & 0 deletions src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2797,6 +2797,10 @@ impl<'tcx> TyCtxt<'tcx> {
})
}

pub fn opt_item_name(self, def_id: DefId) -> Option<Ident> {
self.hir().as_local_hir_id(def_id).and_then(|hir_id| self.hir().get(hir_id).ident())
}

pub fn opt_associated_item(self, def_id: DefId) -> Option<AssocItem> {
let is_associated_item = if let Some(hir_id) = self.hir().as_local_hir_id(def_id) {
match self.hir().get(hir_id) {
Expand Down
Loading