Skip to content

Commit 237d54f

Browse files
committed
Auto merge of #65433 - Centril:rollup-rzvry15, r=Centril
Rollup of 4 pull requests Successful merges: - #64035 (Stabilize proc macros generating `macro_rules` items) - #65376 (syntax: misc extractions) - #65426 (Remove custom `PartialEq` impls for `LocalInternedString`.) - #65428 (Refactor: Rename `db` locals to `diag`) Failed merges: r? @ghost
2 parents 437ca55 + 8370f14 commit 237d54f

Some content is hidden

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

53 files changed

+531
-612
lines changed

src/librustc/hir/lowering.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ use syntax::errors;
6767
use syntax::ext::base::SpecialDerives;
6868
use syntax::ext::hygiene::ExpnId;
6969
use syntax::print::pprust;
70-
use syntax::source_map::{respan, ExpnData, ExpnKind, DesugaringKind, Spanned};
71-
use syntax::symbol::{kw, sym, Symbol};
7270
use syntax::tokenstream::{TokenStream, TokenTree};
7371
use syntax::parse::token::{self, Nonterminal, Token};
74-
use syntax::parse::ParseSess;
72+
use syntax::sess::ParseSess;
73+
use syntax::source_map::{respan, ExpnData, ExpnKind, DesugaringKind, Spanned};
74+
use syntax::symbol::{kw, sym, Symbol};
7575
use syntax::visit::{self, Visitor};
7676
use syntax_pos::Span;
7777

src/librustc/hir/print.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use rustc_target::spec::abi::Abi;
22
use syntax::ast;
33
use syntax::source_map::{SourceMap, Spanned};
4-
use syntax::parse::ParseSess;
54
use syntax::print::pp::{self, Breaks};
65
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
76
use syntax::print::pprust::{self, Comments, PrintState};
7+
use syntax::sess::ParseSess;
88
use syntax::symbol::kw;
99
use syntax::util::parser::{self, AssocOp, Fixity};
1010
use syntax_pos::{self, BytePos, FileName};

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#![feature(test)]
5757
#![feature(in_band_lifetimes)]
5858
#![feature(crate_visibility_modifier)]
59-
#![feature(proc_macro_hygiene)]
59+
#![cfg_attr(bootstrap, feature(proc_macro_hygiene))]
6060
#![feature(log_syntax)]
6161
#![feature(associated_type_bounds)]
6262
#![feature(rustc_attrs)]

src/librustc/session/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ use syntax;
1616
use syntax::ast::{self, IntTy, UintTy, MetaItemKind};
1717
use syntax::source_map::{FileName, FilePathMapping};
1818
use syntax::edition::{Edition, EDITION_NAME_LIST, DEFAULT_EDITION};
19-
use syntax::parse::{ParseSess, new_parser_from_source_str};
19+
use syntax::parse::new_parser_from_source_str;
2020
use syntax::parse::token;
21+
use syntax::sess::ParseSess;
2122
use syntax::symbol::{sym, Symbol};
2223
use syntax::feature_gate::UnstableFeatures;
2324
use syntax::source_map::SourceMap;

src/librustc/session/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use syntax::ext::allocator::AllocatorKind;
2828
use syntax::feature_gate::{self, AttributeType};
2929
use syntax::json::JsonEmitter;
3030
use syntax::source_map;
31-
use syntax::parse::{self, ParseSess};
31+
use syntax::sess::ParseSess;
3232
use syntax::symbol::Symbol;
3333
use syntax_pos::{MultiSpan, Span};
3434
use crate::util::profiling::{SelfProfiler, SelfProfilerRef};
@@ -1159,7 +1159,7 @@ fn build_session_(
11591159
);
11601160
let target_cfg = config::build_target_config(&sopts, &span_diagnostic);
11611161

1162-
let parse_sess = parse::ParseSess::with_span_handler(
1162+
let parse_sess = ParseSess::with_span_handler(
11631163
span_diagnostic,
11641164
source_map,
11651165
);

src/librustc_codegen_ssa/back/write.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,13 +1667,13 @@ impl SharedEmitter {
16671667
}
16681668

16691669
impl Emitter for SharedEmitter {
1670-
fn emit_diagnostic(&mut self, db: &rustc_errors::Diagnostic) {
1670+
fn emit_diagnostic(&mut self, diag: &rustc_errors::Diagnostic) {
16711671
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
1672-
msg: db.message(),
1673-
code: db.code.clone(),
1674-
lvl: db.level,
1672+
msg: diag.message(),
1673+
code: diag.code.clone(),
1674+
lvl: diag.level,
16751675
})));
1676-
for child in &db.children {
1676+
for child in &diag.children {
16771677
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
16781678
msg: child.message(),
16791679
code: None,

src/librustc_errors/annotate_snippet_emitter_writer.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ pub struct AnnotateSnippetEmitterWriter {
3131

3232
impl Emitter for AnnotateSnippetEmitterWriter {
3333
/// The entry point for the diagnostics generation
34-
fn emit_diagnostic(&mut self, db: &Diagnostic) {
35-
let mut children = db.children.clone();
36-
let (mut primary_span, suggestions) = self.primary_span_formatted(&db);
34+
fn emit_diagnostic(&mut self, diag: &Diagnostic) {
35+
let mut children = diag.children.clone();
36+
let (mut primary_span, suggestions) = self.primary_span_formatted(&diag);
3737

3838
self.fix_multispans_in_std_macros(&self.source_map,
3939
&mut primary_span,
4040
&mut children,
41-
&db.level,
41+
&diag.level,
4242
self.external_macro_backtrace);
4343

44-
self.emit_messages_default(&db.level,
45-
db.message(),
46-
&db.code,
44+
self.emit_messages_default(&diag.level,
45+
diag.message(),
46+
&diag.code,
4747
&primary_span,
4848
&children,
4949
&suggestions);

src/librustc_errors/emitter.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const ANONYMIZED_LINE_NUM: &str = "LL";
180180
/// Emitter trait for emitting errors.
181181
pub trait Emitter {
182182
/// Emit a structured diagnostic.
183-
fn emit_diagnostic(&mut self, db: &Diagnostic);
183+
fn emit_diagnostic(&mut self, diag: &Diagnostic);
184184

185185
/// Emit a notification that an artifact has been output.
186186
/// This is currently only supported for the JSON format,
@@ -206,10 +206,10 @@ pub trait Emitter {
206206
/// we return the original `primary_span` and the original suggestions.
207207
fn primary_span_formatted<'a>(
208208
&mut self,
209-
db: &'a Diagnostic,
209+
diag: &'a Diagnostic,
210210
) -> (MultiSpan, &'a [CodeSuggestion]) {
211-
let mut primary_span = db.span.clone();
212-
if let Some((sugg, rest)) = db.suggestions.split_first() {
211+
let mut primary_span = diag.span.clone();
212+
if let Some((sugg, rest)) = diag.suggestions.split_first() {
213213
if rest.is_empty() &&
214214
// ^ if there is only one suggestion
215215
// don't display multi-suggestions as labels
@@ -260,10 +260,10 @@ pub trait Emitter {
260260
// to be consistent. We could try to figure out if we can
261261
// make one (or the first one) inline, but that would give
262262
// undue importance to a semi-random suggestion
263-
(primary_span, &db.suggestions)
263+
(primary_span, &diag.suggestions)
264264
}
265265
} else {
266-
(primary_span, &db.suggestions)
266+
(primary_span, &diag.suggestions)
267267
}
268268
}
269269

@@ -401,19 +401,19 @@ impl Emitter for EmitterWriter {
401401
self.sm.as_ref()
402402
}
403403

404-
fn emit_diagnostic(&mut self, db: &Diagnostic) {
405-
let mut children = db.children.clone();
406-
let (mut primary_span, suggestions) = self.primary_span_formatted(&db);
404+
fn emit_diagnostic(&mut self, diag: &Diagnostic) {
405+
let mut children = diag.children.clone();
406+
let (mut primary_span, suggestions) = self.primary_span_formatted(&diag);
407407

408408
self.fix_multispans_in_std_macros(&self.sm,
409409
&mut primary_span,
410410
&mut children,
411-
&db.level,
411+
&diag.level,
412412
self.external_macro_backtrace);
413413

414-
self.emit_messages_default(&db.level,
415-
&db.styled_message(),
416-
&db.code,
414+
self.emit_messages_default(&diag.level,
415+
&diag.styled_message(),
416+
&diag.code,
417417
&primary_span,
418418
&children,
419419
&suggestions);

src/librustdoc/clean/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::ops;
99

1010
use syntax::symbol::{Symbol, sym};
1111
use syntax::ast::{MetaItem, MetaItemKind, NestedMetaItem, LitKind};
12-
use syntax::parse::ParseSess;
12+
use syntax::sess::ParseSess;
1313
use syntax::feature_gate::Features;
1414

1515
use syntax_pos::Span;

src/librustdoc/html/highlight.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::io::prelude::*;
1414
use syntax::source_map::{SourceMap, FilePathMapping};
1515
use syntax::parse::lexer;
1616
use syntax::parse::token::{self, Token};
17-
use syntax::parse;
17+
use syntax::sess::ParseSess;
1818
use syntax::symbol::{kw, sym};
1919
use syntax_pos::{Span, FileName};
2020

@@ -33,7 +33,7 @@ pub fn render_with_highlighting(
3333
class, tooltip).unwrap();
3434
}
3535

36-
let sess = parse::ParseSess::new(FilePathMapping::empty());
36+
let sess = ParseSess::new(FilePathMapping::empty());
3737
let fm = sess.source_map().new_source_file(
3838
FileName::Custom(String::from("rustdoc-highlighting")),
3939
src.to_owned(),

0 commit comments

Comments
 (0)