Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a89c03a

Browse files
committedMar 31, 2019
Auto merge of #59584 - Centril:rollup, r=Centril
Rollup of 4 pull requests Successful merges: - #58828 (libstd: deny(elided_lifetimes_in_paths)) - #59234 (Mention `no merge policy` in the CONTRIBUTING guide) - #59572 (Include bounds in generic re-ordering diagnostic) - #59574 (Distinguish message for external macros depending on error level) Failed merges: r? @ghost
2 parents cee58fd + fb8396d commit a89c03a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+585
-458
lines changed
 

‎CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ bring those changes into the source repository.
122122

123123
Please make pull requests against the `master` branch.
124124

125+
Rust follows a no merge policy, meaning, when you encounter merge
126+
conflicts you are expected to always rebase instead of merge.
127+
E.g. always use rebase when bringing the latest changes from
128+
the master branch to your feature branch.
129+
Also, please make sure that fixup commits are squashed into other related
130+
commits with meaningful commit messages.
131+
125132
Please make sure your pull request is in compliance with Rust's style
126133
guidelines by running
127134

‎src/librustc_errors/emitter.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::{
66
Level, CodeSuggestion, DiagnosticBuilder, SubDiagnostic,
77
SuggestionStyle, SourceMapperDyn, DiagnosticId,
88
};
9+
use crate::Level::Error;
910
use crate::snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, StyledString, Style};
1011
use crate::styled_buffer::StyledBuffer;
1112

@@ -72,6 +73,7 @@ impl Emitter for EmitterWriter {
7273

7374
self.fix_multispans_in_std_macros(&mut primary_span,
7475
&mut children,
76+
&db.level,
7577
db.handler.flags.external_macro_backtrace);
7678

7779
self.emit_messages_default(&db.level,
@@ -888,18 +890,27 @@ impl EmitterWriter {
888890
fn fix_multispans_in_std_macros(&mut self,
889891
span: &mut MultiSpan,
890892
children: &mut Vec<SubDiagnostic>,
893+
level: &Level,
891894
backtrace: bool) {
892895
let mut spans_updated = self.fix_multispan_in_std_macros(span, backtrace);
893896
for child in children.iter_mut() {
894897
spans_updated |= self.fix_multispan_in_std_macros(&mut child.span, backtrace);
895898
}
899+
let msg = if level == &Error {
900+
"this error originates in a macro outside of the current crate \
901+
(in Nightly builds, run with -Z external-macro-backtrace \
902+
for more info)".to_string()
903+
} else {
904+
"this warning originates in a macro outside of the current crate \
905+
(in Nightly builds, run with -Z external-macro-backtrace \
906+
for more info)".to_string()
907+
};
908+
896909
if spans_updated {
897910
children.push(SubDiagnostic {
898911
level: Level::Note,
899912
message: vec![
900-
("this error originates in a macro outside of the current crate \
901-
(in Nightly builds, run with -Z external-macro-backtrace \
902-
for more info)".to_string(),
913+
(msg,
903914
Style::NoStyle),
904915
],
905916
span: MultiSpan::new(),

0 commit comments

Comments
 (0)
Please sign in to comment.