Change rust/upb to only ever do `use super::` rather than `use crate::`

This makes it more 'relocatable' as a module into a monolithic runtime crate.

PiperOrigin-RevId: 655215778
pull/17580/head
Protobuf Team Bot 8 months ago committed by Copybara-Service
parent 224573d66a
commit 607b4b1b6c
  1. 2
      rust/upb/arena.rs
  2. 7
      rust/upb/array.rs
  3. 2
      rust/upb/extension_registry.rs
  4. 7
      rust/upb/map.rs
  5. 4
      rust/upb/message.rs
  6. 2
      rust/upb/message_value.rs
  7. 2
      rust/upb/mini_table.rs
  8. 2
      rust/upb/owned_arena_box.rs
  9. 2
      rust/upb/text.rs
  10. 2
      rust/upb/wire.rs

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::opaque_pointee::opaque_pointee;
use super::opaque_pointee::opaque_pointee;
use std::alloc::{self, Layout};
use std::cell::UnsafeCell;
use std::marker::PhantomData;

@ -5,8 +5,8 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::opaque_pointee::opaque_pointee;
use crate::{upb_MessageValue, upb_MutableMessageValue, CType, RawArena};
use super::opaque_pointee::opaque_pointee;
use super::{upb_MessageValue, upb_MutableMessageValue, CType, RawArena};
use std::ptr::NonNull;
opaque_pointee!(upb_Array);
@ -27,13 +27,14 @@ extern "C" {
#[cfg(test)]
mod tests {
use super::super::Arena;
use super::*;
#[test]
fn array_ffi_test() {
// SAFETY: FFI unit test uses C API under expected patterns.
unsafe {
let arena = crate::Arena::new();
let arena = Arena::new();
let raw_arena = arena.raw();
let array = upb_Array_New(raw_arena, CType::Float);

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::opaque_pointee::opaque_pointee;
use super::opaque_pointee::opaque_pointee;
use std::ptr::NonNull;
opaque_pointee!(upb_ExtensionRegistry);

@ -5,8 +5,8 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::opaque_pointee::opaque_pointee;
use crate::{upb_MessageValue, CType, RawArena};
use super::opaque_pointee::opaque_pointee;
use super::{upb_MessageValue, CType, RawArena};
use std::ptr::NonNull;
opaque_pointee!(upb_Map);
@ -49,13 +49,14 @@ extern "C" {
#[cfg(test)]
mod tests {
use super::super::Arena;
use super::*;
#[test]
fn map_ffi_test() {
// SAFETY: FFI unit test uses C API under expected patterns.
unsafe {
let arena = crate::Arena::new();
let arena = Arena::new();
let raw_arena = arena.raw();
let map = upb_Map_New(raw_arena, CType::Bool, CType::Double);
assert_eq!(upb_Map_Size(map), 0);

@ -5,8 +5,8 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::opaque_pointee::opaque_pointee;
use crate::{upb_ExtensionRegistry, upb_MiniTable, upb_MiniTableField, RawArena};
use super::opaque_pointee::opaque_pointee;
use super::{upb_ExtensionRegistry, upb_MiniTable, upb_MiniTableField, RawArena};
use std::ptr::NonNull;
opaque_pointee!(upb_Message);

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::{RawArray, RawMap, RawMessage, StringView};
use super::{RawArray, RawMap, RawMessage, StringView};
// Transcribed from google3/third_party/upb/upb/message/value.h
#[repr(C)]

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::opaque_pointee::opaque_pointee;
use super::opaque_pointee::opaque_pointee;
use std::ptr::NonNull;
opaque_pointee!(upb_MiniTable);

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::Arena;
use super::Arena;
use std::fmt::{self, Debug};
use std::ops::{Deref, DerefMut};
use std::ptr::NonNull;

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::{upb_MiniTable, RawMessage};
use super::{upb_MiniTable, RawMessage};
extern "C" {
/// Returns the minimum needed length (excluding NULL) that `buf` has to be

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use crate::{upb_ExtensionRegistry, upb_MiniTable, Arena, RawArena, RawMessage};
use super::{upb_ExtensionRegistry, upb_MiniTable, Arena, RawArena, RawMessage};
// LINT.IfChange(encode_status)
#[repr(C)]

Loading…
Cancel
Save