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 10 pull requests #73824

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
358dc1d
Added io forwarding methods to the stdio structs
Lucretiel May 28, 2020
93cbad6
Add documentation to point to `!is_dir` instead of `is_file`
poliorcetics Jun 11, 2020
ec63f9d
Added the note to Metadata too
poliorcetics Jun 11, 2020
c1243db
Make a note about is_dir vs is_file in Path too
poliorcetics Jun 11, 2020
b60cefe
Removed write_fmt forwarding, to fix recursive borrow issues
Lucretiel Jun 17, 2020
14d385b
Restore some write_fmts
Lucretiel Jun 17, 2020
810f309
MIR sanity check: validate types on assignment
RalfJung May 30, 2020
50d7dea
prepare visit_statement for checking more kinds of statements
RalfJung May 31, 2020
93e3552
also normalize constants when comparing types
RalfJung May 31, 2020
9576e30
also normalize_erasing_regions
RalfJung Jun 1, 2020
8200771
reveal_all when sanity-checking MIR assignment types
RalfJung Jun 6, 2020
978470f
no need to normalize mutability any more
RalfJung Jun 21, 2020
91f73fb
use a TypeRelation to compare the types
RalfJung Jun 21, 2020
7754322
fix typo
RalfJung Jun 22, 2020
7f8fe6a
also use relator in interpreter assignment sanity check
RalfJung Jun 22, 2020
5e5ae8b
expand a comment
RalfJung Jun 22, 2020
a593728
make layout check a mere sanity check
RalfJung Jun 22, 2020
35911ee
reduce sanity check in debug mode
RalfJung Jun 24, 2020
5e28eb5
Adds a clearer message for when the async keyword is missing from a f…
nellshamrell Jun 18, 2020
3678e5c
errors: use `-Z terminal-width` in JSON emitter
davidtwco Jun 26, 2020
a4e7b47
use LocalDefId in module checking
lcnr Jun 27, 2020
1875c79
more LocalDefId in ty::context
lcnr Jun 27, 2020
2d280a5
more LocalDefId cleanup
lcnr Jun 27, 2020
9308860
fix typo in self-profile.md
atetubou Jun 27, 2020
4c14f9d
Forward Hash::write_iN to Hash::write_uN
nikic Jun 27, 2020
d25d6c5
Update the documentation to point to open instead of is_file and is_dir
poliorcetics Jun 27, 2020
2765149
Serialize all foreign `SourceFile`s into proc-macro crate metadata
Aaron1011 Jun 24, 2020
0e0584f
Add links to fs::DirEntry::metadata
robyoung Jun 27, 2020
8e8c54a
Added the parapgrah to path::Path::is_file too
poliorcetics Jun 27, 2020
9e4d353
Rollup merge of #72705 - Lucretiel:stdio-forwarding, r=Amanieu
Manishearth Jun 28, 2020
e0026eb
Rollup merge of #72796 - RalfJung:mir-assign-sanity, r=matthewjasper
Manishearth Jun 28, 2020
9f575a7
Rollup merge of #73243 - poliorcetics:discourage-is-file, r=Amanieu
Manishearth Jun 28, 2020
efa06a7
Rollup merge of #73672 - nellshamrell:async-fix, r=estebank
Manishearth Jun 28, 2020
a481665
Rollup merge of #73706 - Aaron1011:fix/proc-macro-foreign-span, r=pet…
Manishearth Jun 28, 2020
0269560
Rollup merge of #73763 - davidtwco:terminal-width-json-emitter, r=est…
Manishearth Jun 28, 2020
8ea7283
Rollup merge of #73796 - lcnr:LocalDefId, r=matthewjasper
Manishearth Jun 28, 2020
2da0dcd
Rollup merge of #73797 - atetubou:patch-1, r=jonas-schievink
Manishearth Jun 28, 2020
2e7ac62
Rollup merge of #73800 - nikic:hash_i, r=kennytm
Manishearth Jun 28, 2020
0eb1ce0
Rollup merge of #73809 - robyoung:docs/add-links-to-DirEntry-metadata…
Manishearth Jun 28, 2020
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
2 changes: 1 addition & 1 deletion src/doc/unstable-book/src/compiler-flags/self-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For example:
First, run a compilation session and provide the `-Zself-profile` flag:

```console
$ rustc --crate-name foo -Zself-profile`
$ rustc --crate-name foo -Zself-profile
```

This will generate three files in the working directory such as:
Expand Down
1 change: 1 addition & 0 deletions src/libcore/future/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::task::{Context, Poll};
#[must_use = "futures do nothing unless you `.await` or poll them"]
#[stable(feature = "futures_api", since = "1.36.0")]
#[lang = "future_trait"]
#[rustc_on_unimplemented(label = "`{Self}` is not a future", message = "`{Self}` is not a future")]
pub trait Future {
/// The type of value produced on completion.
#[stable(feature = "futures_api", since = "1.36.0")]
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,31 +333,31 @@ pub trait Hasher {
#[inline]
#[stable(feature = "hasher_write", since = "1.3.0")]
fn write_i16(&mut self, i: i16) {
self.write(&i.to_ne_bytes())
self.write_u16(i as u16)
}
/// Writes a single `i32` into this hasher.
#[inline]
#[stable(feature = "hasher_write", since = "1.3.0")]
fn write_i32(&mut self, i: i32) {
self.write(&i.to_ne_bytes())
self.write_u32(i as u32)
}
/// Writes a single `i64` into this hasher.
#[inline]
#[stable(feature = "hasher_write", since = "1.3.0")]
fn write_i64(&mut self, i: i64) {
self.write(&i.to_ne_bytes())
self.write_u64(i as u64)
}
/// Writes a single `i128` into this hasher.
#[inline]
#[stable(feature = "i128", since = "1.26.0")]
fn write_i128(&mut self, i: i128) {
self.write(&i.to_ne_bytes())
self.write_u128(i as u128)
}
/// Writes a single `isize` into this hasher.
#[inline]
#[stable(feature = "hasher_write", since = "1.3.0")]
fn write_isize(&mut self, i: isize) {
self.write(&i.to_ne_bytes())
self.write_usize(i as usize)
}
}

Expand Down
15 changes: 14 additions & 1 deletion src/librustc_errors/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct JsonEmitter {
pretty: bool,
ui_testing: bool,
json_rendered: HumanReadableErrorType,
terminal_width: Option<usize>,
macro_backtrace: bool,
}

Expand All @@ -45,6 +46,7 @@ impl JsonEmitter {
source_map: Lrc<SourceMap>,
pretty: bool,
json_rendered: HumanReadableErrorType,
terminal_width: Option<usize>,
macro_backtrace: bool,
) -> JsonEmitter {
JsonEmitter {
Expand All @@ -54,13 +56,15 @@ impl JsonEmitter {
pretty,
ui_testing: false,
json_rendered,
terminal_width,
macro_backtrace,
}
}

pub fn basic(
pretty: bool,
json_rendered: HumanReadableErrorType,
terminal_width: Option<usize>,
macro_backtrace: bool,
) -> JsonEmitter {
let file_path_mapping = FilePathMapping::empty();
Expand All @@ -69,6 +73,7 @@ impl JsonEmitter {
Lrc::new(SourceMap::new(file_path_mapping)),
pretty,
json_rendered,
terminal_width,
macro_backtrace,
)
}
Expand All @@ -79,6 +84,7 @@ impl JsonEmitter {
source_map: Lrc<SourceMap>,
pretty: bool,
json_rendered: HumanReadableErrorType,
terminal_width: Option<usize>,
macro_backtrace: bool,
) -> JsonEmitter {
JsonEmitter {
Expand All @@ -88,6 +94,7 @@ impl JsonEmitter {
pretty,
ui_testing: false,
json_rendered,
terminal_width,
macro_backtrace,
}
}
Expand Down Expand Up @@ -247,7 +254,13 @@ impl Diagnostic {
let buf = BufWriter::default();
let output = buf.clone();
je.json_rendered
.new_emitter(Box::new(buf), Some(je.sm.clone()), false, None, je.macro_backtrace)
.new_emitter(
Box::new(buf),
Some(je.sm.clone()),
false,
je.terminal_width,
je.macro_backtrace,
)
.ui_testing(je.ui_testing)
.emit_diagnostic(diag);
let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,27 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
br: &ty::BoundRegion,
) -> Option<(&hir::Ty<'tcx>, &hir::FnDecl<'tcx>)> {
if let Some(anon_reg) = self.tcx().is_suitable_region(region) {
let def_id = anon_reg.def_id;
if let Some(def_id) = def_id.as_local() {
let hir_id = self.tcx().hir().as_local_hir_id(def_id);
let fndecl = match self.tcx().hir().get(hir_id) {
Node::Item(&hir::Item { kind: hir::ItemKind::Fn(ref m, ..), .. })
| Node::TraitItem(&hir::TraitItem {
kind: hir::TraitItemKind::Fn(ref m, ..),
..
})
| Node::ImplItem(&hir::ImplItem {
kind: hir::ImplItemKind::Fn(ref m, ..),
..
}) => &m.decl,
_ => return None,
};
let hir_id = self.tcx().hir().as_local_hir_id(anon_reg.def_id);
let fndecl = match self.tcx().hir().get(hir_id) {
Node::Item(&hir::Item { kind: hir::ItemKind::Fn(ref m, ..), .. })
| Node::TraitItem(&hir::TraitItem {
kind: hir::TraitItemKind::Fn(ref m, ..),
..
})
| Node::ImplItem(&hir::ImplItem {
kind: hir::ImplItemKind::Fn(ref m, ..), ..
}) => &m.decl,
_ => return None,
};

return fndecl
.inputs
.iter()
.find_map(|arg| self.find_component_for_bound_region(arg, br))
.map(|ty| (ty, &**fndecl));
}
fndecl
.inputs
.iter()
.find_map(|arg| self.find_component_for_bound_region(arg, br))
.map(|ty| (ty, &**fndecl))
} else {
None
}
None
}

// This method creates a FindNestedTypeVisitor which returns the type corresponding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
}

if let Some((_, fndecl)) = self.find_anon_type(anon, &br) {
let is_self_anon = self.is_self_anon(is_first, scope_def_id);
if is_self_anon {
if self.is_self_anon(is_first, scope_def_id) {
return None;
}

Expand Down
Loading