Commit Graph

554 Commits

Author SHA1 Message Date
Dylan DPC 2b5325dbff Rollup merge of #71489 - spastorino:fix-treat-err-as-bug-handling, r=eddyb
Fix off by one in treat err as bug

`-Ztreat-err-as-bug` doesn't work properly with delay_span_bug.

r? @eddyb
2020-04-28 13:12:14 +02:00
Santiago Pastorino 230e40644b Fix off by one error for delay_span_bug
delay_span_bug bumps error_count after checking treat_err_as_bug
2020-04-27 09:14:30 -03:00
Josh Stone 4282776b1c Replace filter_map().next() calls with find_map()
These are semantically the same, but `find_map()` is more concise.
2020-04-24 20:03:45 -07:00
Matthias Krüger 3837df2992 don't clone types that are copy (clippy::clone_on_copy) 2020-04-16 00:17:38 +02:00
David Renshaw 57ed3d378d fix issue 69130 2020-04-12 11:36:37 -04:00
RoccoDev b85c64c3ea rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
Linus Färnstrand f7778d36c7 Use assoc integer constants in librustc_* 2020-04-07 00:43:16 +02:00
Mazdak Farrokhzad eea91c308f Rollup merge of #70519 - estebank:constraints-before-args-spans, r=Centril
Tweak output of type params and constraints in the wrong order

r? @Centril @varkor
2020-04-06 04:24:15 +02:00
Matthias Krüger 9bba047c2e Use if let instead of match when only matching a single variant (clippy::single_match)
Makes code more compact and reduces nestig.
2020-03-30 10:52:29 +02:00
Mazdak Farrokhzad 7710f2dd5c rustc -> rustc_middle part 1 2020-03-30 07:02:56 +02:00
Esteban Küber c2e0e71a09 Suggest correct order for arguments when encountering early constraints
When encountering constraints before type arguments or lifetimes,
suggest the correct order.
2020-03-29 11:31:58 -07:00
Niko Matsakis fda3378e3f introduce negative_impls feature gate and document
They used to be covered by `optin_builtin_traits` but negative impls
are now applicable to all traits, not just auto traits.

This also adds docs in the unstable book for the current state of auto traits.
2020-03-26 06:52:55 -04:00
Mazdak Farrokhzad 560eae31c5 Rollup merge of #70199 - pnkfelix:issue-68808-dont-turn-dummy-spans-into-invalid-lines, r=estebank
Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.

This required revising some of the client code to stop relying on the returned set of lines being non-empty.

Fix #68808
2020-03-23 19:04:51 +01:00
Matthias Krüger 263cbd1bbe remove redundant closures (clippy::redundant_closure) 2020-03-22 12:43:19 +01:00
Felix S. Klock II ebf27fac81 Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.
This required revising some of the client code to stop relying on
the returned set of lines being non-empty.
2020-03-20 14:11:16 -04:00
Mazdak Farrokhzad 4392a8b73c use direct imports for rustc::{lint, session}. 2020-03-16 02:52:06 +01:00
Ana-Maria Mihalache 4809be0137 rustc_errors: Use ensure_source_file_source_present where necessary. 2020-03-10 07:26:27 +01:00
Mazdak Farrokhzad fd302f46dc Store TokenStream in rmeta::MacroDef.
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-03-10 07:26:27 +01:00
Matthias Krüger 80ed505c41 Use single-char patter on {ends,starts}_with and remove clone on copy type.
These were introduced since I last fixed most of these occurences. (clippy::clone_on_copy, clippy::single_char_pattern)
2020-03-04 20:47:05 +01:00
Matthias Krüger d8d2004c6f Don't use "if let" bindings to only check a value and not actually bind anything.
For example:  `if let Some(_) = foo() {}`	can be reduced to	`if foo().is_some() {}`   (clippy::redundant_pattern_matching)
2020-03-04 20:41:03 +01:00
Yuki Okushi ef311d5ab4 Rollup merge of #69628 - nnethercote:fix-DiagnosticBuilder-into_diagnostic-leak, r=Centril
Fix a leak in `DiagnosticBuilder::into_diagnostic`.

Fixes #69600.

r? @Centril
2020-03-03 17:50:13 +09:00
Yuki Okushi f19684c7cf Rollup merge of #69619 - matthiaskrgr:misc, r=eddyb
more cleanups

* use starts_with() instead of chars().next() == Some(x)
* use subsec_micros() instead of subsec_nanos() / 1000
* use for (idx, item) in iter.enumerate() instead of manually counting loop iterations with variables
* use values() or keys() respectively when iterating only over keys or values of maps.
2020-03-03 17:50:08 +09:00
Dylan DPC 0255561dea Rollup merge of #69623 - Centril:fix-69396-tmp, r=petrochenkov
stash API: remove panic to fix ICE.

Implements the temporary solution suggested in https://github.com/rust-lang/rust/pull/69537#issuecomment-593143975.
Fixes https://github.com/rust-lang/rust/issues/69396.

r? @petrochenkov
2020-03-02 13:42:41 +01:00
Nicholas Nethercote 99a595e406 Fix a leak in DiagnosticBuilder::into_diagnostic.
Fixes #69600.
2020-03-02 14:42:46 +11:00
Mazdak Farrokhzad df20036848 stash API: remove panic to fix ICE. 2020-03-02 00:07:23 +01:00
Matthias Krüger 22339c3406 use for (idx, item) in iter.enumerate() instead of manually counting loop iterations by variables 2020-03-01 21:17:48 +01:00
Jake Vossen 5f3ffee6b7 added try_find_description to distinguish no desc from invalid code 2020-02-29 11:53:51 -07:00
bors 3f9bddc7fe Auto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #69477 (docs: add mention of async blocks in move keyword docs)
 - #69504 (Use assert_ne in hash tests)
 - #69546 (use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.)
 - #69551 (use is_empty() instead of len() == x  to determine if structs are empty.)
 - #69563 (Fix no_std detection for target triples)
 - #69567 (use .to_string() instead of format!() macro to create strings)

Failed merges:

r? @ghost
2020-02-29 10:43:32 +00:00
bors 04e7f96dd8 Auto merge of #69227 - Marwes:buffer_stderr, r=varkor
perf: Buffer stderr when writing json errors/warnings

Since `stderr` is unbuffered, writing out json messages actually take up
about ~10%/0.1s of the runtime of the `inflate` benchmark as it generates a fair number of warnings.

cc #64413
2020-02-29 07:27:29 +00:00
Dylan DPC bbfec7ca41 Rollup merge of #69567 - matthiaskrgr:useless_fmt, r=nagisa
use .to_string() instead of format!() macro to create strings

handles what is left after https://github.com/rust-lang/rust/pull/69541
2020-02-29 02:16:24 +01:00
Matthias Krüger 85e59b7664 use .to_string() instead of format!() macro to create strings 2020-02-29 01:32:42 +01:00
Matthias Krüger 9523c89f18 use is_empty() instead of len() == x to determine if structs are empty. 2020-02-28 15:16:27 +01:00
Maxim Zholobak 20c9a40fec Rename CodeMap to SourceMap follow up 2020-02-22 16:17:31 +02:00
Markus Westerlind ee064befa0 Ensure diagnostics are printed in the correct order
Even when buffered. Ideally we would flush only when the emitter is
done, but that requires larger changes. This gives most of the benefit
of buffering in any case.
2020-02-17 16:46:53 +01:00
Markus Westerlind 7ac4154643 perf: Buffer stderr when writing json errors/warnings
Since `stderr` is unbuffered, writing out json messages actually take up
about ~10%/0.1s of the runtime of the `inflate` benchmark.

cc #64413
2020-02-17 15:35:42 +01:00
bors 3f32e3001e Auto merge of #69062 - Dylan-DPC:rollup-7wpjpqu, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #66498 (Remove unused feature gates)
 - #68816 (Tweak borrow error on `FnMut` when `Fn` is expected)
 - #68824 (Enable Control Flow Guard in rustbuild)
 - #69022 (traits: preallocate 2 Vecs of known initial size)
 - #69031 (Use `dyn Trait` more in tests)
 - #69044 (Don't run coherence twice for future-compat lints)
 - #69047 (Don't rustfmt check the vendor directory.)
 - #69055 (Clean up E0307 explanation)

Failed merges:

r? @ghost
2020-02-11 17:45:49 +00:00
Dylan DPC ec0cfd1d01 Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPC
Remove unused feature gates

I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-11 16:36:54 +01:00
jumbatm d246385122 Run RustFmt 2020-02-11 19:49:01 +10:00
jumbatm 7c58ffe874 Invert control in struct_lint_level.
Caller now passes in a `decorate` function, which is only run if the
lint is allowed.
2020-02-11 19:47:40 +10:00
bors f8d830b4de Auto merge of #68376 - Centril:move-ref-patterns, r=matthewjasper
Initial implementation of `#![feature(move_ref_pattern)]`

Following up on #45600, under the gate `#![feature(move_ref_pattern)]`, `(ref x, mut y)` is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for `#![feature(bindings_after_at)]` is also adjusted as necessary.

Closes #45600.
Tracking issue: #68354.

r? @matthewjasper
2020-02-09 04:01:28 +00:00
Eduard-Mihai Burtescu 4c7eb59e81 rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
Eduard-Mihai Burtescu ab080973cb rustc_errors: hide "in this macro invocation" when redundant, more explicitly. 2020-02-06 21:32:07 +02:00
Eduard-Mihai Burtescu 5eaa9a150d rustc_errors: deduplicate the -Zmacro-backtrace suggestion message. 2020-02-06 21:32:07 +02:00
Eduard-Mihai Burtescu f6fc80206e rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace. 2020-02-06 21:32:07 +02:00
Eduard-Mihai Burtescu 8f286dbf27 rustc_errors: split macro backtrace rendering from <*macros> hacks. 2020-02-06 21:32:07 +02:00
bjorn3 3e61d52784 Remove unused feature gates from librustc_errors 2020-02-04 19:18:11 +01:00
Mazdak Farrokhzad 7af9ff3e69 introduce #![feature(move_ref_pattern)] 2020-02-02 14:13:07 +01:00
Dylan DPC 4af33a9c26 Rollup merge of #68626 - Zoxc:termize, r=estebank
Use termize instead of term_size

`termize` is a fork of `term_size` which uses `winapi` 0.3 instead of 0.2. This is a step towards removing the `winapi` 0.2 dependency.

r? @Mark-Simulacrum
2020-01-30 01:46:43 +01:00
John Kåre Alsaker b0b11d31a2 Use termize instead of term_size 2020-01-29 01:13:48 +01:00
Michael Burge 79d8c9beab Correct ICE caused by macros generating invalid spans. 2020-01-28 11:02:22 -08:00