-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Update E0038 to the new error format #35537
Conversation
@munyari - Something like this: let mut err = match warning_node_id {
Some(_) => None,
None => {
let trait_str = self.item_path_str(trait_def_id);
let mut db = struct_span_err!(
self.sess, span, E0038,
"the trait `{}` cannot be made into an object",
trait_str);
db.span_label(span,
&format!("the trait `{}` cannot be made \
into an object", trait_str));
Some(db)
}
}; |
Also, when you update this label, be sure to run:
I'm seeing 6 unit tests that will also need to be updated once you add the label. |
@jonathandturner I just made the update |
Looks good! @bors r+ rollup |
📌 Commit 20ea8cb has been approved by |
Update E0038 to the new error format Part of rust-lang#35233 Addresses rust-lang#35500 "r? @jonathandturner This doesn't compile yet, and I need help. In my naive solution, adding the span label makes our error message a mutable `errors::DiagnosticBuilder` pointer. ```bash python src/bootstrap/bootstrap.py --step check-cfail E0038 --stage 1 ``` ``` Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Compiling rustc v0.0.0 (file:///home/nash/code/rust/src/librustc) src/librustc/traits/error_reporting.rs:735:9: 735:12 error: mismatched types [E0308] src/librustc/traits/error_reporting.rs:735 err ^~~ src/librustc/traits/error_reporting.rs:735:9: 735:12 help: run `rustc --explain E0308` to see a detailed explanation src/librustc/traits/error_reporting.rs:735:9: 735:12 note: expected type `core::option::Option<errors::DiagnosticBuilder<'tcx>>` src/librustc/traits/error_reporting.rs:735:9: 735:12 note: found type `core::option::Option<&mut errors::DiagnosticBuilder<'_>>` error: aborting due to previous error error: Could not compile `rustc`. To learn more, run the command again with --verbose. command did not execute successfully: "/home/nash/code/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-unknown-linux-gnu" "--release" "--features" " jemalloc" "--manifest-path" "/home/nash/code/rust/src/rustc/Cargo.toml" expected success, got: exit code: 101 ```
Update E0038 to the new error format Part of rust-lang#35233 Addresses rust-lang#35500 "r? @jonathandturner This doesn't compile yet, and I need help. In my naive solution, adding the span label makes our error message a mutable `errors::DiagnosticBuilder` pointer. ```bash python src/bootstrap/bootstrap.py --step check-cfail E0038 --stage 1 ``` ``` Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Compiling rustc v0.0.0 (file:///home/nash/code/rust/src/librustc) src/librustc/traits/error_reporting.rs:735:9: 735:12 error: mismatched types [E0308] src/librustc/traits/error_reporting.rs:735 err ^~~ src/librustc/traits/error_reporting.rs:735:9: 735:12 help: run `rustc --explain E0308` to see a detailed explanation src/librustc/traits/error_reporting.rs:735:9: 735:12 note: expected type `core::option::Option<errors::DiagnosticBuilder<'tcx>>` src/librustc/traits/error_reporting.rs:735:9: 735:12 note: found type `core::option::Option<&mut errors::DiagnosticBuilder<'_>>` error: aborting due to previous error error: Could not compile `rustc`. To learn more, run the command again with --verbose. command did not execute successfully: "/home/nash/code/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-unknown-linux-gnu" "--release" "--features" " jemalloc" "--manifest-path" "/home/nash/code/rust/src/rustc/Cargo.toml" expected success, got: exit code: 101 ```
Update E0038 to the new error format Part of rust-lang#35233 Addresses rust-lang#35500 "r? @jonathandturner This doesn't compile yet, and I need help. In my naive solution, adding the span label makes our error message a mutable `errors::DiagnosticBuilder` pointer. ```bash python src/bootstrap/bootstrap.py --step check-cfail E0038 --stage 1 ``` ``` Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Compiling rustc v0.0.0 (file:///home/nash/code/rust/src/librustc) src/librustc/traits/error_reporting.rs:735:9: 735:12 error: mismatched types [E0308] src/librustc/traits/error_reporting.rs:735 err ^~~ src/librustc/traits/error_reporting.rs:735:9: 735:12 help: run `rustc --explain E0308` to see a detailed explanation src/librustc/traits/error_reporting.rs:735:9: 735:12 note: expected type `core::option::Option<errors::DiagnosticBuilder<'tcx>>` src/librustc/traits/error_reporting.rs:735:9: 735:12 note: found type `core::option::Option<&mut errors::DiagnosticBuilder<'_>>` error: aborting due to previous error error: Could not compile `rustc`. To learn more, run the command again with --verbose. command did not execute successfully: "/home/nash/code/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-unknown-linux-gnu" "--release" "--features" " jemalloc" "--manifest-path" "/home/nash/code/rust/src/rustc/Cargo.toml" expected success, got: exit code: 101 ```
Part of #35233
Addresses #35500
"r? @jonathandturner
This doesn't compile yet, and I need help. In my naive solution, adding the span label makes our error message a mutable
errors::DiagnosticBuilder
pointer.