Skip to content

Commit a729a05

Browse files
authored
Bump to Rust 1.71.1 (#369)
1 parent c0b5970 commit a729a05

File tree

11 files changed

+23
-80
lines changed

11 files changed

+23
-80
lines changed

doc/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ src = "src"
66
title = "PL/Rust Guide"
77

88
[preprocessor.variables.variables]
9-
toolchain_ver = "1.70.0"
9+
toolchain_ver = "1.71.1"

doc/src/install-plrust-on-debian-ubuntu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Where:
2828
Example:
2929

3030
```
31-
plrust-trusted-1.2.3_1.70.0-debian-pg15-amd64.deb
31+
plrust-trusted-1.2.3_1.71.1-debian-pg15-amd64.deb
3232
```
3333

3434
## Preparing the environment

plrust/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fi
6666
git pull
6767
git submodule update --init --recursive
6868
else
69-
git clone https://github.com/tcdi/postgrestd.git --branch "rust-1.70.0" --recurse-submodules
69+
git clone https://github.com/tcdi/postgrestd.git --branch "rust-1.71.1" --recurse-submodules
7070
cd ./postgrestd
7171
fi
7272
rm -f rust-toolchain.toml

plrustc/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fi
2525
export RUSTC_BOOTSTRAP=1
2626

2727
version=$($RUSTC --version | cut -d ' ' -f 2)
28-
if [ "$version" != "1.70.0" ]; then
29-
echo "rustc ('$RUSTC') is not version 1.70.0" >&2
28+
if [ "$version" != "1.71.1" ]; then
29+
echo "rustc ('$RUSTC') is not version 1.71.1" >&2
3030
exit 1
3131
fi
3232

plrustc/plrustc/src/main.rs

Lines changed: 5 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ extern crate rustc_middle;
1111
extern crate rustc_session;
1212
extern crate rustc_span;
1313

14-
use once_cell::sync::Lazy;
1514
use rustc_driver::Callbacks;
1615
use rustc_interface::interface;
1716
use rustc_session::config::ErrorOutputType;
@@ -24,8 +23,6 @@ use std::path::Path;
2423
const PLRUSTC_USER_CRATE_NAME: &str = "PLRUSTC_USER_CRATE_NAME";
2524
const PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS: &str = "PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS";
2625

27-
const PLRUSTC_VERSION: &str = env!("CARGO_PKG_VERSION");
28-
2926
mod lints;
3027

3128
struct PlrustcCallbacks {
@@ -51,62 +48,8 @@ impl Callbacks for PlrustcCallbacks {
5148
}
5249
}
5350

54-
// TODO: eventually we can replace this with:
55-
// rustc_driver::install_ice_hook("https://github.com/tcdi/plrust/issues/new", |_| ());
56-
fn install_ice_hook() {
57-
fn report_plrustc_ice(info: &std::panic::PanicInfo<'_>, bug_report_url: &str) {
58-
// Invoke the default panic handler to print the message and (possibly) a back trace
59-
(*PANIC_HOOK)(info);
60-
// Separate output with an empty line
61-
eprintln!();
62-
63-
let fallback_bundle = rustc_errors::fallback_fluent_bundle(
64-
rustc_driver::DEFAULT_LOCALE_RESOURCES.into(),
65-
false,
66-
);
67-
let emitter = Box::new(rustc_errors::emitter::EmitterWriter::stderr(
68-
rustc_errors::ColorConfig::Auto,
69-
None,
70-
None,
71-
fallback_bundle,
72-
false,
73-
false,
74-
None,
75-
false,
76-
false,
77-
rustc_errors::TerminalUrl::No,
78-
));
79-
let handler = rustc_errors::Handler::with_emitter(true, None, emitter);
80-
81-
// Don't need to print anything extra for ExplicitBug
82-
if !info.payload().is::<rustc_errors::ExplicitBug>() {
83-
let mut d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
84-
handler.emit_diagnostic(&mut d);
85-
}
86-
handler.note_without_error("`plrustc` unexpectedly panicked. This is probably a bug.");
87-
handler.note_without_error(&format!("Please file a bug report at <{bug_report_url}>"));
88-
handler.note_without_error(&format!("plrustc version: {PLRUSTC_VERSION}"));
89-
90-
// If backtraces are enabled, also print the query stack
91-
let backtrace = std::env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0");
92-
93-
let num_frames = if backtrace { None } else { Some(2) };
94-
95-
interface::try_print_query_stack(&handler, num_frames);
96-
}
97-
98-
type PanicCallback = Box<dyn Fn(&std::panic::PanicInfo<'_>) + Sync + Send + 'static>;
99-
static PANIC_HOOK: Lazy<PanicCallback> = Lazy::new(|| {
100-
let hook = std::panic::take_hook();
101-
let bug_report_url = "https://github.com/tcdi/plrust/issues/new";
102-
std::panic::set_hook(Box::new(|info| report_plrustc_ice(info, bug_report_url)));
103-
hook
104-
});
105-
Lazy::force(&PANIC_HOOK);
106-
}
107-
10851
fn main() {
109-
install_ice_hook();
52+
rustc_driver::install_ice_hook("https://github.com/tcdi/plrust/issues/new", |_| ());
11053
rustc_driver::init_rustc_env_logger();
11154
std::process::exit(rustc_driver::catch_with_exit_code(move || {
11255
let args = rustc_driver::args::arg_expand_all(&std::env::args().collect::<Vec<_>>());
@@ -177,7 +120,7 @@ impl PlrustcConfig {
177120
let Some(allowed) = self.plrust_user_crate_allowed_source_paths.as_deref() else {
178121
early_error(
179122
ErrorOutputType::default(),
180-
&format!(
123+
format!(
181124
"if `{PLRUSTC_USER_CRATE_NAME}` is provided, \
182125
then `{PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS}` should also be provided",
183126
),
@@ -189,22 +132,22 @@ impl PlrustcConfig {
189132
if !path.is_absolute() {
190133
early_error(
191134
ErrorOutputType::default(),
192-
&format!("`{PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS}` contains relative path: {allowed:?}"),
135+
format!("`{PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS}` contains relative path: {allowed:?}"),
193136
);
194137
}
195138
let path = path.canonicalize().ok()?;
196139
let Some(pathstr) = path.to_str() else {
197140
early_error(
198141
ErrorOutputType::default(),
199-
&format!("`{PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS}` contains non-UTF-8 path: {allowed:?}"),
142+
format!("`{PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS}` contains non-UTF-8 path: {allowed:?}"),
200143
);
201144
};
202145
Some(pathstr.to_owned())
203146
}).collect::<Vec<String>>();
204147
if allowed_source_dirs.is_empty() {
205148
early_error(
206149
ErrorOutputType::default(),
207-
&format!(
150+
format!(
208151
"`{PLRUSTC_USER_CRATE_ALLOWED_SOURCE_PATHS}` was provided but contained no paths \
209152
which exist: {allowed:?}",
210153
),

plrustc/plrustc/uitests/ice_hook.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// normalize-stderr-test: "plrustc version: .*" -> "plrustc version: <version here>"
44
// normalize-stderr-test: "force_ice.rs:\d*:\d*" -> "force_ice.rs"
55
// normalize-stderr-test: "(?ms)query stack during panic:\n.*end of query stack\n" -> ""
6+
// normalize-stderr-test: "note: rustc .*? running on .*" -> "note: rustc <version here> running on <target here>"
67
#![crate_type = "lib"]
78
// The comments above are to clean up file/line/version numbers, backtrace info,
89
// etc. We want to avoid ice_hook.stderr changing more than is needed.
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
thread 'rustc' panicked at 'Here is your ICE', plrustc/src/lints/force_ice.rs
22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
33

4-
error: internal compiler error: unexpected panic
4+
error: the compiler unexpectedly panicked. this is a bug.
55

6-
note: `plrustc` unexpectedly panicked. This is probably a bug.
6+
note: we would appreciate a bug report: https://github.com/tcdi/plrust/issues/new
77

8-
note: Please file a bug report at <https://github.com/tcdi/plrust/issues/new>
8+
note: rustc <version here> running on <target here>
99

10-
note: plrustc version: <version here>
10+
note: compiler flags: -C prefer-dynamic -Z ui-testing
1111

12-
thread panicked while panicking. aborting.
12+
query stack during panic:
13+
thread panicked while processing panic. aborting.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
error: `Self` pattern on tuple struct used to access private field
1+
error[E0603]: tuple struct constructor `std::boxed::Box` is private
22
--> $DIR/tuple_struct_self_pat_box.rs:10:13
33
|
44
LL | let Self(ptr, _) = self;
55
| ^^^^^^^^^^^^
6-
|
7-
= note: `-F plrust-tuple-struct-self-pattern` implied by `-F plrust-lints`
86

97
error: aborting due to previous error
108

9+
For more information about this error, try `rustc --explain E0603`.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
error: `Self` pattern on tuple struct used to access private field
1+
error[E0603]: tuple struct constructor `my::Foo` is private
22
--> $DIR/tuple_struct_self_pat_local_priv.rs:8:13
33
|
44
LL | let Self(s) = self;
55
| ^^^^^^^
6-
|
7-
= note: `-F plrust-tuple-struct-self-pattern` implied by `-F plrust-lints`
86

97
error: aborting due to previous error
108

9+
For more information about this error, try `rustc --explain E0603`.

plrustc/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "1.70.0"
2+
channel = "1.71.1"
33
components = [ "rustfmt", "rust-src", "rustc-dev", "cargo", "llvm-tools" ]
44
targets = [ ]
55
profile = "minimal"

0 commit comments

Comments
 (0)