Skip to content

Rollup of 9 pull requests #101016

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

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
54d35e7
distinguish the method and associated function diagnostic information
Jul 8, 2022
97c963d
make slice::{split_at,split_at_unchecked} const functions
tspiteri Aug 2, 2022
e4a4246
const_prop_lint: Consider array length constant even if array is not
TheWastl Jun 24, 2022
83f081f
Remove unstable Result::into_ok_or_err
dtolnay Aug 15, 2022
39809c5
Replace a try_fold in rustc_transmute to use ControlFlow instead of R…
dtolnay Aug 15, 2022
289d7cc
Reduce code size of `assert_matches_failed`
a1phyr Aug 23, 2022
b997af9
Handle `Err` in `ast::LitKind::to_token_lit`.
nnethercote Aug 24, 2022
31d892a
Fix liveness analysis for yield terminators
tmiasko Aug 1, 2022
4462b4a
Elaborate all box dereferences in `ElaborateBoxDerefs`
tmiasko Aug 1, 2022
58eabb2
Add method that applies DefUse effect
tmiasko Aug 25, 2022
4394ea8
Inline trivial `From<Local> for Place<'_>` impl
tmiasko Aug 25, 2022
bc3d719
review
tspiteri Aug 25, 2022
45cc8cb
rustdoc: remove unused CSS for `.multi-column`
notriddle Aug 25, 2022
258d367
Adding support for rustc_serialize encode and decode for Box and Vec …
Aug 25, 2022
2c5e159
Rollup merge of #99064 - lyming2007:issue-97687-fix, r=estebank
JohnTitor Aug 25, 2022
5b4739e
Rollup merge of #99920 - emarteca:custom-allocator-support, r=oli-obk
JohnTitor Aug 25, 2022
a48a13d
Rollup merge of #100034 - tmiasko:elaborate-box-derefs, r=oli-obk
JohnTitor Aug 25, 2022
5759a97
Rollup merge of #100076 - tspiteri:const_slice_split_at, r=oli-obk
JohnTitor Aug 25, 2022
911878e
Rollup merge of #100160 - TheWastl:issue-98444-const_prop_lint, r=oli…
JohnTitor Aug 25, 2022
6da589b
Rollup merge of #100604 - dtolnay:okorerr, r=m-ou-se
JohnTitor Aug 25, 2022
001e90d
Rollup merge of #100933 - a1phyr:cheap_assert_match_failed, r=JoshTri…
JohnTitor Aug 25, 2022
1418237
Rollup merge of #100978 - nnethercote:fix-100948, r=petrochenkov
JohnTitor Aug 25, 2022
f2521bb
Rollup merge of #101010 - notriddle:notriddle/multi-column, r=jsha
JohnTitor Aug 25, 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
Prev Previous commit
Next Next commit
Handle Err in ast::LitKind::to_token_lit.
Fixes #100948.
  • Loading branch information
nnethercote committed Aug 25, 2022
commit b997af95fce1f1295f3b90ae33c575b6ded4f914
4 changes: 3 additions & 1 deletion compiler/rustc_ast/src/util/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ impl LitKind {
let symbol = if value { kw::True } else { kw::False };
(token::Bool, symbol, None)
}
LitKind::Err => unreachable!(),
// This only shows up in places like `-Zunpretty=hir` output, so we
// don't bother to produce something useful.
LitKind::Err => (token::Err, Symbol::intern("<bad-literal>"), None),
};

token::Lit::new(kind, symbol, suffix)
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/unpretty/bad-literal.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// compile-flags: -Zunpretty=hir
// check-fail

// In #100948 this caused an ICE with -Zunpretty=hir.
fn main() {
1u;
//~^ ERROR invalid suffix `u` for number literal
}
10 changes: 10 additions & 0 deletions src/test/ui/unpretty/bad-literal.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: invalid suffix `u` for number literal
--> $DIR/bad-literal.rs:6:5
|
LL | 1u;
| ^^ invalid suffix `u`
|
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)

error: aborting due to previous error

11 changes: 11 additions & 0 deletions src/test/ui/unpretty/bad-literal.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
// compile-flags: -Zunpretty=hir
// check-fail

// In #100948 this caused an ICE with -Zunpretty=hir.
fn main() {
<bad-literal>;
}