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 9 pull requests #93048

Merged
merged 26 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
01800ca
Add test of qpath interpolations
dtolnay Nov 23, 2021
558ddee
Add test of NtTy in a qpath
dtolnay Nov 23, 2021
0cbb00f
Let qpath contain NtTy: <$:ty as $:ty>::rest
dtolnay Nov 23, 2021
87a7def
Reject generic arguments on mod style interpolated path
dtolnay Nov 23, 2021
d32ca64
Allow isize/usize in simd_cast
calebzulawski Dec 28, 2021
8fae33d
Add simd_as intrinsic
calebzulawski Dec 30, 2021
3cd4976
Add pointer-sized integer tests
calebzulawski Dec 30, 2021
0cf7fd1
Call out to binutils' dlltool for raw-dylib on windows-gnu platforms.
ricobbe Nov 1, 2021
4c27d34
directly use ConstValue for single literals in blocks
b-naber Jan 11, 2022
7dac626
add and update tests
b-naber Jan 11, 2022
ae9b624
Rm some unused ord impls
pierwill Jan 17, 2022
1d5bf6b
Update compiler/rustc_codegen_llvm/src/builder.rs
calebzulawski Jan 18, 2022
49d36d7
Improve documentation of splatted constants
calebzulawski Jan 18, 2022
51cd00c
fix typo in `max` description for f32/f64
klensy Jan 18, 2022
3db479e
Fix stdarch submodule pointing to commit outside tree
Amanieu Jan 18, 2022
6a5f8b1
Simplify and unify rustdoc sidebar styles
jsha Jan 7, 2022
fe86dcf
Delete pretty printer tracing
dtolnay Jan 15, 2022
dd621a4
Rollup merge of #90782 - ricobbe:binutils-dlltool, r=michaelwoerister
matthiaskrgr Jan 18, 2022
f372476
Rollup merge of #91150 - dtolnay:qpath, r=davidtwco
matthiaskrgr Jan 18, 2022
7889f96
Rollup merge of #92425 - calebzulawski:simd-cast, r=workingjubilee
matthiaskrgr Jan 18, 2022
ff476b3
Rollup merge of #92692 - jsha:cool-sidebar, r=GuillaumeGomez
matthiaskrgr Jan 18, 2022
5a4f474
Rollup merge of #92780 - b-naber:postpone-const-eval-coherence, r=lcnr
matthiaskrgr Jan 18, 2022
262f48e
Rollup merge of #92924 - dtolnay:pptracing, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
73988b6
Rollup merge of #93018 - pierwill:rm-unused-ord, r=davidtwco
matthiaskrgr Jan 18, 2022
63376bb
Rollup merge of #93026 - klensy:f-typo, r=scottmcm
matthiaskrgr Jan 18, 2022
f851a84
Rollup merge of #93035 - Amanieu:stdarch_fix, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
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: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3433,7 +3433,6 @@ version = "0.0.0"
dependencies = [
"rustc_ast",
"rustc_span",
"tracing",
]

[[package]]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ bitflags::bitflags! {
}
}

#[derive(Clone, PartialEq, PartialOrd, Encodable, Decodable, Debug, Hash, HashStable_Generic)]
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable_Generic)]
pub enum InlineAsmTemplatePiece {
String(String),
Placeholder { operand_idx: usize, modifier: Option<char>, span: Span },
Expand Down Expand Up @@ -2211,7 +2211,7 @@ pub enum IsAuto {
No,
}

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Encodable, Decodable, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable, Debug)]
#[derive(HashStable_Generic)]
pub enum Unsafe {
Yes(Span),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_ast_pretty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ edition = "2021"
doctest = false

[dependencies]
tracing = "0.1"
rustc_span = { path = "../rustc_span" }
rustc_ast = { path = "../rustc_ast" }
52 changes: 0 additions & 52 deletions compiler/rustc_ast_pretty/src/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ use ring::RingBuffer;
use std::borrow::Cow;
use std::collections::VecDeque;
use std::fmt;
use tracing::debug;

/// How to break. Described in more detail in the module docs.
#[derive(Clone, Copy, PartialEq)]
Expand Down Expand Up @@ -193,22 +192,6 @@ impl fmt::Display for Token {
}
}

fn buf_str(buf: &RingBuffer<BufEntry>, left: usize, right: usize, lim: usize) -> String {
let mut i = left;
let mut l = lim;
let mut s = String::from("[");
while i != right && l != 0 {
l -= 1;
if i != left {
s.push_str(", ");
}
s.push_str(&format!("{}={}", buf[i].size, &buf[i].token));
i += 1;
}
s.push(']');
s
}

#[derive(Copy, Clone)]
enum PrintStackBreak {
Fits,
Expand Down Expand Up @@ -267,7 +250,6 @@ impl Default for BufEntry {
impl Printer {
pub fn new() -> Self {
let linewidth = 78;
debug!("Printer::new {}", linewidth);
let mut buf = RingBuffer::new();
buf.advance_right();
Printer {
Expand Down Expand Up @@ -310,16 +292,13 @@ impl Printer {
} else {
self.advance_right();
}
debug!("pp Begin({})/buffer Vec<{},{}>", b.offset, self.left, self.right);
self.scan_push(BufEntry { token: Token::Begin(b), size: -self.right_total });
}

fn scan_end(&mut self) {
if self.scan_stack.is_empty() {
debug!("pp End/print Vec<{},{}>", self.left, self.right);
self.print_end();
} else {
debug!("pp End/buffer Vec<{},{}>", self.left, self.right);
self.advance_right();
self.scan_push(BufEntry { token: Token::End, size: -1 });
}
Expand All @@ -334,18 +313,15 @@ impl Printer {
} else {
self.advance_right();
}
debug!("pp Break({})/buffer Vec<{},{}>", b.offset, self.left, self.right);
self.check_stack(0);
self.scan_push(BufEntry { token: Token::Break(b), size: -self.right_total });
self.right_total += b.blank_space;
}

fn scan_string(&mut self, s: Cow<'static, str>) {
if self.scan_stack.is_empty() {
debug!("pp String('{}')/print Vec<{},{}>", s, self.left, self.right);
self.print_string(s);
} else {
debug!("pp String('{}')/buffer Vec<{},{}>", s, self.left, self.right);
self.advance_right();
let len = s.len() as isize;
self.buf[self.right] = BufEntry { token: Token::String(s), size: len };
Expand All @@ -355,18 +331,8 @@ impl Printer {
}

fn check_stream(&mut self) {
debug!(
"check_stream Vec<{}, {}> with left_total={}, right_total={}",
self.left, self.right, self.left_total, self.right_total
);
if self.right_total - self.left_total > self.space {
debug!(
"scan window is {}, longer than space on line ({})",
self.right_total - self.left_total,
self.space
);
if Some(&self.left) == self.scan_stack.back() {
debug!("setting {} to infinity and popping", self.left);
let scanned = self.scan_pop_bottom();
self.buf[scanned].size = SIZE_INFINITY;
}
Expand All @@ -378,7 +344,6 @@ impl Printer {
}

fn scan_push(&mut self, entry: BufEntry) {
debug!("scan_push {}", self.right);
self.buf[self.right] = entry;
self.scan_stack.push_front(self.right);
}
Expand All @@ -401,11 +366,6 @@ impl Printer {
}

fn advance_left(&mut self) {
debug!(
"advance_left Vec<{},{}>, sizeof({})={}",
self.left, self.right, self.left, self.buf[self.left].size
);

let mut left_size = self.buf[self.left].size;

while left_size >= 0 {
Expand Down Expand Up @@ -465,14 +425,12 @@ impl Printer {
}

fn print_newline(&mut self, amount: isize) {
debug!("NEWLINE {}", amount);
self.out.push('\n');
self.pending_indentation = 0;
self.indent(amount);
}

fn indent(&mut self, amount: isize) {
debug!("INDENT {}", amount);
self.pending_indentation += amount;
}

Expand All @@ -485,40 +443,33 @@ impl Printer {
fn print_begin(&mut self, b: BeginToken, l: isize) {
if l > self.space {
let col = self.margin - self.space + b.offset;
debug!("print Begin -> push broken block at col {}", col);
self.print_stack
.push(PrintStackElem { offset: col, pbreak: PrintStackBreak::Broken(b.breaks) });
} else {
debug!("print Begin -> push fitting block");
self.print_stack.push(PrintStackElem { offset: 0, pbreak: PrintStackBreak::Fits });
}
}

fn print_end(&mut self) {
debug!("print End -> pop End");
self.print_stack.pop().unwrap();
}

fn print_break(&mut self, b: BreakToken, l: isize) {
let top = self.get_top();
match top.pbreak {
PrintStackBreak::Fits => {
debug!("print Break({}) in fitting block", b.blank_space);
self.space -= b.blank_space;
self.indent(b.blank_space);
}
PrintStackBreak::Broken(Breaks::Consistent) => {
debug!("print Break({}+{}) in consistent block", top.offset, b.offset);
self.print_newline(top.offset + b.offset);
self.space = self.margin - (top.offset + b.offset);
}
PrintStackBreak::Broken(Breaks::Inconsistent) => {
if l > self.space {
debug!("print Break({}+{}) w/ newline in inconsistent", top.offset, b.offset);
self.print_newline(top.offset + b.offset);
self.space = self.margin - (top.offset + b.offset);
} else {
debug!("print Break({}) w/o newline in inconsistent", b.blank_space);
self.indent(b.blank_space);
self.space -= b.blank_space;
}
Expand All @@ -528,7 +479,6 @@ impl Printer {

fn print_string(&mut self, s: Cow<'static, str>) {
let len = s.len() as isize;
debug!("print String({})", s);
// assert!(len <= space);
self.space -= len;

Expand All @@ -545,8 +495,6 @@ impl Printer {
}

fn print(&mut self, token: Token, l: isize) {
debug!("print {} {} (remaining line space={})", token, l, self.space);
debug!("{}", buf_str(&self.buf, self.left, self.right, 6));
match token {
Token::Begin(b) => self.print_begin(b, l),
Token::End => self.print_end(),
Expand Down
Loading