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 24 pull requests #59012

Merged
merged 62 commits into from
Mar 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
adddee4
Add FreeBSD armv6 and armv7 targets
Feb 2, 2019
dc4973d
Expand where negative supertrait specific error is shown
estebank Mar 1, 2019
edbbfad
Suggest removal of `&` when borrowing macro and appropriate
estebank Mar 2, 2019
df852c0
Suggest appropriate code for unused field when desrtucturing patttern
estebank Mar 2, 2019
020539e
Remove stray ` in the documentation for the FromIterator implementati…
Mar 3, 2019
2293d22
race condition in thread local storage example
benaryorg Mar 3, 2019
41e60d1
Monomorphize generator field types for debuginfo
Nemo157 Mar 3, 2019
1fec8c2
Make the Entry API of HashMap<K, V> Sync and Send (fixes #45219)
nox Feb 10, 2019
b129de4
Regression test for #58435.
pnkfelix Mar 4, 2019
9ed94e5
Fix release note problems noticed after merging.
Mark-Simulacrum Feb 28, 2019
6dd2a85
Regression test added for an async ICE.
gilescope Mar 4, 2019
9e8a62b
On return type `impl Trait` for block with no expr point at last semi
estebank Feb 5, 2019
f2718dc
Add fixme
estebank Feb 7, 2019
842014d
Add an explicit test for issue #50582
cuviper Mar 4, 2019
e6387b6
Fix rebase and move suggestion to its own method
estebank Mar 4, 2019
cd9a0cf
Make the lifetime parameters of tcx consistent.
gabi-250 Mar 4, 2019
cbe3344
Add librustc, libsyntax to rust-src distribution.
taeguk Feb 7, 2019
2983d9c
Elide invalid method receiver error when it contains TyErr
estebank Mar 5, 2019
33a6469
Unrolled await macro.
gilescope Mar 5, 2019
c0cef33
Remove JSBackend from config.toml
ThisIsADogHello Mar 5, 2019
fcec51d
Removed whitespace
gilescope Mar 5, 2019
8ebc609
Add self to mailmap
Lucretiel Mar 5, 2019
669be1a
On incorrect cfg literal/identifier, point at the right span
estebank Mar 6, 2019
0d39797
libstd: implement Error::source for io::Error
seanmonstar Mar 6, 2019
143e7d5
Desugared asyncs into generators and minimised.
gilescope Mar 6, 2019
c076701
Regression test for #58813
pnkfelix Mar 4, 2019
d2482fd
Avoid ICE during `repr(packed)` well-formedness check via delay_span_…
pnkfelix Mar 6, 2019
533f011
Regression test for issue #58158.
pnkfelix Mar 6, 2019
02eb523
Surround found token with `
estebank Mar 6, 2019
7a55a00
Make `-Z treat-err-as-bug` take a number of errors to be emitted
estebank Mar 7, 2019
7694ca1
Fix incorrect default
estebank Mar 7, 2019
754037d
fix bad use of with_emitter
estebank Mar 7, 2019
c41ddf1
Keep current behavior while accepting error count
estebank Mar 7, 2019
a7563a3
fix bad logic
estebank Mar 7, 2019
bc9b936
Fix with_emitter callers
estebank Mar 7, 2019
e3299f2
Update treat-err-as-bug help text
estebank Mar 7, 2019
29716ef
update treat-err-as-bug test
estebank Mar 7, 2019
8bb62d1
Add a test for invalid const arguments
varkor Mar 7, 2019
19e39cb
Rollup merge of #58080 - MikaelUrankar:freebsd_arm, r=sanxiyn
pietroalbini Mar 8, 2019
4797568
Rollup merge of #58204 - estebank:impl-trait-semi, r=zackmdavis
pietroalbini Mar 8, 2019
bf7b502
Rollup merge of #58269 - taeguk:add-some-sources-to-rust-src-distribu…
pietroalbini Mar 8, 2019
55dc386
Rollup merge of #58369 - nox:sync-hash-map-entry, r=Amanieu
pietroalbini Mar 8, 2019
a68f760
Rollup merge of #58861 - estebank:fix-negative-traits, r=petrochenkov
pietroalbini Mar 8, 2019
4fbeb11
Rollup merge of #58877 - estebank:macro-borrow, r=davidtwco
pietroalbini Mar 8, 2019
3005b4d
Rollup merge of #58883 - estebank:unused-closure-arg, r=varkor
pietroalbini Mar 8, 2019
9c99511
Rollup merge of #58891 - Delta-Psi:doc-fixes, r=Centril
pietroalbini Mar 8, 2019
4bff63f
Rollup merge of #58893 - benaryorg:thread_local_example_join, r=alexc…
pietroalbini Mar 8, 2019
4083c69
Rollup merge of #58906 - Nemo157:generator-state-debug-info, r=Zoxc
pietroalbini Mar 8, 2019
c789291
Rollup merge of #58911 - pnkfelix:issue-58435-regression-test, r=alex…
pietroalbini Mar 8, 2019
eaafcb7
Rollup merge of #58912 - pnkfelix:issue-58813-incr-comp-regress-test,…
pietroalbini Mar 8, 2019
d9c6908
Rollup merge of #58916 - tspiteri:release-notes, r=petrochenkov
pietroalbini Mar 8, 2019
c99a240
Rollup merge of #58918 - gilescope:async-await-issue-testcase, r=petr…
pietroalbini Mar 8, 2019
416edc1
Rollup merge of #58921 - cuviper:issue-50582, r=varkor
pietroalbini Mar 8, 2019
40daa06
Rollup merge of #58926 - gabi-250:tcx-lifetimes, r=petrochenkov
pietroalbini Mar 8, 2019
254bc42
Rollup merge of #58931 - estebank:elide-receiver-tyerr, r=varkor
pietroalbini Mar 8, 2019
b2f7968
Rollup merge of #58940 - ThisIsADogHello:patch-1, r=alexcrichton
pietroalbini Mar 8, 2019
1d33fc9
Rollup merge of #58950 - Lucretiel:patch-5, r=alexcrichton
pietroalbini Mar 8, 2019
54a5073
Rollup merge of #58961 - estebank:issue-58462, r=varkor
pietroalbini Mar 8, 2019
378a011
Rollup merge of #58963 - seanmonstar:patch-3, r=cramertj
pietroalbini Mar 8, 2019
c51c90c
Rollup merge of #58970 - pnkfelix:issue-58158-size-of-assoc-type-ice,…
pietroalbini Mar 8, 2019
72d4c1e
Rollup merge of #58984 - estebank:multi-treat-err-as-bug, r=oli-obk
pietroalbini Mar 8, 2019
961e378
Rollup merge of #59007 - varkor:invalid-const-arg-test, r=petrochenkov
pietroalbini Mar 8, 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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ Michael Woerister <michaelwoerister@posteo> <michaelwoerister@gmail>
Mickaël Raybaud-Roig <[email protected]> m-r-r <[email protected]>
Ms2ger <[email protected]> <[email protected]>
Mukilan Thiagarajan <[email protected]>
Nathan West <[email protected]> <[email protected]>
Nathan Wilson <[email protected]>
Nathaniel Herman <[email protected]> Nathaniel Herman <[email protected]>
Neil Pankey <[email protected]> <[email protected]>
Expand Down
44 changes: 23 additions & 21 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Version 1.33.0 (2019-02-28)
Language
--------
- [You can now use the `cfg(target_vendor)` attribute.][57465] E.g.
`#[cfg(target_vendor="linux")] fn main() { println!("Hello Linux!"); }`
`#[cfg(target_vendor="apple")] fn main() { println!("Hello Apple!"); }`
- [Integer patterns such as in a match expression can now be exhaustive.][56362]
E.g. You can have match statement on a `u8` that covers `0..=255` and
you would no longer be required to have a `_ => unreachable!()` case.
you would no longer be required to have a `_ => unreachable!()` case.
- [You can now have multiple patterns in `if let` and `while let`
expressions.][57532] You can do this with the same syntax as a `match`
expression. E.g.
Expand Down Expand Up @@ -51,8 +51,7 @@ Language
// Allowed as there is only one `Read` in the module.
pub trait Read {}
```
- [`extern` functions will now abort by default when panicking.][55982]
This was previously undefined behaviour.
- [You may now use `Rc`, `Arc`, and `Pin` as method receivers][56805].

Compiler
--------
Expand Down Expand Up @@ -109,27 +108,30 @@ Compatibility Notes
are now deprecated in the standard library, and their usage will now produce a warning.
Please use the `str::{trim_start, trim_end, trim_start_matches, trim_end_matches}`
methods instead.
- The `Error::cause` method has been deprecated in favor of `Error::source` which supports
downcasting.

[57615]: https://github.com/rust-lang/rust/pull/57615/
[57465]: https://github.com/rust-lang/rust/pull/57465/
[57532]: https://github.com/rust-lang/rust/pull/57532/
[57535]: https://github.com/rust-lang/rust/pull/57535/
[57566]: https://github.com/rust-lang/rust/pull/57566/
[55982]: https://github.com/rust-lang/rust/pull/55982/
[56303]: https://github.com/rust-lang/rust/pull/56303/
[56351]: https://github.com/rust-lang/rust/pull/56351/
[56362]: https://github.com/rust-lang/rust/pull/56362
[56642]: https://github.com/rust-lang/rust/pull/56642/
[56769]: https://github.com/rust-lang/rust/pull/56769/
[56805]: https://github.com/rust-lang/rust/pull/56805
[56947]: https://github.com/rust-lang/rust/pull/56947/
[57049]: https://github.com/rust-lang/rust/pull/57049/
[57067]: https://github.com/rust-lang/rust/pull/57067/
[57105]: https://github.com/rust-lang/rust/pull/57105
[57130]: https://github.com/rust-lang/rust/pull/57130/
[57167]: https://github.com/rust-lang/rust/pull/57167/
[57175]: https://github.com/rust-lang/rust/pull/57175/
[57234]: https://github.com/rust-lang/rust/pull/57234/
[57332]: https://github.com/rust-lang/rust/pull/57332/
[56947]: https://github.com/rust-lang/rust/pull/56947/
[57049]: https://github.com/rust-lang/rust/pull/57049/
[57067]: https://github.com/rust-lang/rust/pull/57067/
[56769]: https://github.com/rust-lang/rust/pull/56769/
[56642]: https://github.com/rust-lang/rust/pull/56642/
[56303]: https://github.com/rust-lang/rust/pull/56303/
[56351]: https://github.com/rust-lang/rust/pull/56351/
[55982]: https://github.com/rust-lang/rust/pull/55982/
[56362]: https://github.com/rust-lang/rust/pull/56362
[57105]: https://github.com/rust-lang/rust/pull/57105
[57465]: https://github.com/rust-lang/rust/pull/57465/
[57532]: https://github.com/rust-lang/rust/pull/57532/
[57535]: https://github.com/rust-lang/rust/pull/57535/
[57566]: https://github.com/rust-lang/rust/pull/57566/
[57615]: https://github.com/rust-lang/rust/pull/57615/
[cargo/6484]: https://github.com/rust-lang/cargo/pull/6484/
[`unix::FileExt::read_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.read_exact_at
[`unix::FileExt::write_all_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.write_all_at
Expand Down Expand Up @@ -170,7 +172,7 @@ Language
- [You can now match against literals in macros with the `literal`
specifier.][56072] This will match against a literal of any type.
E.g. `1`, `'A'`, `"Hello World"`
- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g.
- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g.
```rust
struct Point(i32, i32);

Expand Down Expand Up @@ -460,7 +462,7 @@ Version 1.31.0 (2018-12-06)

Language
--------
- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉
- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉
- [New lifetime elision rules now allow for eliding lifetimes in functions and
impl headers.][54778] E.g. `impl<'a> Reader for BufReader<'a> {}` can now be
`impl Reader for BufReader<'_> {}`. Lifetimes are still required to be defined
Expand Down
2 changes: 1 addition & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# support. You'll need to write a target specification at least, and most
# likely, teach rustc about the C ABI of the target. Get in touch with the
# Rust team and file an issue if you need assistance in porting!
#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon"
#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;MSP430;Sparc;NVPTX;Hexagon"

# LLVM experimental targets to build support for. These targets are specified in
# the same format as above, but since these targets are experimental, they are
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ def default_build_triple():
cputype = 'arm'
if ostype == 'linux-android':
ostype = 'linux-androideabi'
elif ostype == 'unknown-freebsd':
cputype = subprocess.check_output(
['uname', '-p']).strip().decode(default_encoding)
ostype = 'unknown-freebsd'
elif cputype == 'armv6l':
cputype = 'arm'
if ostype == 'linux-android':
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ impl Step for Src {
"src/stdsimd",
"src/libproc_macro",
"src/tools/rustc-std-workspace-core",
"src/librustc",
"src/libsyntax",
];

copy_src_dirs(builder, &std_src_dirs[..], &[], &dst_src);
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
/// # Examples
///
/// Here is an example which increments every integer in a vector.
/// `We use the checked variant of `add` that returns `None` when the
/// We use the checked variant of `add` that returns `None` when the
/// calculation would result in an overflow.
///
/// ```
Expand Down
15 changes: 14 additions & 1 deletion src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,22 @@ fn visit_fn<'a, 'tcx: 'a>(ir: &mut IrMaps<'a, 'tcx>,
let body = ir.tcx.hir().body(body_id);

for arg in &body.arguments {
let is_shorthand = match arg.pat.node {
crate::hir::PatKind::Struct(..) => true,
_ => false,
};
arg.pat.each_binding(|_bm, hir_id, _x, ident| {
debug!("adding argument {:?}", hir_id);
fn_maps.add_variable(Arg(hir_id, ident.name));
let var = if is_shorthand {
Local(LocalInfo {
id: hir_id,
name: ident.name,
is_shorthand: true,
})
} else {
Arg(hir_id, ident.name)
};
fn_maps.add_variable(var);
})
};

Expand Down
15 changes: 12 additions & 3 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@ macro_rules! options {
Some("crate=integer");
pub const parse_unpretty: Option<&str> =
Some("`string` or `string=string`");
pub const parse_treat_err_as_bug: Option<&str> =
Some("either no value or a number bigger than 0");
pub const parse_lto: Option<&str> =
Some("either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, \
`fat`, or omitted");
Expand Down Expand Up @@ -1022,6 +1024,13 @@ macro_rules! options {
}
}

fn parse_treat_err_as_bug(slot: &mut Option<usize>, v: Option<&str>) -> bool {
match v {
Some(s) => { *slot = s.parse().ok().filter(|&x| x != 0); slot.unwrap_or(0) != 0 }
None => { *slot = Some(1); true }
}
}

fn parse_lto(slot: &mut LtoCli, v: Option<&str>) -> bool {
if v.is_some() {
let mut bool_arg = None;
Expand Down Expand Up @@ -1236,8 +1245,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"load proc macros for both target and host, but only link to the target"),
no_codegen: bool = (false, parse_bool, [TRACKED],
"run all passes except codegen; no output"),
treat_err_as_bug: bool = (false, parse_bool, [TRACKED],
"treat all errors that occur as bugs"),
treat_err_as_bug: Option<usize> = (None, parse_treat_err_as_bug, [TRACKED],
"treat error number `val` that occurs as bug"),
report_delayed_bugs: bool = (false, parse_bool, [TRACKED],
"immediately print bugs registered with `delay_span_bug`"),
external_macro_backtrace: bool = (false, parse_bool, [UNTRACKED],
Expand Down Expand Up @@ -3214,7 +3223,7 @@ mod tests {
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());

opts = reference.clone();
opts.debugging_opts.treat_err_as_bug = true;
opts.debugging_opts.treat_err_as_bug = Some(1);
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());

opts = reference.clone();
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
Box::new(EmitterWriter::stderr(color_config, None, true, false))
}
};
let handler = errors::Handler::with_emitter(true, false, emitter);
let handler = errors::Handler::with_emitter(true, None, emitter);
handler.emit(&MultiSpan::new(), msg, errors::Level::Fatal);
errors::FatalError.raise();
}
Expand All @@ -1330,7 +1330,7 @@ pub fn early_warn(output: config::ErrorOutputType, msg: &str) {
Box::new(EmitterWriter::stderr(color_config, None, true, false))
}
};
let handler = errors::Handler::with_emitter(true, false, emitter);
let handler = errors::Handler::with_emitter(true, None, emitter);
handler.emit(&MultiSpan::new(), msg, errors::Level::Warning);
}

Expand Down
64 changes: 52 additions & 12 deletions src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,12 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
}
}

pub fn report_selection_error(&self,
obligation: &PredicateObligation<'tcx>,
error: &SelectionError<'tcx>,
fallback_has_occurred: bool)
{
pub fn report_selection_error(
&self,
obligation: &PredicateObligation<'tcx>,
error: &SelectionError<'tcx>,
fallback_has_occurred: bool,
) {
let span = obligation.cause.span;

let mut err = match *error {
Expand Down Expand Up @@ -673,6 +674,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {

self.suggest_borrow_on_unsized_slice(&obligation.cause.code, &mut err);
self.suggest_remove_reference(&obligation, &mut err, &trait_ref);
self.suggest_semicolon_removal(&obligation, &mut err, span, &trait_ref);

// Try to report a help message
if !trait_ref.has_infer_types() &&
Expand Down Expand Up @@ -901,9 +903,11 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {

/// When encountering an assignment of an unsized trait, like `let x = ""[..];`, provide a
/// suggestion to borrow the initializer in order to use have a slice instead.
fn suggest_borrow_on_unsized_slice(&self,
code: &ObligationCauseCode<'tcx>,
err: &mut DiagnosticBuilder<'tcx>) {
fn suggest_borrow_on_unsized_slice(
&self,
code: &ObligationCauseCode<'tcx>,
err: &mut DiagnosticBuilder<'tcx>,
) {
if let &ObligationCauseCode::VariableType(node_id) = code {
let parent_node = self.tcx.hir().get_parent_node(node_id);
if let Some(Node::Local(ref local)) = self.tcx.hir().find(parent_node) {
Expand All @@ -925,10 +929,12 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {

/// Whenever references are used by mistake, like `for (i, e) in &vec.iter().enumerate()`,
/// suggest removing these references until we reach a type that implements the trait.
fn suggest_remove_reference(&self,
obligation: &PredicateObligation<'tcx>,
err: &mut DiagnosticBuilder<'tcx>,
trait_ref: &ty::Binder<ty::TraitRef<'tcx>>) {
fn suggest_remove_reference(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut DiagnosticBuilder<'tcx>,
trait_ref: &ty::Binder<ty::TraitRef<'tcx>>,
) {
let trait_ref = trait_ref.skip_binder();
let span = obligation.cause.span;

Expand Down Expand Up @@ -970,6 +976,40 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
}
}

fn suggest_semicolon_removal(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut DiagnosticBuilder<'tcx>,
span: Span,
trait_ref: &ty::Binder<ty::TraitRef<'tcx>>,
) {
let hir = self.tcx.hir();
let parent_node = hir.get_parent_node(
hir.hir_to_node_id(obligation.cause.body_id),
);
let node = hir.find(parent_node);
if let Some(hir::Node::Item(hir::Item {
node: hir::ItemKind::Fn(decl, _, _, body_id),
..
})) = node {
let body = hir.body(*body_id);
if let hir::ExprKind::Block(blk, _) = &body.value.node {
if decl.output.span().overlaps(span) && blk.expr.is_none() &&
"()" == &trait_ref.self_ty().to_string()
{
// FIXME(estebank): When encountering a method with a trait
// bound not satisfied in the return type with a body that has
// no return, suggest removal of semicolon on last statement.
// Once that is added, close #54771.
if let Some(ref stmt) = blk.stmts.last() {
let sp = self.tcx.sess.source_map().end_point(stmt.span);
err.span_label(sp, "consider removing this semicolon");
}
}
}
}
}

/// Given some node representing a fn-like thing in the HIR map,
/// returns a span and `ArgKind` information that describes the
/// arguments it expects. This can be supplied to
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
) -> EncodedMetadata {
base::write_metadata(tcx, metadata)
}
fn codegen_allocator(
fn codegen_allocator<'b, 'gcx>(
&self,
tcx: TyCtxt<'_, '_, '_>,
tcx: TyCtxt<'b, 'gcx, 'gcx>,
mods: &mut ModuleLlvm,
kind: AllocatorKind
) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ pub struct CodegenContext<B: WriteBackendMethods> {

impl<B: WriteBackendMethods> CodegenContext<B> {
pub fn create_diag_handler(&self) -> Handler {
Handler::with_emitter(true, false, Box::new(self.diag_emitter.clone()))
Handler::with_emitter(true, None, Box::new(self.diag_emitter.clone()))
}

pub fn config(&self, kind: ModuleKind) -> &ModuleConfig {
Expand Down
1 change: 1 addition & 0 deletions src/librustc_codegen_ssa/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
.zip(state_tys)
.enumerate()
.filter_map(move |(i, (decl, ty))| {
let ty = fx.monomorphize(&ty);
decl.name.map(|name| (i + upvar_count + 1, name, false, ty))
})
}).into_iter().flatten();
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_ssa/traits/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se
tcx: TyCtxt<'b, 'gcx, 'gcx>,
metadata: &mut Self::Module,
) -> EncodedMetadata;
fn codegen_allocator(
fn codegen_allocator<'b, 'gcx>(
&self,
tcx: TyCtxt<'_, '_, '_>,
tcx: TyCtxt<'b, 'gcx, 'gcx>,
mods: &mut Self::Module,
kind: AllocatorKind
);
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn run<F>(run_compiler: F) -> isize
true,
false
);
let handler = errors::Handler::with_emitter(true, false, Box::new(emitter));
let handler = errors::Handler::with_emitter(true, None, Box::new(emitter));
handler.emit(&MultiSpan::new(),
"aborting due to previous error(s)",
errors::Level::Fatal);
Expand Down Expand Up @@ -1327,7 +1327,7 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) -> Result<(), CompilationFail
None,
false,
false));
let handler = errors::Handler::with_emitter(true, false, emitter);
let handler = errors::Handler::with_emitter(true, None, emitter);

// a .span_bug or .bug call has already printed what
// it wants to print.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_driver/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn test_env_with_pool<F>(
) where
F: FnOnce(Env),
{
let diagnostic_handler = errors::Handler::with_emitter(true, false, emitter);
let diagnostic_handler = errors::Handler::with_emitter(true, None, emitter);
let sess = session::build_session_(
options,
None,
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_errors/diagnostic_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ impl<'a> DiagnosticBuilder<'a> {
/// Buffers the diagnostic for later emission, unless handler
/// has disabled such buffering.
pub fn buffer(mut self, buffered_diagnostics: &mut Vec<Diagnostic>) {
if self.handler.flags.dont_buffer_diagnostics || self.handler.flags.treat_err_as_bug {
if self.handler.flags.dont_buffer_diagnostics ||
self.handler.flags.treat_err_as_bug.is_some()
{
self.emit();
return;
}
Expand Down
Loading