Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dee3d27
allow clippy::unreadable_literal in unicode tables
euclio Jun 23, 2019
8c050fc
rustc: compute `ty::layout::Niche`'s `available` on the fly.
eddyb Jul 11, 2019
dfbf464
rustc_target: move abi::Niche from rustc::ty::layout.
eddyb Jul 12, 2019
88eced5
rustc: precompute the largest Niche and store it in LayoutDetails.
eddyb Jul 15, 2019
d1aca3a
renamed `inner_deref` feature's `deref*()` methods `as_deref*()` as p…
Xandkeeper Apr 1, 2019
6a9d749
fixed breaking changes
Xandkeeper Apr 2, 2019
f2a9721
Use DerefMut
JohnTitor Jul 5, 2019
59634bc
Replace deref with as_deref
JohnTitor Jul 5, 2019
3427a14
Remove support for -Zlower-128bit-ops
bjorn3 Jul 19, 2019
e8a1e73
Update compiler_builtins to 0.1.18
bjorn3 Jul 20, 2019
93de733
Remove tests for -Zlower-128bit-ops
bjorn3 Jul 20, 2019
6fae7db
Remove vector fadd/fmul reduction workarounds
nikic Jul 20, 2019
279c399
code cleanup
bpangWR Jul 22, 2019
fe4cdd3
Disable d32 on armv6 hf targets
nikic Jul 23, 2019
71717b9
Initialize the MSP430 AsmParser if available
nikic Jul 23, 2019
61b680b
Attempt to fix backtrace tests on i686-msvc
alexcrichton Jul 23, 2019
70c817a
Allow lexer to recover from some homoglyphs
estebank Jul 24, 2019
b01b5b9
ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar
pietroalbini Jul 25, 2019
0e022f8
Remove needless indirection through Rc
Mark-Simulacrum Jul 25, 2019
dd0f2ac
librustc_errors: Support ui-testing flag in annotate-snippet emitter
phansch Jul 25, 2019
6844976
review comments: add FIXME comments and formatting
estebank Jul 25, 2019
df4b23e
Implement slow-path for FirstSets::first
ia0 Jul 24, 2019
2e2fea2
Rollup merge of #62084 - euclio:unicode-table-tweak, r=kennytm
Centril Jul 26, 2019
879f3c7
Rollup merge of #62421 - JohnTitor:U007D-master, r=alexcrichton
Centril Jul 26, 2019
602980d
Rollup merge of #62692 - eddyb:precompute-niches, r=oli-obk
Centril Jul 26, 2019
64a692f
Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichton
Centril Jul 26, 2019
0b77d90
Rollup merge of #62828 - nikic:fadd-mul-reductions, r=eddyb
Centril Jul 26, 2019
4862b73
Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichton
Centril Jul 26, 2019
48f6f96
Rollup merge of #62897 - alexcrichton:fix-i686-msvc-tests, r=pietroal…
Centril Jul 26, 2019
8d50035
Rollup merge of #62904 - nikic:arm-d32, r=alexcrichton
Centril Jul 26, 2019
51028f9
Rollup merge of #62907 - nikic:msp430-asmparser, r=alexcrichton
Centril Jul 26, 2019
58fa03a
Rollup merge of #62956 - ia0:fix_62831, r=petrochenkov
Centril Jul 26, 2019
1aae896
Rollup merge of #62963 - estebank:homoglyph-recovery, r=petrochenkov
Centril Jul 26, 2019
fe612f6
Rollup merge of #62970 - pietroalbini:fix-tools-builder, r=alexcrichton
Centril Jul 26, 2019
5f1884e
Rollup merge of #62983 - Mark-Simulacrum:remove-needless-rc, r=petroc…
Centril Jul 26, 2019
5492622
Rollup merge of #62985 - phansch:support_ui_testing_flag, r=estebank
Centril Jul 26, 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
Prev Previous commit
Next Next commit
librustc_errors: Support ui-testing flag in annotate-snippet emitter
This adds support for the `-Z ui-testing` flag to the new
annotate-snippet diagnostic emitter.

The support for the flag was added to `annotate-snippet-rs` in these PRs:

* rust-lang/annotate-snippets-rs#3
* rust-lang/annotate-snippets-rs#5

Closes #61811
  • Loading branch information
phansch committed Jul 25, 2019
commit dd0f2ac250e0f733cfbff5498c04312c96bb34fa
8 changes: 7 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "annotate-snippets"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "ansi_term"
version = "0.11.0"
Expand Down Expand Up @@ -3073,7 +3078,7 @@ dependencies = [
name = "rustc_errors"
version = "0.0.0"
dependencies = [
"annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"annotate-snippets 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_data_structures 0.0.0",
Expand Down Expand Up @@ -4492,6 +4497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum ammonia 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8b93ecb80665873703bf3b0a77f369c96b183d8e0afaf30a3ff5ff07dfc6409"
"checksum ammonia 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c799ecf1ad77acb48b643e2f45b12d60ee41576287fc575031aa020de88b8f45"
"checksum annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e8bcdcd5b291ce85a78f2b9d082a8de9676c12b1840d386d67bc5eea6f9d2b4e"
"checksum annotate-snippets 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7021ce4924a3f25f802b2cccd1af585e39ea1a363a1aa2e72afe54b67a3a7a7"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum arc-swap 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1025aeae2b664ca0ea726a89d574fe8f4e77dd712d443236ad1de00379450cf6"
"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ rustc_data_structures = { path = "../librustc_data_structures" }
unicode-width = "0.1.4"
atty = "0.2"
termcolor = "1.0"
annotate-snippets = "0.5.0"
annotate-snippets = "0.6.1"
8 changes: 2 additions & 6 deletions src/librustc_errors/annotate_snippet_emitter_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct AnnotateSnippetEmitterWriter {
source_map: Option<Lrc<SourceMapperDyn>>,
/// If true, hides the longer explanation text
short_message: bool,
/// If true, will normalize line numbers with LL to prevent noise in UI test diffs.
/// If true, will normalize line numbers with `LL` to prevent noise in UI test diffs.
ui_testing: bool,
}

Expand Down Expand Up @@ -173,10 +173,6 @@ impl AnnotateSnippetEmitterWriter {
/// Allows to modify `Self` to enable or disable the `ui_testing` flag.
///
/// If this is set to true, line numbers will be normalized as `LL` in the output.
// FIXME(#59346): This method is used via the public interface, but setting the `ui_testing`
// flag currently does not anonymize line numbers. We would have to add the `maybe_anonymized`
// method from `emitter.rs` and implement rust-lang/annotate-snippets-rs#2 in order to
// anonymize line numbers.
pub fn ui_testing(mut self, ui_testing: bool) -> Self {
self.ui_testing = ui_testing;
self
Expand All @@ -202,7 +198,7 @@ impl AnnotateSnippetEmitterWriter {
};
if let Some(snippet) = converter.to_annotation_snippet() {
let dl = DisplayList::from(snippet);
let dlf = DisplayListFormatter::new(true);
let dlf = DisplayListFormatter::new(true, self.ui_testing);
// FIXME(#59346): Figure out if we can _always_ print to stderr or not.
// `emitter.rs` has the `Destination` enum that lists various possible output
// destinations.
Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/annotate-snippet/missing-type.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error[E0412]: cannot find type `Iter` in this scope
--> $DIR/missing-type.rs:4:11
|
4 | let x: Iter;
| ^^^^ not found in this scope
|
--> $DIR/missing-type.rs:4:11
|
LL | let x: Iter;
| ^^^^ not found in this scope
|