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 8 pull requests #93929

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8b13fd4
Add pretty printer test for use trees
dtolnay Feb 8, 2022
d1b9e4a
Pretty print ItemKind::Use in rustfmt style
dtolnay Feb 8, 2022
b64a822
Bless use tree pretty print test
dtolnay Feb 8, 2022
a38ff48
Add some known GAT bugs as tests
jackh726 Feb 8, 2022
dfa9d64
Suggest disabling download-ci-llvm option if url fails to download
Badel2 Feb 11, 2022
3a1ffea
linkchecker: fix panic on directory symlinks
schopin-pro Feb 11, 2022
9322d09
Check that error code explanations are listed in error_codes.rs
GuillaumeGomez Feb 11, 2022
9b17e2d
Add 2 tests
matthiaskrgr Dec 14, 2021
cb3cff3
Stop using a placeholder for empty regions in Chalk
matthewjasper Jan 17, 2022
d4fa173
Fix more chalk lowering issues
matthewjasper Feb 9, 2022
1e6d382
Reverse parameter to placeholder substitution in chalk results
matthewjasper Feb 9, 2022
caa10dc
Renumber universes when canonicalizing for Chalk
matthewjasper Feb 9, 2022
05e66a6
Update chalk tests
matthewjasper Feb 9, 2022
575f173
Address review comment
matthewjasper Feb 11, 2022
087fb23
Add missing E0192 in the error code listing
GuillaumeGomez Feb 11, 2022
56d43a2
Add missing release notes for #85200
nsunderland1 Feb 12, 2022
9c58fb5
Rollup merge of #91908 - matthiaskrgr:ices, r=jackh726
matthiaskrgr Feb 12, 2022
59c76e2
Rollup merge of #93757 - jackh726:gat-bug-tests, r=nikomatsakis
matthiaskrgr Feb 12, 2022
056124b
Rollup merge of #93759 - dtolnay:usetree, r=nagisa
matthiaskrgr Feb 12, 2022
08105be
Rollup merge of #93810 - matthewjasper:chalk-and-canonical-universes,…
matthiaskrgr Feb 12, 2022
8865f33
Rollup merge of #93885 - Badel2:error-download-ci-llvm, r=Mark-Simula…
matthiaskrgr Feb 12, 2022
759f978
Rollup merge of #93897 - schopin-pro:linkchecker-symlink, r=Mark-Simu…
matthiaskrgr Feb 12, 2022
144e801
Rollup merge of #93898 - GuillaumeGomez:error-code-check, r=Mark-Simu…
matthiaskrgr Feb 12, 2022
7d02faa
Rollup merge of #93928 - nsunderland1:master, r=Mark-Simulacrum
matthiaskrgr Feb 12, 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
5 changes: 5 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Language
- [Macro attributes may follow `#[derive]` and will see the original (pre-`cfg`) input.][87220]
- [Accept curly-brace macros in expressions, like `m!{ .. }.method()` and `m!{ .. }?`.][88690]
- [Allow panicking in constant evaluation.][89508]
- [Ignore derived `Clone` and `Debug` implementations during dead code analysis.][85200]

Compiler
--------
Expand Down Expand Up @@ -216,6 +217,9 @@ Cargo
Compatibility notes
-------------------

- [Ignore derived `Clone` and `Debug` implementations during dead code analysis.][85200]
This will break some builds that set `#![deny(dead_code)]`.

Internal changes
----------------
These changes provide no direct user facing benefits, but represent significant
Expand All @@ -224,6 +228,7 @@ and related tools.

- [Added an experimental backend for codegen with `libgccjit`.][87260]

[85200]: https://github.com/rust-lang/rust/pull/85200/
[86191]: https://github.com/rust-lang/rust/pull/86191/
[87220]: https://github.com/rust-lang/rust/pull/87220/
[87260]: https://github.com/rust-lang/rust/pull/87260/
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_ast_pretty/src/pp/convenience.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ impl Printer {
}

pub fn trailing_comma(&mut self) {
self.scan_break(BreakToken { pre_break: Some(','), ..BreakToken::default() });
}

pub fn trailing_comma_or_space(&mut self) {
self.scan_break(BreakToken {
blank_space: 1,
pre_break: Some(','),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_pretty/src/pprust/state/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<'a> State<'a> {
if !field.is_last || has_rest {
self.word_space(",");
} else {
self.trailing_comma();
self.trailing_comma_or_space();
}
}
if has_rest {
Expand Down
48 changes: 34 additions & 14 deletions compiler/rustc_ast_pretty/src/pprust/state/item.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::pp::Breaks::Inconsistent;
use crate::pprust::state::{AnnNode, PrintState, State};
use crate::pprust::state::delimited::IterDelimited;
use crate::pprust::state::{AnnNode, PrintState, State, INDENT_UNIT};

use rustc_ast as ast;
use rustc_ast::GenericBound;
Expand Down Expand Up @@ -138,11 +139,10 @@ impl<'a> State<'a> {
self.end(); // end outer head-block
}
ast::ItemKind::Use(ref tree) => {
self.head(visibility_qualified(&item.vis, "use"));
self.print_visibility(&item.vis);
self.word_nbsp("use");
self.print_use_tree(tree);
self.word(";");
self.end(); // end inner head-block
self.end(); // end outer head-block
}
ast::ItemKind::Static(ref ty, mutbl, ref body) => {
let def = ast::Defaultness::Final;
Expand Down Expand Up @@ -615,8 +615,8 @@ impl<'a> State<'a> {
ast::UseTreeKind::Simple(rename, ..) => {
self.print_path(&tree.prefix, false, 0);
if let Some(rename) = rename {
self.space();
self.word_space("as");
self.nbsp();
self.word_nbsp("as");
self.print_ident(rename);
}
}
Expand All @@ -628,16 +628,36 @@ impl<'a> State<'a> {
self.word("*");
}
ast::UseTreeKind::Nested(ref items) => {
if tree.prefix.segments.is_empty() {
self.word("{");
} else {
if !tree.prefix.segments.is_empty() {
self.print_path(&tree.prefix, false, 0);
self.word("::{");
self.word("::");
}
if items.is_empty() {
self.word("{}");
} else if items.len() == 1 {
self.print_use_tree(&items[0].0);
} else {
self.cbox(INDENT_UNIT);
self.word("{");
self.zerobreak();
self.ibox(0);
for use_tree in items.iter().delimited() {
self.print_use_tree(&use_tree.0);
if !use_tree.is_last {
self.word(",");
if let ast::UseTreeKind::Nested(_) = use_tree.0.kind {
self.hardbreak();
} else {
self.space();
}
}
}
self.end();
self.trailing_comma();
self.offset(-INDENT_UNIT);
self.word("}");
self.end();
}
self.commasep(Inconsistent, &items, |this, &(ref tree, _)| {
this.print_use_tree(tree)
});
self.word("}");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ E0184: include_str!("./error_codes/E0184.md"),
E0185: include_str!("./error_codes/E0185.md"),
E0186: include_str!("./error_codes/E0186.md"),
E0191: include_str!("./error_codes/E0191.md"),
E0192: include_str!("./error_codes/E0192.md"),
E0193: include_str!("./error_codes/E0193.md"),
E0195: include_str!("./error_codes/E0195.md"),
E0197: include_str!("./error_codes/E0197.md"),
Expand Down Expand Up @@ -522,7 +523,6 @@ E0787: include_str!("./error_codes/E0787.md"),
// E0188, // can not cast an immutable reference to a mutable pointer
// E0189, // deprecated: can only cast a boxed pointer to a boxed object
// E0190, // deprecated: can only cast a &-pointer to an &-object
// E0192, // negative impl only applicable to auto traits
// E0194, // merged into E0403
// E0196, // cannot determine a type for this closure
E0208,
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0192.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#### Note: this error code is no longer emitted by the compiler.

A negative impl was added on a trait implementation.

Erroneous code example:

```compile_fail,E0192
```compile_fail
trait Trait {
type Bar;
}

struct Foo;

impl !Trait for Foo { } //~ ERROR E0192
impl !Trait for Foo { } //~ ERROR

fn main() {}
```
Expand Down
Loading