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 7 pull requests #48849

Merged
merged 22 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c68440c
Add a potential cause raising `ParseIntError`.
Songbird0 Mar 4, 2018
247fc38
Tidy error: add a new line
Songbird0 Mar 4, 2018
ef1aae1
Modify wording and remove useless whitespaces.
Songbird0 Mar 5, 2018
6d71aa4
Fix spelling error for `whitespaces`.
Songbird0 Mar 5, 2018
05a9acc
Implement FromStr for PathBuf
topecongiro Feb 17, 2018
ec76190
Remove nll-dump-cause flag and always track causes
spastorino Mar 5, 2018
b26f108
Fix sidebar horizontal scroll
GuillaumeGomez Mar 6, 2018
c85c5a0
Make causal tracking lazy
spastorino Mar 5, 2018
4b12ded
mir is already a reference
spastorino Mar 5, 2018
52a47d4
Run rustfmt over modified files
spastorino Mar 6, 2018
4bde92c
rustc: Fix ICE with `#[target_feature]` on module
alexcrichton Mar 5, 2018
3e60d99
Replace iterator structures with `impl Trait`.
frewsxcv Mar 3, 2018
08a0182
Run rustfmt on `src/librustc_data_structures/graph/mod.rs`.
frewsxcv Mar 3, 2018
2aa19fe
Add with_lock, with_read_lock and with_write_lock
Zoxc Mar 8, 2018
728c16c
Move REGISTERED_DIAGNOSTICS to a ParseSess field
Zoxc Mar 7, 2018
f12d5aa
Rollup merge of #48292 - topecongiro:from_str-for-path-and-pathbuf, r…
Manishearth Mar 8, 2018
d7f44ac
Rollup merge of #48682 - spastorino:make_causal_lazy, r=nikomatsakis
Manishearth Mar 8, 2018
6d0d343
Rollup merge of #48699 - frewsxcv:frewsxcv-impl-trait, r=nikomatsakis
Manishearth Mar 8, 2018
7c581b0
Rollup merge of #48738 - Songbird0:parseinterror_potential_cause, r=j…
Manishearth Mar 8, 2018
c8a73e4
Rollup merge of #48752 - alexcrichton:fix-target-feature, r=michaelwo…
Manishearth Mar 8, 2018
d17eb8f
Rollup merge of #48789 - GuillaumeGomez:horizontal-scroll, r=QuietMis…
Manishearth Mar 8, 2018
4579753
Rollup merge of #48808 - Zoxc:reg-diag, r=michaelwoerister
Manishearth Mar 8, 2018
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
7 changes: 7 additions & 0 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3900,6 +3900,13 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
/// This error is used as the error type for the `from_str_radix()` functions
/// on the primitive integer types, such as [`i8::from_str_radix`].
///
/// # Potential causes
///
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespace
/// in the string e.g. when it is obtained from the standard input.
/// Using the [`str.trim()`] method ensures that no whitespace remains before parsing.
///
/// [`str.trim()`]: ../../std/primitive.str.html#method.trim
/// [`i8::from_str_radix`]: ../../std/primitive.i8.html#method.from_str_radix
#[derive(Debug, Clone, PartialEq, Eq)]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
8 changes: 7 additions & 1 deletion src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ struct CheckAttrVisitor<'a, 'tcx: 'a> {
impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
/// Check any attribute.
fn check_attributes(&self, item: &hir::Item, target: Target) {
self.tcx.trans_fn_attrs(self.tcx.hir.local_def_id(item.id));
if target == Target::Fn {
self.tcx.trans_fn_attrs(self.tcx.hir.local_def_id(item.id));
} else if let Some(a) = item.attrs.iter().find(|a| a.check_name("target_feature")) {
self.tcx.sess.struct_span_err(a.span, "attribute should be applied to a function")
.span_label(item.span, "not a function")
.emit();
}

for attr in &item.attrs {
if let Some(name) = attr.name() {
Expand Down
19 changes: 16 additions & 3 deletions src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
self.explain_span(scope_decorated_tag, span)
}

ty::ReEarlyBound(_) | ty::ReFree(_) => self.msg_span_from_free_region(region),

ty::ReStatic => ("the static lifetime".to_owned(), None),
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReStatic => {
self.msg_span_from_free_region(region)
}

ty::ReEmpty => ("the empty lifetime".to_owned(), None),

Expand Down Expand Up @@ -175,6 +175,19 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
}

fn msg_span_from_free_region(self, region: ty::Region<'tcx>) -> (String, Option<Span>) {
match *region {
ty::ReEarlyBound(_) | ty::ReFree(_) => {
self.msg_span_from_early_bound_and_free_regions(region)
},
ty::ReStatic => ("the static lifetime".to_owned(), None),
_ => bug!(),
}
}

fn msg_span_from_early_bound_and_free_regions(
self,
region: ty::Region<'tcx>,
) -> (String, Option<Span>) {
let scope = region.free_region_binding_scope(self);
let node = self.hir.as_local_node_id(scope).unwrap_or(DUMMY_NODE_ID);
let unknown;
Expand Down
Loading